:root {
  --bg-0: #07070f;
  --bg-1: #0c0c17;
  --ink: #f4f3ff;
  --ink-dim: rgba(232, 230, 255, 0.74);
  --ink-faint: rgba(232, 230, 255, 0.52);
  --violet: #6f5cff;
  --teal: #1fb6a6;
  --pink: #ff6b8a;
  --gold: #f3b25a;
  --coral: #ff8b5e;
  --accent: #f6b961;
  --accent-ink: #ffd9a0;
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-brd: rgba(255, 255, 255, 0.16);
  --glass-hi: rgba(255, 255, 255, 0.34);
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.42);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-draw: cubic-bezier(0.22, 0.65, 0.3, 1);
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(130% 120% at 18% 4%, #1c1538 0%, var(--bg-1) 54%, var(--bg-0) 100%) fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.defs { position: absolute; pointer-events: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  color: var(--ink);
}
.skip-link:focus { left: 12px; }

/* ---------- Glass surface ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}
.blob-1 { width: 42vw; height: 42vw; min-width: 320px; min-height: 320px; background: var(--violet); top: -8vw; left: -6vw; animation: drift-a 22s var(--ease) infinite alternate; }
.blob-2 { width: 38vw; height: 38vw; min-width: 300px; min-height: 300px; background: var(--teal); bottom: -10vw; right: -6vw; animation: drift-b 26s var(--ease) infinite alternate; }
.blob-3 { width: 32vw; height: 32vw; min-width: 260px; min-height: 260px; background: var(--gold); top: 18vh; right: 12vw; opacity: 0.34; animation: drift-c 30s var(--ease) infinite alternate; }
.blob-4 { width: 26vw; height: 26vw; min-width: 220px; min-height: 220px; background: var(--coral); bottom: 6vh; left: 8vw; opacity: 0.22; animation: drift-a 34s var(--ease) infinite alternate; }
.grain { position: absolute; inset: -50%; opacity: 0.04; background-image: radial-gradient(rgba(255,255,255,0.6) 0.5px, transparent 0.5px); background-size: 3px 3px; }

@keyframes drift-a { to { transform: translate3d(6vw, 4vh, 0) scale(1.1); } }
@keyframes drift-b { to { transform: translate3d(-5vw, -3vh, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(-4vw, 5vh, 0) scale(0.92); } }

/* Cursor specular highlight */
.spec {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(280px 280px at var(--mx, 50%) var(--my, 24%), rgba(255, 255, 255, 0.12), transparent 64%);
  mix-blend-mode: screen;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin: 14px var(--pad) 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-radius: var(--r-lg);
  will-change: transform;
}
.nav-links { margin-left: auto; display: flex; gap: clamp(16px, 3vw, 26px); }
.nav-links a { color: var(--ink-dim); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent-ink); }
kbd {
  font: inherit; font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-brd);
  color: var(--ink-dim);
}

/* ---------- Hero banner: photo + name + contribution graph ---------- */
.hero { padding: clamp(14px, 3vh, 26px) var(--pad) 0; }
.hero-frame {
  position: relative; isolation: isolate;
  border-radius: var(--r-lg); overflow: hidden;
  min-height: clamp(420px, 66vh, 660px);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow);
}
.hero-photo {
  position: absolute; inset: 0;
  background-image: url("assets/header.jpg");
  background-size: cover; background-position: 50% 50%;
  transform: scale(1.02);
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,7,15,0) 42%, rgba(7,7,15,0.80) 100%),
    linear-gradient(90deg, rgba(7,7,15,0.5) 0%, rgba(7,7,15,0) 48%);
}
.hero-name {
  position: absolute; z-index: 2;
  left: clamp(20px, 4vw, 52px); right: clamp(20px, 4vw, 52px);
  bottom: clamp(22px, 4vh, 46px); max-width: 640px;
}
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent-ink); }
.wordmark { margin: 0 0 12px; font-size: clamp(38px, 7vw, 76px); line-height: 0.96; font-weight: 700; letter-spacing: -2px; color: #fff; text-shadow: 0 2px 34px rgba(0,0,0,0.45); }
.hero-sub { margin: 0; font-size: clamp(15px, 1.9vw, 18px); line-height: 1.55; color: rgba(255,255,255,0.88); max-width: 48ch; }
.ripple-text { display: inline-block; filter: url(#ripple); }

/* Contribution graph composited onto the sky (top-right) */
.hero-contrib {
  position: absolute; z-index: 2; margin: 0;
  top: clamp(14px, 3vh, 24px); right: clamp(14px, 3vw, 24px);
  padding: 12px 14px 11px; border-radius: var(--r-md);
  background: rgba(10, 10, 20, 0.34);
}
.hero-contrib .contrib-head { font-size: 11.5px; margin: 0 0 8px; color: rgba(255,255,255,0.9); }
.hero-contrib .contrib-total { color: #fff; font-weight: 700; }
.hero-contrib .contrib-cal { overflow: hidden; padding: 0; }
.hero-contrib .contrib-months { display: none; }
.hero-contrib .contrib-grid { gap: 2px; }
.hero-contrib .contrib-week { gap: 2px; }
.hero-contrib .contrib-day { width: 6.5px; height: 6.5px; border-radius: 1.5px; }
@media (max-width: 760px) {
  .hero-name { position: static; padding: 18px clamp(18px,5vw,26px) 0; }
  .hero-frame { display: flex; flex-direction: column; }
  .hero-photo { position: relative; height: 300px; inset: auto; }
  .hero-scrim { display: none; }
  .wordmark { color: var(--ink); text-shadow: none; }
  .hero-sub { color: var(--ink-dim); }
  .hero-contrib { position: static; align-self: stretch; margin: 14px clamp(18px,5vw,26px) 18px; background: rgba(255,255,255,0.05); }
  .hero-contrib .contrib-cal { overflow-x: auto; }
}

/* ---------- Ask section ---------- */
.ask { max-width: 720px; margin: 0 auto; padding: clamp(40px, 8vh, 84px) var(--pad) 0; text-align: center; }
.ask-title { margin: 0 0 8px; font-size: clamp(22px, 3.4vw, 32px); font-weight: 600; letter-spacing: -0.6px; }
.ask-title::after { content: ""; display: block; width: 54px; height: 3px; margin: 14px auto 24px; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--gold)); }
.ask .palette { margin: 0 auto; }

/* ---------- Command palette ---------- */
.palette {
  width: min(640px, 100%);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: left;
  will-change: transform;
}
.palette-input {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
}
.palette-input .ic-spark { width: 20px; height: 20px; flex: none; color: var(--gold); opacity: 0.95; }
#cmd {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--ink); font: inherit; font-size: 17px;
  caret-color: var(--violet);
}
.type-ghost {
  position: absolute; left: 50px; right: 60px;
  font-size: 17px; color: var(--ink-faint);
  pointer-events: none; white-space: nowrap; overflow: hidden;
}
.enter-hint { flex: none; opacity: 0.6; }
.results { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.results:empty { display: none; }
.results::-webkit-scrollbar { width: 8px; }
.results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }

.result {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--r-md);
  cursor: pointer; border-top: 1px solid transparent;
  transition: background 0.14s;
}
.result[aria-selected="true"], .result:hover {
  background: rgba(255, 255, 255, 0.1);
}
.result .r-ic {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-brd);
}
.result .r-ic .ic { width: 17px; height: 17px; opacity: 0.85; }
.r-body { min-width: 0; }
.r-title { font-size: 15px; font-weight: 500; }
.r-sub { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { margin-left: auto; flex: none; font-size: 11px; color: var(--ink-faint); }
.results .empty { padding: 18px 16px; color: var(--ink-faint); font-size: 14px; }

/* "Ask the AI" row + streaming answer */
.result.ask .r-ic { background: rgba(111, 92, 255, 0.22); border-color: rgba(143, 128, 255, 0.5); }
.result.ask .r-sub { color: rgba(180, 172, 255, 0.9); }
.answer {
  margin: 6px; padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  background: rgba(111, 92, 255, 0.08);
  font-size: 15px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.answer-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(180, 172, 255, 0.95);
}
.answer-head .ic { width: 15px; height: 15px; }
.answer-head .close { margin-left: auto; cursor: pointer; opacity: 0.6; background: none; border: none; color: inherit; font: inherit; padding: 0; }
.answer-head .close:hover { opacity: 1; }
.answer-body { color: var(--ink-dim); }
.answer a { color: #b7afff; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.answer a:hover { color: #d8d3ff; }
.answer-body.streaming::after { content: "\2588"; margin-left: 1px; color: var(--violet); animation: blink 1s step-end infinite; }
.answer .err { color: var(--pink); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(180, 172, 255, 0.85); animation: pulse 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.hero-hint { margin: 22px auto 0; max-width: 60ch; will-change: transform; }
.hero-hint p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-dim); }
.hero-hint em { font-style: normal; color: var(--ink); border-bottom: 1px dashed rgba(143, 128, 255, 0.5); }
.hero-hint strong { color: #d9d3ff; font-weight: 600; }
.hero-challenge { margin-top: 10px !important; font-size: 13.5px !important; color: var(--ink-faint) !important; }
.hero-challenge span { color: #ffd9e3; border-bottom: 1px dashed rgba(255, 107, 138, 0.55); }
.hero-keys { margin-top: 12px !important; font-size: 12px !important; color: var(--ink-faint) !important; letter-spacing: 0.2px; }
.hero-hint kbd { margin: 0 1px; }

/* ---------- Panels ---------- */
.panel {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 90px) var(--pad);
}
.panel h2 { margin: 0 0 22px; font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.5px; }

/* ---------- GitHub contribution calendar ---------- */
.contrib { margin-top: clamp(28px, 5vh, 48px); }
.contrib-head { font-size: 14px; color: var(--ink-dim); margin: 0 0 14px; }
.contrib-total { font-weight: 600; color: var(--ink); }
.contrib-cal { overflow-x: auto; padding-bottom: 6px; }
.contrib-months { position: relative; height: 16px; min-width: 742px; font-size: 11px; color: var(--ink-faint); }
.contrib-months .cm { position: absolute; top: 0; }
.contrib-grid { display: flex; gap: 3px; width: max-content; }
.contrib-week { display: flex; flex-direction: column; gap: 3px; }
.contrib-day { width: 11px; height: 11px; border-radius: 2.5px; background: rgba(255, 255, 255, 0.06); }
.contrib-day.pad { background: transparent; }
.contrib-day.l1 { background: #0e4429; } .contrib-day.l2 { background: #006d32; } .contrib-day.l3 { background: #26a641; } .contrib-day.l4 { background: #39d353; }
.contrib-grid .contrib-day:not(.pad) { opacity: 0; transform: scale(0.45); }
.contrib-grid.lit .contrib-day:not(.pad) { animation: contrib-in 0.55s var(--ease) forwards; animation-delay: calc(var(--w) * 18ms); }
@keyframes contrib-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .contrib-grid .contrib-day { opacity: 1; transform: none; animation: none; } }
.panel p { margin: 0; font-size: clamp(16px, 2vw, 19px); line-height: 1.7; color: var(--ink-dim); max-width: 60ch; }

/* Warm accent bar under section headings (brings the page to life) */
.panel > h2::after, .resume > h2::after, .story > h2::after {
  content: ""; display: block; width: 46px; height: 3px; margin-top: 14px;
  border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--coral));
}

/* ---------- Résumé ---------- */
.resume { max-width: 1040px; margin: 0 auto; padding: clamp(40px, 8vh, 90px) var(--pad); }
.resume > h2 { margin: 0 0 12px; font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.5px; }
.resume-lede { margin: 0 0 30px; font-size: clamp(16px, 2vw, 19px); line-height: 1.6; color: var(--ink-dim); max-width: 62ch; }
.resume-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 14px; margin-bottom: clamp(28px, 5vh, 44px); }
.hl { padding: 20px 18px; border-radius: var(--r-md); text-align: center; }
.hl-num { display: block; font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -1px; background: linear-gradient(90deg, var(--gold), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hl-label { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.4; }
.resume-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.resume-h { margin: 0 0 18px; font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent-ink); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 22px; border-left: 1px solid var(--glass-brd); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(243, 178, 90, 0.18); }
.tl-when { font-size: 12px; letter-spacing: 0.5px; color: var(--ink-faint); }
.timeline h4 { margin: 3px 0 6px; font-size: 16px; font-weight: 600; }
.tl-where { color: var(--ink-faint); font-weight: 400; }
.timeline p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-dim); }
.timeline a, .skills-note a { color: var(--accent-ink); text-underline-offset: 2px; }
.resume-certs { margin: 18px 0 0; font-size: 13.5px; color: var(--ink-dim); }
.resume-certs strong { color: var(--ink); }
.skills-note { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-faint); }
.skills { display: grid; gap: 11px; }
.skill-group { padding: 14px 16px; border-radius: var(--r-md); background: var(--glass-bg); border: 1px solid var(--glass-brd); transition: transform 0.3s var(--ease-out), border-color 0.3s; }
.skill-group:hover { transform: translateY(-2px); border-color: rgba(243, 178, 90, 0.4); }
.skill-group h4 { margin: 0 0 5px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.skill-group p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); }
.skill-group strong { color: var(--accent-ink); font-weight: 600; }
@media (max-width: 820px) { .resume-grid { grid-template-columns: 1fr; gap: 32px; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  border-radius: var(--r-lg); padding: 22px 22px 20px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
  will-change: transform;
}
.card:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.tag {
  display: inline-block; margin-bottom: 12px;
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(180, 172, 255, 0.95);
}
.card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.card p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink-dim); }
.card-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.card-link .ic-arrow { width: 15px; height: 15px; transition: transform 0.2s; }
.card-link:hover .ic-arrow { transform: translateX(4px); }

.links { display: flex; flex-wrap: wrap; gap: 12px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; font-size: 15px;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.link-chip:hover { transform: translateY(-2px); border-color: var(--glass-hi); }
.link-chip .ic { width: 15px; height: 15px; }
.ic-dot { background: var(--teal); -webkit-mask: none; mask: none; border-radius: 50%; }
.email-chip { font-family: inherit; }
.email-chip:hover { border-color: rgba(243, 178, 90, 0.5); color: var(--accent-ink); }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding: 40px var(--pad); margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px; color: var(--ink-faint);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity 0.7s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Visual story (scrollytelling) ---------- */
.story { max-width: 1000px; margin: 0 auto; padding: clamp(40px, 9vh, 100px) var(--pad); }
.story > h2 { margin: 0 0 16px; font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.5px; }
.story-intro, .story-outro { max-width: 64ch; font-size: clamp(15px, 2vw, 18px); line-height: 1.7; color: var(--ink-dim); }
.story-intro { margin: 0 0 clamp(36px, 6vh, 60px); }
.story-outro { margin: clamp(32px, 5vh, 52px) 0 0; color: var(--ink); }
.story-track { display: flex; flex-direction: column; gap: clamp(30px, 6vh, 64px); }
.story-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 44px); align-items: center;
  opacity: 0; transform: translate3d(0, 42px, 0) scale(0.975);
  transition: opacity 0.7s var(--ease-out), transform 0.85s var(--ease-out);
  will-change: opacity, transform;
}
.story-panel.in { opacity: 1; transform: none; will-change: auto; }
/* Inner layered settle — text resolves just after the panel for a liquid feel */
.story-text { transition: transform 0.85s var(--ease-out); }
.story-panel:not(.in) .story-text { transform: translate3d(0, 24px, 0); }
.story-panel.in .story-text { transform: none; transition-delay: 0.12s; }
.story-panel:nth-child(even) .story-visual { order: 2; }
.story-visual {
  border-radius: var(--r-lg); padding: 14px;
  background: var(--glass-bg); border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.story-visual svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.story-year { display: inline-block; font-size: 12px; letter-spacing: 3px; color: rgba(180, 172, 255, 0.95); }
.story-text h3 { margin: 6px 0 4px; font-size: clamp(18px, 2.4vw, 24px); font-weight: 600; letter-spacing: -0.4px; }
.story-tag { display: block; margin-bottom: 12px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-faint); }
.story-text p { margin: 0 0 16px; font-size: clamp(14px, 1.8vw, 16px); line-height: 1.6; color: var(--ink-dim); }
.story-panel[data-link] { cursor: pointer; }
.story-panel[data-link] .story-visual { transition: transform 0.3s var(--ease); }
.story-panel[data-link]:hover .story-visual { transform: translateY(-4px); }
.story-panel[data-link]:focus-visible { outline: 2px solid var(--violet); outline-offset: 8px; border-radius: var(--r-lg); }
.story-stealth .story-year { background: linear-gradient(90deg, rgba(111, 92, 255, 0.28), rgba(255, 107, 138, 0.24)); border: 1px solid rgba(143, 128, 255, 0.5); color: #ece8ff; padding: 3px 11px; border-radius: 999px; text-transform: uppercase; font-size: 11px; }
.story-stealth-note { display: inline-block; font-size: 13px; color: rgba(180, 172, 255, 0.85); border: 1px dashed rgba(143, 128, 255, 0.4); padding: 6px 13px; border-radius: var(--r-md); }
@media (max-width: 720px) {
  .story-panel { grid-template-columns: 1fr; }
  .story-panel:nth-child(even) .story-visual { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .story-panel { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ---------- Pencil "short film" player ---------- */
.film { position: relative; margin: clamp(40px, 7vh, 76px) auto 0; max-width: 760px; padding: 14px; border-radius: var(--r-lg); }
.film-screen { position: relative; aspect-ratio: 680 / 430; border-radius: var(--r-md); overflow: hidden; background: radial-gradient(130% 130% at 25% 12%, rgba(111, 92, 255, 0.12), rgba(8, 8, 15, 0) 62%); }
.film-scene { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transform: scale(1.012); transition: opacity 0.6s var(--ease-out), transform 0.9s var(--ease-out); pointer-events: none; }
.film-scene.on { opacity: 1; transform: none; }
.film-art { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px 18px 0; }
.film-art svg { width: 100%; height: 100%; max-height: 100%; stroke: #ece9ff; }
.film .ink { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.film-scene.drawing .ink { animation: film-draw 1.05s var(--ease-draw) forwards; }
@keyframes film-draw { to { stroke-dashoffset: 0; } }
.film-cap { font-family: "Caveat", cursive; font-size: clamp(20px, 3.3vw, 30px); font-weight: 600; line-height: 1.25; text-align: center; color: #efecff; padding: 4px 22px 22px; opacity: 0; transform: translate3d(0, 10px, 0); transition: opacity 0.55s var(--ease-out) 0.4s, transform 0.7s var(--ease-out) 0.4s; }
.film-scene.on .film-cap { opacity: 1; transform: none; }
.film-scene.drawing.paused .ink, .film.paused .film-scene.drawing .ink { animation-play-state: paused; }
/* Centre poster play button (overlays the screen) */
.film-stage { position: relative; }
.film-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-size: 15px; color: var(--ink); cursor: pointer;
  background: rgba(20, 18, 40, 0.55); border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.2s, opacity 0.4s;
}
.film-play svg { color: var(--violet); }
.film-play:hover { background: rgba(40, 36, 72, 0.72); transform: translate(-50%, -50%) scale(1.04); }
.film.playing .film-play, .film.started .film-play { opacity: 0; pointer-events: none; }
/* YouTube-style control bar */
.film-controls { display: flex; align-items: center; gap: 12px; padding: 12px 6px 2px; }
.film-toggle { flex: none; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--ink); background: rgba(20, 18, 40, 0.6); border: 1px solid var(--glass-brd); transition: background 0.18s, transform 0.18s; }
.film-toggle:hover { background: rgba(40, 36, 72, 0.72); transform: scale(1.06); }
.film-toggle svg { color: var(--violet); }
.film-seek { flex: 1; padding: 10px 0; cursor: pointer; touch-action: none; }
.film-seek:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; border-radius: 8px; }
.film-seek-track { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.13); }
.film-seek-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--teal)); }
.film-ticks { position: absolute; inset: 0; pointer-events: none; }
.film-ticks i { position: absolute; top: 50%; width: 2px; height: 10px; transform: translate(-50%, -50%); background: rgba(8, 6, 16, 0.8); border-radius: 1px; }
.film-seek-knob { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; box-shadow: 0 1px 7px rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.18s; }
.film.started .film-seek-knob, .film-seek:hover .film-seek-knob, .film-seek:focus-visible .film-seek-knob { opacity: 1; }
.film-time { flex: none; font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.film-hint { margin: 10px 2px 2px; font-size: 12.5px; color: var(--ink-faint); text-align: center; }
.film-hint a { color: rgba(180, 172, 255, 0.95); }
.film.static .film-screen { aspect-ratio: auto; }
.film.static .film-scene { position: relative; inset: auto; opacity: 1; margin-bottom: 18px; }
.film.static .film-controls, .film.static .film-play { display: none; }
@media (prefers-reduced-motion: reduce) { .film .ink { stroke-dashoffset: 0; } .film-cap { opacity: 1; transform: none; transition: none; } }

/* ---------- Icons (CSS masks, zero deps) ---------- */
.ic {
  display: inline-block;
  background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
}
.ic-arrow { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.ic-mail { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); }
.ic-folder { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.ic-user { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); }
.ic-link { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 15l6-6'/%3E%3Cpath d='M11 6l1-1a4 4 0 0 1 6 6l-1 1'/%3E%3Cpath d='M13 18l-1 1a4 4 0 0 1-6-6l1-1'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 15l6-6'/%3E%3Cpath d='M11 6l1-1a4 4 0 0 1 6 6l-1 1'/%3E%3Cpath d='M13 18l-1 1a4 4 0 0 1-6-6l1-1'/%3E%3C/svg%3E"); }
.ic-spark { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z'/%3E%3C/svg%3E"); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .type-ghost { right: 50px; }
  .foot { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .spec { animation: none !important; }
  .ripple-text { filter: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}
