/* =========================================================
   Parvathy Raj: portfolio
   Violet-to-magenta gradient theme. Dark by default, light via toggle.
   ========================================================= */
:root,
[data-theme="dark"] {
  --bg: #0e0b16;
  --bg-2: #141020;
  --bg-3: #1e1830;
  --card: rgba(26, 21, 40, 0.66);
  --card-hover: rgba(36, 29, 56, 0.9);
  --line: rgba(235, 225, 255, 0.07);
  --line-strong: rgba(235, 225, 255, 0.14);
  --text: #e9e5f2;
  --text-2: #a8a0bd;
  --muted: #6f6787;
  --heading: #f6f3fc;
  --a1: #8b5cf6;
  --a2: #d946ef;
  --grad: linear-gradient(135deg, var(--a1) 0%, var(--a2) 100%);
  --a1-soft: rgba(167, 139, 250, 0.1);
  --a1-line: rgba(167, 139, 250, 0.28);
  --glow: rgba(139, 92, 246, 0.3);
  --pill-text: #c4b5fd;
  --nav-bg: rgba(14, 11, 22, 0.82);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --on-accent: #ffffff;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f8f6fd;
  --bg-2: #ffffff;
  --bg-3: #efeaf9;
  --card: rgba(255, 255, 255, 0.88);
  --card-hover: #ffffff;
  --line: rgba(40, 20, 80, 0.08);
  --line-strong: rgba(40, 20, 80, 0.16);
  --text: #2a2438;
  --text-2: #5d5670;
  --muted: #908aa3;
  --heading: #1a1428;
  --a1: #6d28d9;
  --a2: #c026d3;
  --a1-soft: rgba(109, 40, 217, 0.07);
  --a1-line: rgba(109, 40, 217, 0.2);
  --glow: rgba(109, 40, 217, 0.2);
  --pill-text: #5b21b6;
  --nav-bg: rgba(248, 246, 253, 0.85);
  --shadow: 0 16px 40px rgba(40, 20, 80, 0.08);
  --on-accent: #ffffff;
  color-scheme: light;
}

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --max: 1180px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3 { color: var(--heading); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
svg { width: 1em; height: 1em; flex: none; }
::selection { background: var(--a1); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--a2); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 300; background: var(--a1); color: var(--on-accent); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* ---------- Progress + top bar ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 210; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }

.topbar {
  position: fixed; inset: 0 0 auto; z-index: 200; height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.topbar-inner { height: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 28px; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { position: relative; font-size: 14.5px; font-weight: 500; color: var(--text-2); padding: 6px 0; transition: color 0.2s; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; border-radius: 2px; background: var(--grad); transition: width 0.3s var(--ease); }
.nav a:hover, .nav a.active { color: var(--heading); }
.nav a:hover::after, .nav a.active::after { width: 100%; }

.round-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text-2); font-size: 18px;
  transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}
.round-btn:hover { color: var(--a2); border-color: var(--a1-line); }
.theme-btn:hover { transform: rotate(25deg); }
[data-theme="dark"] .theme-btn .moon, [data-theme="light"] .theme-btn .sun { display: none; }
.theme-btn .sun { color: var(--a2); }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; padding: 0 26px; border-radius: 12px;
  font-weight: 700; font-size: 15px; color: var(--on-accent);
  background: var(--grad);
  box-shadow: 0 8px 26px var(--glow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px var(--glow); }
.btn svg { font-size: 17px; }
.btn-ghost { background: var(--bg-2); color: var(--heading); border: 1px solid var(--line-strong); box-shadow: none; }
.btn-ghost:hover { border-color: var(--a1); color: var(--heading); box-shadow: 0 8px 24px var(--glow); }
.btn-small { height: 42px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.btn-small svg { font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 80px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.glow { position: absolute; width: 620px; height: 620px; border-radius: 50%; filter: blur(130px); opacity: 0.16; }
.glow-1 { top: -220px; right: -140px; background: var(--a1); }
.glow-2 { bottom: -260px; left: -160px; background: var(--a2); opacity: 0.12; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 64px; }
.hero-label { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--a2); margin-bottom: 22px; }
.hero-label::before { content: ""; width: 28px; height: 2px; background: var(--a2); }
.hero h1 { font-size: clamp(42px, 6.4vw, 72px); letter-spacing: -0.035em; line-height: 1.06; margin-bottom: 14px; }
.hero h1 .grad { display: inline-block; padding-bottom: 0.06em; }
.hero-role { font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; color: var(--text-2); letter-spacing: -0.01em; margin-bottom: 18px; }
.rotator { font-family: var(--mono); font-size: 16px; color: var(--a1); margin-bottom: 26px; min-height: 1.7em; }
.rotator .prompt { color: var(--a2); margin-right: 4px; }
.rot-caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 3px; vertical-align: text-bottom; background: var(--a1); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lede { font-size: 18px; line-height: 1.8; max-width: 540px; margin-bottom: 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }
.socials { display: flex; gap: 12px; }
.socials a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text-2); font-size: 18px;
  transition: transform 0.25s var(--ease), color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.socials a:hover { color: var(--a1); border-color: var(--a1); transform: translateY(-3px); box-shadow: 0 8px 20px var(--glow); }
.socials.small a { width: 38px; height: 38px; font-size: 16px; }

.monogram {
  position: relative; width: 300px; height: 300px; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad);
  animation: float 6s ease-in-out infinite;
}
.monogram::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--grad); filter: blur(28px); opacity: 0.45; z-index: -1; }
.monogram::after { content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 1px dashed var(--a1-line); animation: spin 40s linear infinite; }
.monogram span { font-size: 104px; font-weight: 900; color: var(--on-accent); letter-spacing: -0.04em;  }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .monogram, .monogram::after { animation: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 11vh, 120px) 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--a1); margin-bottom: 14px; }
.kicker::before { content: "// "; color: var(--a2); }
.section-head h2 { font-size: clamp(30px, 4.2vw, 44px); }
.bar { display: block; width: 56px; height: 3px; border-radius: 3px; background: var(--grad); margin: 22px auto 0; }
.section-intro { margin-top: 22px; font-size: 17px; }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Shared glass card */
.service, .skill-cat, .job, .card, .more, .edu-card, .chat, .msg-form, .contact-list a, .about-meta > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 20% { box-shadow: 0 0 0 4px var(--a1-line), 0 0 40px var(--glow); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.about-text p { font-size: 17px; margin-bottom: 20px; }
.about-text p.summary-label { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--a1); margin-bottom: 14px; }
.about-text strong { color: var(--heading); font-weight: 700; }
.about-meta { display: grid; gap: 12px; margin-top: 28px; }
.about-meta > div { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); }
.about-meta small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); line-height: 1.5; }
.about-meta span:last-child { color: var(--heading); font-weight: 600; font-size: 15px; line-height: 1.4; }

.ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--a1-soft); color: var(--a1); border: 1px solid var(--a1-line); font-size: 19px; }

.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 56px; }
.service { padding: 26px 24px; transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s, background-color 0.3s; }
.service:hover { transform: translateY(-5px); border-color: var(--a1-line); background: var(--card-hover); box-shadow: 0 0 40px var(--glow); }
.service h3 { font-size: 17px; margin: 18px 0 8px; }
.service p { font-size: 14.5px; line-height: 1.65; }

/* Chat */
.chat { display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); font-size: 19px; flex: none; }
.chat-title { color: var(--heading); font-weight: 700; font-size: 15px; line-height: 1.3; }
.chat-sub { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.live { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.chat-log { height: 270px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.6; }
.msg.bot { align-self: flex-start; background: var(--bg-3); color: var(--text); border-top-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--grad); color: var(--on-accent); border-top-right-radius: 4px; }
.msg.refusal { border: 1px dashed var(--a1-line); }
.msg a { color: var(--a2); text-decoration: underline; text-underline-offset: 2px; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px; border-radius: 5px; font-size: 11px; font-weight: 700; text-decoration: none !important; background: var(--a1-soft); color: var(--a1) !important; border: 1px solid var(--a1-line); vertical-align: 1px; }
.sources { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 12.5px; }
.sources li { display: flex; gap: 8px; align-items: center; }
.sources b { color: var(--a1); font-family: var(--mono); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chips { display: flex; gap: 8px; padding: 0 18px 14px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--bg-3); border: 1px solid var(--line); transition: color 0.2s, border-color 0.2s; }
.chip:hover { color: var(--a1); border-color: var(--a1-line); }
.chat-form { display: flex; gap: 8px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 14.5px; color: var(--heading); background: var(--bg-2); border: 1px solid var(--line-strong); }
.chat-form input:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 3px var(--a1-soft); }
.chat-form button { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); font-size: 17px; flex: none; }

/* ---------- Skills ---------- */
.skill-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.skill-cat { padding: 28px; transition: border-color 0.3s, background-color 0.3s, transform 0.3s var(--ease); }
.skill-cat:hover { border-color: var(--line-strong); background: var(--card-hover); transform: translateY(-3px); }
.skill-cat h3 { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--a1); margin-bottom: 20px; }
.skill-cat h3 svg { font-size: 17px; color: var(--a2); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { font-family: var(--mono); font-size: 12.5px; line-height: 1.4; padding: 6px 12px; border-radius: 999px; color: var(--pill-text); background: var(--a1-soft); border: 1px solid var(--a1-line); transition: transform 0.2s; }
.pills li:hover { transform: translateY(-2px); }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; display: grid; gap: 28px; padding-left: 48px; max-width: 980px; margin: 0 auto; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(to bottom, var(--a1), var(--a2), transparent); }
.job { position: relative; padding: 28px 30px; transition: border-color 0.3s, background-color 0.3s; }
.job:hover { border-color: var(--a1-line); background: var(--card-hover); }
.job::before { content: ""; position: absolute; left: -41px; top: 34px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--a1); box-shadow: 0 0 0 5px var(--a1-soft); }
.job:first-child::before { background: var(--a1); }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.job h3 { font-size: 20px; }
.company { display: inline-block; font-weight: 700; margin-top: 4px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.when { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-top: 4px; }
.points { display: grid; gap: 8px; margin-bottom: 18px; }
.points li { position: relative; padding-left: 22px; font-size: 15.5px; line-height: 1.65; }
.points li::before { content: "▸"; position: absolute; left: 2px; top: 0; color: var(--a1); }

/* ---------- Projects ---------- */
.cards { display: grid; gap: 32px; }
.card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 40px; padding: 36px; overflow: hidden; transition: border-color 0.35s, box-shadow 0.35s; }
.card:nth-child(even) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.card:nth-child(even) .card-body { order: 2; }
.card:hover, .card.previewing { border-color: var(--a1-line); box-shadow: 0 0 60px var(--glow); }
.card-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--heading); margin-bottom: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 0 4px var(--a1-soft); }
.card h3 { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 12px; }
.card-body > p { font-size: 15.5px; margin-bottom: 18px; }
.checks { display: grid; gap: 8px; margin-bottom: 22px; }
.checks li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.checks li::before { content: "✦"; position: absolute; left: 2px; top: 0; color: var(--a1); font-size: 13px; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.mini-metrics div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 12px 10px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); text-align: center; }
.mini-metrics dd { font-size: 22px; font-weight: 800; line-height: 1.2; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.mini-metrics dt { font-size: 11.5px; line-height: 1.3; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Research paper card: the right side is a cover panel linking to the PDF */
.paper-cover { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 36px 32px; min-height: 300px; justify-content: center; border-radius: var(--r-md); background: linear-gradient(145deg, var(--a1-soft), transparent 70%), var(--bg-3); border: 1px solid var(--a1-line); color: var(--text); overflow: hidden; transition: transform 0.35s var(--ease), box-shadow 0.35s; }
.paper-cover::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.paper-cover:hover { transform: translateY(-4px); box-shadow: 0 0 40px var(--glow); }
.paper-venue { font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.paper-conf { font-size: 15.5px; line-height: 1.5; color: var(--heading); font-weight: 600; }
.paper-org { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.paper-open { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--a1); }
.paper-open svg { width: 16px; height: 16px; }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden; background: var(--bg-3); border: 1px solid var(--line); box-shadow: var(--shadow); }
.thumb video { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.6s var(--ease); }
.card:hover .thumb video, .card.previewing .thumb video { transform: scale(1.03); }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 55%); transition: opacity 0.4s; }
.play { position: absolute; left: 50%; top: 50%; z-index: 1; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); font-size: 24px; box-shadow: 0 10px 30px var(--glow); transition: transform 0.3s var(--ease), opacity 0.3s; }
.play svg { margin-left: 3px; }
.thumb:hover .play { transform: scale(1.1); }
.card.previewing .play { opacity: 0; transform: scale(0.8); }
.card.previewing .thumb::after { opacity: 0; }

.more { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 32px; padding: 26px 30px; }
.more h3 { font-size: 19px; margin-bottom: 4px; }
.more p { font-size: 15px; }
.more .btn { flex: none; }

/* ---------- Education ---------- */
.edu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 860px; margin: 0 auto; }
.edu-card { display: flex; flex-direction: column; padding: 30px 28px; transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s; }
.edu-card:hover { transform: translateY(-5px); border-color: var(--a1-line); box-shadow: 0 0 40px var(--glow); }
.edu-type { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a2); margin: 20px 0 8px; }
.edu-card h3 { font-size: 19px; line-height: 1.3; margin-bottom: 8px; }
.edu-card p:last-child { font-size: 15px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.contact-title { font-size: 24px; margin-bottom: 10px; }
.contact-intro { font-size: 16.5px; margin-bottom: 26px; }
.contact-list { display: grid; gap: 12px; }
.contact-list li { display: flex; gap: 10px; }
.contact-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); transition: border-color 0.25s, transform 0.25s var(--ease), background-color 0.25s; }
.contact-list li > a:first-child { flex: 1; min-width: 0; }
.contact-list a:hover { border-color: var(--a1-line); background: var(--card-hover); transform: translateX(4px); }
.contact-list b { display: block; color: var(--heading); font-weight: 600; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.contact-list small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.contact-list .call { width: 58px; justify-content: center; color: var(--a1); font-size: 19px; flex: none; }
.contact-list .call:hover { transform: none; }

.msg-form { padding: 34px; display: grid; gap: 20px; box-shadow: var(--shadow); }
.msg-form label { display: grid; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.msg-form .opt { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.msg-form input, .msg-form textarea { width: 100%; font-family: var(--font); font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--heading); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 13px 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.msg-form textarea { resize: vertical; min-height: 130px; }
.msg-form input::placeholder, .msg-form textarea::placeholder { color: var(--muted); }
.msg-form input:focus, .msg-form textarea:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 3px var(--a1-soft); }
.msg-form [aria-invalid="true"] { border-color: var(--a1); }
.form-error { color: var(--a1); font-size: 14px; }
.form-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: -6px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--heading); letter-spacing: -0.01em; }
.mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); font-size: 13px; font-weight: 800; }
.footer p { font-size: 14px; color: var(--muted); }

.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 150; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); font-size: 20px; box-shadow: 0 10px 28px var(--glow); transition: transform 0.25s var(--ease); }
.to-top:hover { transform: translateY(-3px); }
.to-top[hidden] { display: none; }

/* ---------- Modal ---------- */
.modal { margin: auto; width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--bg-2); color: var(--text-2); overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.modal::backdrop { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(6px); }
.modal[open] { animation: pop 0.3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 18px; }
.modal-video { background: #000; }
.modal-video video { width: 100%; max-height: 60vh; object-fit: contain; }
.modal-body { padding: 30px 34px 34px; display: grid; gap: 16px; }
.modal-body h3 { font-size: 26px; margin-top: -6px; }
.modal-body .card-tag { margin-bottom: 0; }
.modal-body .cap { font-size: 13.5px; color: var(--muted); font-style: italic; }
.modal-body .checks, .modal-body .mini-metrics { margin-bottom: 0; }
.modal-body .btn { justify-self: start; }
.modal-body code { font-family: var(--mono); font-size: 0.9em; color: var(--a2); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .card:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px; }
  .card:nth-child(even) .card-body { order: 0; }
  .card .thumb { order: -1; }
  .monogram { width: 240px; height: 240px; }
  .monogram span { font-size: 84px; }
  .hero-grid { gap: 40px; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .monogram { order: -1; width: 170px; height: 170px; margin: 0 auto 8px; }
  .monogram::after { inset: -12px; }
  .monogram span { font-size: 60px; }
  .hero-label, .hero-cta, .socials { justify-content: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .skill-cats { grid-template-columns: minmax(0, 1fr); }
  .edu { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
  .more { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .menu-btn { display: grid; }
  .topbar-inner { gap: 10px; }
  .nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 24px 20px; background: var(--bg-2); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav.open { opacity: 1; transform: none; visibility: visible; }
  .nav a { font-size: 17px; font-weight: 600; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav a:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .section-head { margin-bottom: 40px; }
  .services { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .timeline { padding-left: 30px; }
  .timeline::before { left: 6px; }
  .job { padding: 22px 20px; }
  .job::before { left: -30px; top: 28px; width: 14px; height: 14px; }
  .job-head { flex-direction: column; gap: 6px; }
  .when { padding-top: 0; white-space: normal; }
  .card, .card:nth-child(even) { padding: 18px; }
  .skill-cat, .edu-card { padding: 22px 20px; }
  .msg-form { padding: 24px 20px; }
  .more { padding: 22px 20px; }
  .more .btn { width: 100%; }
  .modal-body { padding: 22px 20px 26px; }
  .chat-log { height: 300px; }
  .mini-metrics dd { font-size: 20px; }
}
