/* ==========================================================
   Aalok Shah — resume site
   Firmware / terminal theme. Dark default, light toggle.
   ========================================================== */

/* Self-hosted variable fonts (latin subset). One file per family covers every weight used. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;

  --radius: 16px;
  --nav-h: 68px;
  --maxw: 1160px;
  --ease: cubic-bezier(.22, .8, .22, 1);

  /* Tiled watermark shape (used as a mask so it follows the theme colour) */
  --wm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='260'%3E%3Cg transform='rotate(-26 190 130)' font-family='Courier New,monospace' font-weight='700' fill='%23000' text-anchor='middle'%3E%3Ctext x='190' y='122' font-size='24' letter-spacing='6'%3EAALOK SHAH%3C/text%3E%3Ctext x='190' y='148' font-size='10' letter-spacing='3'%3E%C2%A9 RESUME %C2%B7 ORIGINAL%3C/text%3E%3C/g%3E%3C/svg%3E");
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06080c;
  --bg2: #090d13;
  --surface: #0d121a;
  --surface2: #131a25;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #3ddc97;
  --accent2: #4cc9f0;
  --accent-ink: #04140c;
  --grid: rgba(255, 255, 255, .045);
  --spot: rgba(61, 220, 151, .10);
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --wm-opacity: .05;
  --nav-bg: rgba(6, 8, 12, .72);
  --node: 61, 220, 151;
  --node2: 76, 201, 240;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fa;
  --bg2: #edf1f6;
  --surface: #ffffff;
  --surface2: #f0f3f8;
  --border: rgba(13, 21, 32, .10);
  --border-strong: rgba(13, 21, 32, .20);
  --text: #0d1520;
  --muted: #566275;
  --accent: #067a4b;
  --accent2: #086c98;
  --accent-ink: #ffffff;
  --grid: rgba(13, 21, 32, .06);
  --spot: rgba(7, 138, 85, .09);
  --shadow: 0 18px 40px rgba(20, 35, 60, .10);
  --wm-opacity: .065;
  --nav-bg: rgba(245, 247, 250, .78);
  --node: 6, 122, 75;
  --node2: 8, 108, 152;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
html.booting { overflow: hidden; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Watermark ---------- */
.wm {
  position: fixed; inset: 0; z-index: 70; pointer-events: none;
  background: var(--text);
  opacity: var(--wm-opacity);
  -webkit-mask-image: var(--wm); mask-image: var(--wm);
  -webkit-mask-size: 380px 260px; mask-size: 380px 260px;
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
  user-select: none;
}

/* ---------- Scroll progress ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90; pointer-events: none; }
#progress { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* ---------- Boot overlay ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: #03050a; color: #3ddc97;
  font-family: var(--font-mono);
  transition: opacity .6s ease, visibility .6s ease;
}
.booting .boot { display: flex; animation: bootFailsafe .5s 7s forwards; }
.boot.hide { display: flex; opacity: 0; visibility: hidden; pointer-events: none; }
.boot-log { margin: 0; padding: 24px; font: 13.5px/1.75 var(--font-mono); white-space: pre-wrap; max-width: 640px; width: 100%; }
.boot-log .ok { color: #3ddc97; }
.boot-log .dim { color: #5c6b7f; }
.boot-log .hi { color: #4cc9f0; }
.boot-skip {
  position: absolute; right: 24px; bottom: 24px; background: transparent; border: 1px solid #2a3646; color: #8b98a9;
  padding: 6px 14px; border-radius: 999px; font: 12px var(--font-mono);
}
.boot-skip:hover { color: #3ddc97; border-color: #3ddc97; }
@keyframes bootFailsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80; height: var(--nav-h);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.nav.scrolled { background: var(--nav-bg); border-bottom-color: var(--border); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
.nav-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font: 700 20px var(--font-mono); color: var(--text); letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.cursor, .caret { color: var(--accent); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; background: var(--surface2); }
.nav-links a.active { color: var(--accent); background: var(--surface2); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .2s, transform .2s, color .2s;
}
.icon-btn.nav-toggle { display: none; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
:root[data-theme="dark"] .ico-moon, :root:not([data-theme]) .ico-moon { display: none; }
:root[data-theme="light"] .ico-sun { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px;
  font: 600 15px var(--font-body); border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .25s, background .25s, border-color .25s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 26px -8px var(--accent); }
.btn-primary:hover { box-shadow: 0 12px 30px -6px var(--accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 90px; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 35%, #000 15%, transparent 72%);
}
.hero::after {
  content: ""; position: absolute; z-index: -3; width: 720px; height: 720px; left: -180px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--node), .16), transparent 65%);
}
#mesh { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: -1; background: linear-gradient(to bottom, transparent, var(--bg)); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px var(--font-mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 20px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(var(--node), .6); } 70% { box-shadow: 0 0 0 10px rgba(var(--node), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--node), 0); } }

.hero-name { font-size: clamp(54px, 9.5vw, 120px); font-weight: 700; letter-spacing: -.03em; line-height: .98; margin-bottom: 18px; }
.outline { color: transparent; -webkit-text-stroke: 2px var(--accent); }
.hero-tag { font: 500 clamp(19px, 2.4vw, 26px) var(--font-head); color: var(--text); margin-bottom: 14px; max-width: 30ch; }
.hero-typed { font: 500 16px var(--font-mono); color: var(--accent2); min-height: 1.6em; margin-bottom: 18px; }
.prompt { color: var(--accent); margin-right: 6px; }
.hero-sum { color: var(--muted); font-size: 17px; max-width: 58ch; margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-in { animation: heroIn .9s var(--ease) both; }
html.booting .hero-in { animation: none; opacity: 0; }
.hero-copy > .hero-in:nth-child(1) { animation-delay: 0s; }
.hero-copy > .hero-in:nth-child(2) { animation-delay: .05s; }
.hero-copy > .hero-in:nth-child(3) { animation-delay: .15s; }
.hero-copy > .hero-in:nth-child(4) { animation-delay: .27s; }
.hero-copy > .hero-in:nth-child(5) { animation-delay: .38s; }
.hero-copy > .hero-in:nth-child(6) { animation-delay: .48s; }
.hero-copy > .hero-in:nth-child(7) { animation-delay: .58s; }
.hero-copy > .hero-in:nth-child(8) { animation-delay: .68s; }
.open-badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 12px; margin: 0 0 20px; border: 1px solid rgba(var(--node), .38); border-radius: 999px; background: rgba(var(--node), .08); color: var(--accent); font: 500 12.5px var(--font-mono); letter-spacing: .03em; }
.hero-avatar { display: block; width: 88px; height: 88px; margin: 0 0 22px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(var(--node), .55); box-shadow: 0 0 0 5px rgba(var(--node), .1), var(--shadow); }
.term.hero-in { animation-delay: .5s; }
.scroll-cue.hero-in { animation-delay: 1.3s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Terminal card */
.term { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; font-family: var(--font-mono); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; }
.term-body { padding: 18px 20px 20px; font-size: 13.5px; line-height: 1.7; overflow-x: auto; }
.term-line { margin: 0; white-space: nowrap; }
.ps1 { color: var(--accent); }
.term-out pre { margin: 10px 0 8px; font: inherit; color: var(--text); white-space: pre; transition: opacity .5s ease, transform .5s ease; }
.term-out pre b { font-weight: 400; color: var(--accent2); }
.term-out pre s { text-decoration: none; color: var(--accent); }
.term.pending .term-out pre { opacity: 0; transform: translateY(6px); }
.blink-block { display: inline-block; width: 8px; height: 15px; vertical-align: -2px; background: var(--accent); animation: blink 1.05s steps(1) infinite; }

.scroll-cue { position: absolute; bottom: 34px; left: calc(50% - 12px); width: 24px; height: 38px; border: 2px solid var(--muted); border-radius: 14px; opacity: .7; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Ticker ---------- */
.ticker { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg2); overflow: hidden; padding: 14px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; width: max-content; animation: tick 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { font: 500 13px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding-right: 40px; white-space: nowrap; }
.ticker-track span::before { content: "◆"; color: var(--accent); margin-right: 40px; font-size: 8px; vertical-align: 2px; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Impact stats ---------- */
.impact { padding: 64px 0 0; }
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { padding: 26px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-num { font: 700 clamp(34px, 4.6vw, 50px) var(--font-head); letter-spacing: -.02em; line-height: 1.05; background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px; }
.stat p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { margin-bottom: 52px; }
.sec-idx { display: block; font: 500 14px var(--font-mono); color: var(--accent); margin-bottom: 10px; }
.sec-idx::before { content: "// "; opacity: .6; }
.sec-head h2 { font-size: clamp(34px, 5vw, 54px); font-weight: 700; letter-spacing: -.025em; }
.sec-sub { color: var(--muted); font-size: 18px; margin: 12px 0 0; }

/* Scroll reveal (only hidden when JS is running) */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
html.js .reveal.in { opacity: 1; transform: none; }

/* Cards + spotlight */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: transform .35s var(--ease), border-color .3s, box-shadow .35s; }
.card:hover { border-color: rgba(var(--node), .45); box-shadow: var(--shadow); }
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 45%);
}
.spot:hover::before { opacity: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags span { font: 500 11.5px var(--font-mono); color: var(--accent2); background: rgba(var(--node2), .10); border: 1px solid rgba(var(--node2), .22); padding: 3px 9px; border-radius: 6px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: start; }
.about-copy p { font-size: 17.5px; color: var(--muted); }
.about-copy p:first-child { color: var(--text); font-size: 19px; }
.facts { list-style: none; margin-top: 28px; }
.facts li { display: flex; gap: 16px; padding: 13px 0; border-top: 1px solid var(--border); font-size: 15.5px; }
.facts li:last-child { border-bottom: 1px solid var(--border); }
.facts span { font: 500 12px var(--font-mono); color: var(--accent); min-width: 92px; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }

.stack { position: relative; padding-left: 28px; }
.stack-title { font: 500 13px var(--font-mono); color: var(--muted); margin-bottom: 16px; }
.stack-rail { position: absolute; left: 6px; top: 40px; bottom: 8px; width: 2px; background: var(--border-strong); overflow: hidden; border-radius: 2px; }
.stack-rail i { position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: linear-gradient(to bottom, transparent, var(--accent), transparent); animation: railDown 3.2s linear infinite; }
@keyframes railDown { to { top: 100%; } }
.stack-list { list-style: none; display: grid; gap: 12px; }
.stack-list .card { padding: 16px 20px; }
.stack-list .card::after { content: ""; position: absolute; left: -26px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); transition: background .3s, box-shadow .3s; }
.stack-list .card:hover::after { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.stack-list .card:hover { transform: translateX(6px); }
.stack-list h3 { font-size: 16.5px; margin-bottom: 4px; }
.stack-list p { margin: 0; font-size: 14px; color: var(--muted); font-family: var(--font-mono); line-height: 1.55; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 46px; display: grid; gap: 28px; }
.tl-track { position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); border-radius: 2px; }
.tl-fill { width: 100%; height: 0; background: linear-gradient(to bottom, var(--accent), var(--accent2)); border-radius: 2px; box-shadow: 0 0 12px rgba(var(--node), .6); }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -45px; top: 28px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border-strong); transition: border-color .4s, background .4s, box-shadow .4s; }
.tl-item.in .tl-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(var(--node), .18); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 20px; margin-bottom: 14px; }
.tl-head h3 { font-size: 22px; }
.tl-org { margin: 4px 0 0; color: var(--accent); font-weight: 500; }
.tl-date { font: 500 13px var(--font-mono); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
.tl-card ul { list-style: none; display: grid; gap: 9px; }
.tl-card li { position: relative; padding-left: 20px; color: var(--muted); font-size: 15.5px; }
.tl-card li::before { content: "›"; position: absolute; left: 2px; top: -1px; color: var(--accent); font-weight: 700; }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip-btn { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font: 500 13.5px var(--font-mono); transition: all .2s; }
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.proj { display: flex; flex-direction: column; cursor: pointer; }
.proj:hover { transform: translateY(-5px); }
.proj.is-hidden { display: none; }
.proj.pop { animation: pop .5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.proj-meta { font: 500 12px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.proj h3 { font-size: 20px; margin-bottom: 10px; }
.proj-sum { color: var(--muted); font-size: 15px; margin-bottom: 0; }
.proj .tags { margin-bottom: 18px; }
.proj-open { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 0; color: var(--accent); font: 600 14px var(--font-body); }
.proj-open .ico { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.proj:hover .proj-open .ico { transform: translate(3px, -3px); }

/* Modal */
.proj-modal { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 20px; padding: 0; width: min(720px, calc(100vw - 32px)); max-height: min(86vh, 820px); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.proj-modal[open] { animation: modalIn .35s var(--ease); }
.proj-modal::backdrop { background: rgba(3, 5, 10, .68); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .3s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
.modal-inner { position: relative; padding: 34px 34px 30px; max-height: min(86vh, 820px); overflow-y: auto; }
.modal-inner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--text); opacity: var(--wm-opacity); -webkit-mask-image: var(--wm); mask-image: var(--wm); -webkit-mask-size: 380px 260px; mask-size: 380px 260px; }
.modal-close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.m-meta { font: 500 12px var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; padding-right: 48px; }
.m-title { font-size: 28px; margin-bottom: 8px; padding-right: 48px; }
.m-sum { color: var(--muted); margin-bottom: 4px; }
.m-list { list-style: none; display: grid; gap: 12px; margin-top: 22px; }
.m-list li { position: relative; padding-left: 22px; font-size: 15.5px; color: var(--text); }
.m-list li::before { content: "›"; position: absolute; left: 3px; top: -1px; color: var(--accent); font-weight: 700; }

/* ---------- Skills ---------- */
.skill-search { display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 4px 16px; margin-bottom: 30px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; font-family: var(--font-mono); transition: border-color .2s, box-shadow .2s; }
.skill-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--node), .14); }
.skill-search input { flex: 1; min-width: 0; padding: 12px 0; background: transparent; border: none; outline: none; color: var(--text); font: 500 14.5px var(--font-mono); }
.skill-search input::placeholder { color: var(--muted); opacity: .8; }
.skill-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.skill-card { transition: opacity .3s, transform .35s var(--ease), border-color .3s, box-shadow .35s; }
.skill-card.is-empty { opacity: .3; }
.skill-card h3 { font-size: 19px; margin-bottom: 4px; }
.skill-card .skill-sub { margin-top: 22px; font-size: 16px; }
.skill-label { font: 500 11.5px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin: 16px 0 8px; }
.skill-card h3 + .skill-label { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 12.5px var(--font-mono); padding: 5px 11px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); transition: opacity .25s, border-color .25s, background .25s, color .25s, transform .25s; }
.chip:hover { border-color: rgba(var(--node), .5); }
.chip em { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 5px; }
.chip.dim { opacity: .16; }
.chip.hit { border-color: var(--accent); background: rgba(var(--node), .14); color: var(--accent); transform: translateY(-1px); }

/* ---------- Credentials ---------- */
.cred-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cred { padding: 28px; }
.cred-kicker { font: 500 12px var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.cred h3 { font-size: 20px; margin-bottom: 8px; }
.cred > p { color: var(--muted); }
.cred-big { font: 700 64px var(--font-head); line-height: 1; margin: 12px 0 0 !important; background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.cred-big span { font: 500 15px var(--font-mono); margin-left: 8px; -webkit-text-fill-color: var(--muted); }
.cred-list { list-style: none; display: grid; gap: 14px; }
.cred-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: 15px; }
.cred-list li::before { content: "›"; position: absolute; left: 2px; top: -1px; color: var(--accent); font-weight: 700; }
.cred-list strong { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact { padding-bottom: 130px; }
.contact-card { padding: clamp(28px, 5vw, 60px); text-align: center; overflow: hidden; }
.contact-card::after { content: ""; position: absolute; left: 50%; top: -260px; width: 620px; height: 420px; margin-left: -310px; background: radial-gradient(ellipse, rgba(var(--node), .16), transparent 70%); pointer-events: none; }
.contact-card > * { position: relative; z-index: 1; }
.contact-card .eyebrow { margin-bottom: 18px; }
.contact-card h2 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 700; letter-spacing: -.025em; max-width: 20ch; margin: 0 auto 16px; }
.contact-sub { color: var(--muted); font-size: 18px; max-width: 56ch; margin: 0 auto 36px; }
.contact-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 760px; margin: 0 auto 36px; text-align: left; }
.clink { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 15px; min-width: 0; transition: border-color .25s, transform .25s var(--ease); }
a.clink:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.clink > .ico { color: var(--accent); }
.clink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clink a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clink .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.clink .ico-out { margin-left: auto; opacity: .45; width: 16px; height: 16px; }
.reveal-btn { background: none; border: none; padding: 0; color: var(--accent); font: 500 14.5px var(--font-mono); text-decoration: underline dashed; text-underline-offset: 4px; }
.reveal-btn:hover { text-decoration-style: solid; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.footer p { margin: 0; }
.footer-mono { font-family: var(--font-mono); font-size: 12.5px; opacity: .8; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 95; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 10px; font: 600 14px var(--font-body); box-shadow: var(--shadow); transition: opacity .3s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Career at a glance ---------- */
.career { margin: 0 0 44px; padding: 20px 22px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.career[hidden] { display: none; }
.career-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font: 500 12.5px var(--font-mono); color: var(--muted); margin-bottom: 14px; }
.career-head b { color: var(--accent); font-weight: 500; }
.career-bar { position: relative; height: 38px; }
.career-seg {
  position: absolute; top: 0; height: 100%; display: flex; align-items: center; padding: 0 10px; min-width: 6px;
  font: 500 11.5px var(--font-mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
  background: rgba(var(--node), .14); border: 1px solid rgba(var(--node), .45); border-radius: 7px; cursor: pointer;
  transition: background .25s, border-color .25s, transform .25s var(--ease);
}
.career-seg:nth-child(even) { background: rgba(var(--node2), .14); border-color: rgba(var(--node2), .45); }
.career-seg:hover, .career-seg:focus-visible { background: rgba(var(--node), .32); border-color: var(--accent); transform: translateY(-2px); }
.career-seg:nth-child(even):hover, .career-seg:nth-child(even):focus-visible { background: rgba(var(--node2), .32); border-color: var(--accent2); }
.career-seg.is-now { background: linear-gradient(120deg, rgba(var(--node), .30), rgba(var(--node2), .22)); border-color: var(--accent); }
.career-axis { position: relative; height: 26px; margin-top: 8px; border-top: 1px solid var(--border-strong); }
.career-axis span { position: absolute; top: 4px; transform: translateX(-50%); font: 500 11px var(--font-mono); color: var(--muted); }
.career-axis span::before { content: ""; position: absolute; left: 50%; top: -5px; height: 5px; width: 1px; background: var(--border-strong); }
.career-axis span:last-child { transform: translateX(-100%); }
.tl-dur { color: var(--accent); }
.tl-dur::before { content: "\00b7"; margin-right: 8px; }

/* ---------- Command palette ---------- */
.pal-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: border-color .2s, transform .2s, color .2s;
}
.pal-btn[hidden] { display: none; }
.pal-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
kbd { font: 500 11px var(--font-mono); color: var(--muted); background: var(--surface2); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.palette { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 16px; padding: 0; margin: 12vh auto auto; width: min(620px, calc(100vw - 24px)); max-height: 72vh; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.palette[open] { animation: modalIn .25s var(--ease); }
.palette::backdrop { background: rgba(3, 5, 10, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pal-inner { display: flex; flex-direction: column; max-height: 72vh; }
.pal-search { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 500 16px var(--font-body); }
.pal-search input::placeholder { color: var(--muted); opacity: .8; }
.pal-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; border-left: 2px solid transparent; }
.pal-item[aria-selected="true"] { background: var(--surface2); border-left-color: var(--accent); }
.pal-label { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-kind { font: 500 11px var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.pal-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 15px; }
.pal-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 10px 18px; border-top: 1px solid var(--border); font: 500 12px var(--font-mono); color: var(--muted); }
.pal-foot span:last-child { margin-left: auto; }
.pal-foot kbd { margin-right: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .cred-grid { grid-template-columns: 1fr; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .scroll-cue { display: none; }
  .hero { padding-bottom: 70px; }
}
@media (max-width: 760px) {
  :root { --nav-h: 62px; }
  .container { padding: 0 18px; }
  .icon-btn.nav-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 12px 18px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border); display: none;
  }
  .nav.open { background: var(--bg); border-bottom-color: var(--border); }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 16px; }
  .section { padding: 80px 0; }
  .contact-links { grid-template-columns: 1fr; }
  .timeline { padding-left: 34px; }
  .tl-track { left: 6px; }
  .tl-dot { left: -34px; width: 16px; height: 16px; top: 26px; }
  .tl-date { white-space: normal; flex-wrap: wrap; row-gap: 2px; }
  .tl-dur { white-space: nowrap; }
  .proj-grid, .skill-grid { grid-template-columns: 1fr; }
  .modal-inner { padding: 26px 22px 24px; }
  .m-title { font-size: 24px; }
  .footer-in { flex-direction: column; align-items: flex-start; }
  .term-body { font-size: 12px; padding: 14px; }
  .pal-btn { width: 38px; padding: 0; justify-content: center; }
  .pal-btn kbd, .pal-foot span:not(:last-child) { display: none; }
  .palette { margin-top: 8vh; }
  .career { padding: 16px 14px 12px; }
  .career-seg { padding: 0; font-size: 0; }
}
@media (max-width: 480px) {
  .tl-dur::before { display: none; }
  .impact-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }
  .nav-cv { display: none; }
  .facts li { flex-direction: column; gap: 2px; }
  .wm { -webkit-mask-size: 300px 205px; mask-size: 300px 205px; }
}

/* Touch: give small text links and buttons a 44px hit area without changing how they look. */
@media (pointer: coarse), (max-width: 760px) {
  .proj-open, .footer-top, .brand, #email-link, .reveal-btn { display: inline-flex; align-items: center; min-height: 44px; }
  .brand { min-width: 44px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html.js .reveal { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
  .stack-rail i { display: none; }
}

/* ---------- Print: clean light CV with a stronger watermark ---------- */
@page { size: A4; margin: 10mm; }
@media print {
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    color-scheme: light;
    --bg: #fff; --bg2: #fff; --surface: #fff; --surface2: #f4f6f8;
    --border: #d8dde3; --border-strong: #c3cad2;
    --text: #111; --muted: #444; --accent: #05683f; --accent2: #075a80;
    --wm-opacity: .10; --shadow: none;
  }
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  .nav, .boot, .scroll-progress, #mesh, .hero-fade, .ticker, .toast, .scroll-cue, .skill-search, .filters,
  .nav-actions, .hero-cta, .open-badge, .proj-open, .footer-top, .contact .btn, .stack-rail, .icon-btn, .skip-link, .career, .palette { display: none !important; }
  .hero { min-height: 0; padding: 30px 0; display: block; }
  .hero::before, .hero::after, .contact-card::after { display: none; }
  .hero-in { animation: none !important; opacity: 1 !important; }
  .hero-grid { grid-template-columns: 1fr; }
  .term { display: none; }
  .outline { -webkit-text-stroke: 0; color: var(--accent); }
  .stat-num, .cred-big { -webkit-text-fill-color: var(--accent); background: none; color: var(--accent); }
  .section { padding: 18px 0; break-inside: auto; }
  .sec-head { margin-bottom: 18px; break-inside: avoid; break-after: avoid; }
  .sec-head h2, .sec-head p { break-after: avoid; }
  .impact { padding: 0 0 10px; }
  .impact-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .stat { padding: 14px 12px; }
  .about-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .card, .stat { break-inside: avoid; box-shadow: none; }
  .proj-detail, .proj-detail[hidden] { display: block !important; }
  .proj-detail ul { list-style: disc; padding-left: 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
  .skill-grid, .cred-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  /* Project cards carry their full bullet lists in print, so let them split across columns/pages. */
  .proj-grid { display: block; column-count: 2; column-gap: 16px; }
  .proj-grid .proj { display: block; break-inside: auto; margin-bottom: 14px; }
  .proj-meta, .proj h3 { break-after: avoid; }
  .wm { position: fixed; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}
.proj-detail { display: none; }
