/* ==========================================================================
   Malvin Noel — portfolio
   ========================================================================== */

:root {
  --bg: #0a0b0d;
  --bg-raised: #111318;
  --bg-card: #0f1115;
  --line: rgba(var(--fg-rgb), 0.08);
  --line-strong: rgba(var(--fg-rgb), 0.16);
  --text: #edebe6;
  --muted: #a3a29d;
  --dim: #8d8c87;
  --accent: #ff8f45;
  --accent-ink: #1a0d04;
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --live: #5ee08f;
  --fg-rgb: 255, 255, 255;
  --bg-rgb: 10, 11, 13;
  --accent-rgb: 255, 143, 69;
  color-scheme: dark;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  --bg: #f6f5f1;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --line: rgba(24, 24, 20, 0.10);
  --line-strong: rgba(24, 24, 20, 0.22);
  --text: #17171a;
  --muted: #4a4944;
  --dim: #66655f;
  --accent: #b93f0b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(185, 63, 11, 0.10);
  --live: #15803d;
  --fg-rgb: 24, 24, 20;
  --bg-rgb: 246, 245, 241;
  --accent-rgb: 185, 63, 11;
  color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --line: rgba(24, 24, 20, 0.10);
  --line-strong: rgba(24, 24, 20, 0.22);
  --text: #17171a;
  --muted: #4a4944;
  --dim: #66655f;
  --accent: #b93f0b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(185, 63, 11, 0.10);
  --live: #15803d;
  --fg-rgb: 24, 24, 20;
  --bg-rgb: 246, 245, 241;
  --accent-rgb: 185, 63, 11;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 12px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 12px; }

/* Ambient background ---------------------------------------------------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.45;
}
.bg-glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 900px; height: 600px; left: 50%; top: -260px; transform: translateX(-30%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.16), transparent 70%);
  filter: blur(20px);
}

/* Type helpers ---------------------------------------------------------- */
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.serif { font-family: var(--font-serif); font-weight: 400; }
em, .italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .idx { color: var(--accent); }

.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none;
  box-shadow: 0 0 0 0 rgba(94, 224, 143, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 224, 143, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(94, 224, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 224, 143, 0); }
}

/* Nav ------------------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(var(--bg-rgb), 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  font-family: var(--font-serif); font-style: italic; font-size: 20px; line-height: 1;
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(var(--fg-rgb), 0.05); }

.nav-meta { display: flex; align-items: center; gap: 14px; }
.clock { color: var(--dim); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.lang {
  font-family: var(--font-mono); font-size: 12px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); color: var(--muted); transition: all 0.2s;
}
.lang:hover { color: var(--text); border-color: var(--text); }

.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); place-items: center; }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: var(--text); position: relative; transition: transform 0.3s var(--ease); }
.menu-btn span::before, .menu-btn span::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 1.5px; background: var(--text);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.menu-btn span::before { top: -5px; }
.menu-btn span::after { top: 5px; }
.nav.open .menu-btn span { background: transparent; }
.nav.open .menu-btn span::before { top: 0; transform: rotate(45deg); }
.nav.open .menu-btn span::after { top: 0; transform: rotate(-45deg); }

.mobile-panel { display: none; }

@media (max-width: 860px) {
  .nav-links, .clock { display: none; }
  .menu-btn { display: grid; }
  .mobile-panel {
    display: block; overflow: hidden; max-height: 0;
    transition: max-height 0.4s var(--ease);
    background: rgba(var(--bg-rgb), 0.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .nav.open { background: rgba(var(--bg-rgb), 0.96); border-bottom-color: var(--line); }
  .nav.open .mobile-panel { max-height: 420px; }
  .mobile-panel ul { padding: 8px var(--gutter) 24px; }
  .mobile-panel a {
    display: flex; justify-content: space-between; padding: 14px 0;
    border-bottom: 1px solid var(--line); font-size: 18px;
  }
  .mobile-panel a span { color: var(--dim); font-family: var(--font-mono); font-size: 12px; }
}

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 999px; font-size: 15px; font-weight: 500;
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn-solid { background: var(--text); color: var(--bg); }
.btn-solid:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }

/* Hero ------------------------------------------------------------------ */
.hero { position: relative; padding: 140px 0 48px; overflow: hidden; }
html, body { overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 56px; align-items: end; }

.hero h1 {
  font-size: clamp(42px, 6.6vw, 86px);
  line-height: 0.98; letter-spacing: -0.035em; font-weight: 500;
  margin: 22px 0 28px;
}
.hero h1 em { color: var(--accent); letter-spacing: -0.01em; }
.hero-lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 560px; }
.hero-lede strong { color: var(--text); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.id-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card);
  padding: 14px; position: relative;
}
.id-card picture img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.id-card-meta { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 2px; gap: 12px; }
.id-card-meta b { font-weight: 500; font-size: 15px; }
.id-card-meta small { display: block; color: var(--dim); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.now-chip {
  position: absolute; left: -24px; bottom: 76px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(var(--bg-rgb), 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 16px 9px 12px; font-size: 13px; white-space: nowrap;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
}
.now-chip .label { color: var(--dim); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }
.now-chip .rot { display: inline-block; min-width: 92px; transition: opacity 0.3s, transform 0.3s var(--ease); }
.now-chip .rot.out { opacity: 0; transform: translateY(6px); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 88px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 24px 24px 24px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.stat b sup { font-size: 0.45em; vertical-align: super; color: var(--accent); }
.stat span { display: block; color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 220px; }

@media (max-width: 900px) {
  .hero { padding-top: 120px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .id-card { max-width: 240px; }
  .now-chip { left: auto; right: -8px; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 56px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .stat b { font-size: 36px; }
  .stat { padding-right: 12px; }
  .stat + .stat { padding-left: 14px; }
  .stat:nth-child(3) { padding-left: 0; }
  .now-chip { right: 8px; bottom: 70px; }
}

/* Sections -------------------------------------------------------------- */
.section { padding: 96px 0; position: relative; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(36px, 5vw, 64px); line-height: 1; letter-spacing: -0.03em; font-weight: 500; margin-top: 16px;
}
.section-head p { color: var(--muted); max-width: 460px; justify-self: end; }
@media (max-width: 800px) {
  .section { padding: 72px 0; }
  .section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
  .section-head p { justify-self: start; }
}

/* Building -------------------------------------------------------------- */
.build-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.build { grid-column: span 2; }
.build.feature { grid-column: span 6; }
.build.wide { grid-column: span 3; }

@media (max-width: 1020px) {
  .build-grid { grid-template-columns: repeat(2, 1fr); }
  .build, .build.wide { grid-column: span 1; }
  .build.feature { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 680px) {
  .build-grid { grid-template-columns: 1fr; }
  .build, .build.wide, .build.feature { grid-column: span 1; }
}

.card {
  position: relative; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.09), transparent 60%);
}
.card:hover { border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }

.build { display: flex; flex-direction: column; padding: 26px; min-height: 100%; }
.build-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 28px; }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text);
}
.status .dot { width: 6px; height: 6px; }
.status.s-waitlist .dot { background: #f5c451; animation: none; }
.status.s-explore .dot { background: #8ab4ff; animation: none; }

.kind { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); text-align: right; }

.build h3 { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.build.feature h3 { font-size: clamp(30px, 3.4vw, 44px); }
.build .pitch { color: var(--muted); margin-top: 12px; font-size: 15px; }
.build.feature .pitch { font-size: 18px; max-width: 560px; }

.hood { margin-top: 22px; display: grid; gap: 10px; }
.hood li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 14px; color: var(--muted); }
.hood li::before { content: "→"; color: var(--accent); font-family: var(--font-mono); font-size: 13px; }
.build.feature .hood { grid-template-columns: 1fr 1fr; column-gap: 28px; }
@media (max-width: 680px) { .build.feature .hood { grid-template-columns: 1fr; } }

.build-foot { margin-top: auto; padding-top: 26px; }

.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 18px; }
.stages i { height: 3px; border-radius: 3px; background: rgba(var(--fg-rgb), 0.1); position: relative; overflow: hidden; }
.stages i.done { background: var(--accent); }
.stages i.now { background: rgba(var(--accent-rgb), 0.25); }
.stages i.now::after {
  content: ""; position: absolute; inset: 0; width: 50%; background: var(--accent); border-radius: 3px;
}
@keyframes progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(240%); } }
.stage-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: -12px 0 18px; }
.stage-labels span { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); }
.stage-labels span.on { color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(var(--fg-rgb), 0.04); border: 1px solid var(--line); color: var(--muted);
}

/* Surf ID visual: a mini pipeline diagram */
.pipeline { margin-top: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pipe-step {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px; background: rgba(var(--fg-rgb), 0.02);
  position: relative;
}
.pipe-step + .pipe-step::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 8px; height: 1px; background: var(--line-strong);
}
.pipe-step b { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.05em; }
.pipe-step span { display: block; font-size: 13px; margin-top: 6px; line-height: 1.35; }
@media (max-width: 560px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipe-step:nth-child(3)::before { display: none; }
}

.build-note { margin-top: 20px; font-size: 14px; color: var(--dim); }
.build-note a { color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.build-note a:hover { color: var(--text); }

/* Experience ------------------------------------------------------------ */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 860px) { .exp-grid { grid-template-columns: 1fr; gap: 40px; } }

.exp-col h3 { margin-bottom: 8px; }
.timeline li {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .when { font-family: var(--font-mono); font-size: 12px; color: var(--dim); padding-top: 4px; }
.timeline h4 { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.timeline .role { color: var(--accent); font-size: 14px; margin-top: 2px; }
.timeline p { color: var(--muted); font-size: 15px; margin-top: 10px; }
.timeline p a { color: var(--text); border-bottom: 1px solid var(--accent); }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 6px; } }

/* Selected work --------------------------------------------------------- */
.work-list { border-top: 1px solid var(--line); }
.work {
  display: grid; grid-template-columns: 64px 1.1fr 1.4fr auto; gap: 28px; align-items: start;
  padding: 32px 0; border-bottom: 1px solid var(--line); position: relative;
  transition: padding 0.4s var(--ease);
}
.work::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0; background: var(--accent);
  transition: width 0.6s var(--ease);
}
.work:hover::after { width: 100%; }
.work-n { font-family: var(--font-mono); font-size: 12px; color: var(--dim); padding-top: 8px; }
.work h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.work .ctx { color: var(--dim); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; }
.work p { color: var(--muted); font-size: 15px; }
.work .tags { margin-top: 14px; }
.work-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.link-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); transition: all 0.25s; white-space: nowrap;
}
.link-pill svg { width: 14px; height: 14px; }
.link-pill:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
@media (max-width: 860px) {
  .work { grid-template-columns: 40px 1fr; gap: 12px 16px; }
  .work > p, .work > .work-desc, .work-links { grid-column: 2; }
  .work-links { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

/* Stack ----------------------------------------------------------------- */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack { padding: 26px; }
.stack h3 { font-family: var(--font-mono); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 18px; }
.stack li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.stack li small { color: var(--dim); font-size: 12px; text-align: right; }
@media (max-width: 1020px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stack-grid { grid-template-columns: 1fr; } }

/* Contact --------------------------------------------------------------- */
.contact { padding: 112px 0 104px; text-align: center; position: relative; overflow: hidden; }
.contact .bg-glow { top: auto; bottom: -320px; transform: translateX(-50%); }
.contact h2 {
  font-size: clamp(48px, 10vw, 140px); line-height: 0.95; letter-spacing: -0.045em; font-weight: 500; margin: 22px 0 28px;
}
.contact h2 em { color: var(--accent); }
.contact p { color: var(--muted); max-width: 520px; margin: 0 auto; font-size: 18px; }
.contact .hero-cta { justify-content: center; }

/* Footer ---------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--dim); font-size: 13px; }
.footer a:hover { color: var(--text); }

/* Back to top ----------------------------------------------------------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.3s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--text); color: var(--bg); }
.to-top svg { width: 16px; height: 16px; }

/* Reveal ---------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Theme toggle --------------------------------------------------------- */
.theme-btn {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--muted); transition: color 0.2s, border-color 0.2s;
}
.theme-btn:hover { color: var(--text); border-color: var(--text); }
.theme-btn svg { width: 15px; height: 15px; }

/* Light theme tweaks */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .bg-grid { opacity: 0.6; }
  :root:not([data-theme="dark"]) .card:hover { box-shadow: 0 10px 30px -12px rgba(24, 24, 20, 0.18); }
}
:root[data-theme="light"] .bg-grid { opacity: 0.6; }
:root[data-theme="light"] .card:hover { box-shadow: 0 10px 30px -12px rgba(24, 24, 20, 0.18); }

/* Motion, Apple style ---------------------------------------------------- */
/* Elements rise out of a soft blur as they enter the screen */
.js .reveal {
  opacity: 0; transform: translate3d(0, 36px, 0) scale(0.985); filter: blur(10px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* Hero headline, word by word */
.hero h1.split .w {
  display: inline-block; opacity: 0; transform: translate3d(0, 0.45em, 0); filter: blur(12px);
  transition: opacity 0.9s var(--ease), transform 1.1s var(--ease), filter 0.9s var(--ease);
  transition-delay: calc(var(--i) * 80ms + 100ms);
}
.hero h1.split.in .w { opacity: 1; transform: none; filter: none; }

/* Scroll-linked elements */
.hero .id-card, .hero-grid > div:first-child { will-change: transform, opacity; }
[data-scrub] { transform-origin: 50% 70%; will-change: transform, opacity; }

/* Progress bars fill in once the card appears */
.js .build .stages i.done,
.js .build .stages i.now::after { transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease); }
.js .build.in .stages i.done,
.js .build.in .stages i.now::after { transform: none; }
.js .build .stages i:nth-child(1) { transition-delay: 0.35s; }
.js .build .stages i:nth-child(2),
.js .build .stages i:nth-child(2)::after { transition-delay: 0.65s; }
.js .build .stages i:nth-child(3)::after { transition-delay: 0.95s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .hero h1 .w { opacity: 1; transform: none; filter: none; }
  .js .build .stages i.done, .js .build .stages i.now::after { transform: none; }
}
