/* ==========================================================================
   Ajmal Noushad · portfolio
   Layout: a centred, portrait-first hero (kept from the original site), then a
   72rem column where each section opens with a mono path label (~/work) above
   a rounded display heading. Monochrome ink on paper with one leaf-green
   accent.
   ========================================================================== */

:root {
  --paper: #f8f8f5;
  --surface: #ffffff;
  --sunken: #f0f1ec;
  --ink: #171816;
  --ink-2: #4a4d48;
  --ink-3: #6f736c;
  --rule: #e2e4de;
  --rule-strong: #171816;
  --leaf: #2b7444;
  --leaf-wash: rgba(43, 116, 68, 0.1);
  --leaf-2: #1c9a66;
  --sun: #cf8418;
  --aurora-a: rgba(64, 176, 110, 0.26);
  --aurora-b: rgba(236, 170, 70, 0.26);
  --aurora-c: rgba(90, 170, 220, 0.2);
  --term-glow: rgba(43, 116, 68, 0.28);
  --rec: #d6453d;
  --dot: rgba(23, 24, 22, 0.16);
  --dot-hot: #171816;
  --glow: rgba(23, 24, 22, 0.05);
  --nav-bg: rgba(248, 248, 245, 0.78);
  --backdrop: rgba(23, 24, 22, 0.28);
  --shadow: 0 1px 2px rgba(23, 24, 22, 0.04), 0 12px 32px -16px rgba(23, 24, 22, 0.22);
  --shadow-lg: 0 30px 80px -24px rgba(23, 24, 22, 0.35), 0 2px 6px rgba(23, 24, 22, 0.06);

  --term-bg: #161715;
  --term-raise: #1e201d;
  --term-ink: #e8e9e3;
  --term-dim: #92968e;
  --term-rule: #2d302b;
  --term-accent: #86d19f;
  --term-warm: #e2b878;

  --font-display: "Baloo Bhaijaan 2", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--2: 0.75rem;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: clamp(2rem, 1.55rem + 1.9vw, 2.875rem);
  --step-4: clamp(2.6rem, 1.7rem + 4vw, 4.6rem);

  --r-sm: 5px;
  --r-md: 14px;
  --wrap: 72rem;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f100f;
    --surface: #161816;
    --sunken: #1b1d1a;
    --ink: #ecede8;
    --ink-2: #b4b7af;
    --ink-3: #8a8e86;
    --rule: #2a2d29;
    --rule-strong: #ecede8;
    --leaf: #7cc796;
    --leaf-wash: rgba(124, 199, 150, 0.12);
  --leaf-2: #a9efc2;
  --sun: #f2c069;
  --aurora-a: rgba(86, 196, 130, 0.2);
  --aurora-b: rgba(232, 170, 80, 0.14);
  --aurora-c: rgba(80, 150, 220, 0.14);
  --term-glow: rgba(124, 199, 150, 0.16);
    --leaf-2: #a9efc2;
    --sun: #f2c069;
    --aurora-a: rgba(86, 196, 130, 0.2);
    --aurora-b: rgba(232, 170, 80, 0.14);
    --aurora-c: rgba(80, 150, 220, 0.14);
    --term-glow: rgba(124, 199, 150, 0.16);
    --rec: #ff6f62;
    --dot: rgba(236, 237, 232, 0.14);
    --dot-hot: #ecede8;
    --glow: rgba(236, 237, 232, 0.05);
    --nav-bg: rgba(15, 16, 15, 0.72);
    --backdrop: rgba(0, 0, 0, 0.55);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 32px -16px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
    --term-bg: #121412;
    --term-raise: #1a1c19;
    --term-rule: #2a2d29;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0f100f;
  --surface: #161816;
  --sunken: #1b1d1a;
  --ink: #ecede8;
  --ink-2: #b4b7af;
  --ink-3: #8a8e86;
  --rule: #2a2d29;
  --rule-strong: #ecede8;
  --leaf: #7cc796;
  --leaf-wash: rgba(124, 199, 150, 0.12);
  --rec: #ff6f62;
  --dot: rgba(236, 237, 232, 0.14);
  --dot-hot: #ecede8;
  --glow: rgba(236, 237, 232, 0.05);
  --nav-bg: rgba(15, 16, 15, 0.72);
  --backdrop: rgba(0, 0, 0, 0.55);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 32px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
  --term-bg: #121412;
  --term-raise: #1a1c19;
  --term-rule: #2a2d29;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

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

@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 40px);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ---------- Buttons ---------- */

.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--btn-h);
  padding-inline: 22px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.975rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: color 0.25s, background-color 0.25s, border-color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.btn--outline {
  border-color: var(--ink);
  color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0%;
  transition: color 0.3s, background-size 0.3s var(--ease-out), transform 0.25s var(--ease-out), border-color 0.3s;
}
.btn--outline:hover,
.btn--outline:focus-visible { color: var(--paper); background-size: 100% 100%; }

.btn--solid {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -12px var(--ink);
}
.btn--solid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}
.btn--solid:hover::after,
.btn--solid:focus-visible::after { transform: translateX(120%); }
.btn--solid:hover { box-shadow: 0 14px 30px -12px var(--leaf); }
.btn:active { scale: 0.97; }

.btn--ghost { color: var(--ink-2); }
.btn--ghost:hover { color: var(--ink); background-color: var(--sunken); }

.btn--sm { --btn-h: 38px; padding-inline: 14px; font-size: 0.875rem; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn:active { transform: scale(0.94); }

.icon--moon { display: block; }
.icon--sun { display: none; }
:root[data-theme="dark"] .icon--moon { display: none; }
:root[data-theme="dark"] .icon--sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon--moon { display: none; }
  :root:not([data-theme="light"]) .icon--sun { display: block; }
}

/* ---------- Navigation ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--paper);
}

.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--rule); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  max-width: calc(var(--wrap) + 40px);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.975rem;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  padding-top: 2px;
  transition: background-color 0.25s, color 0.25s, transform 0.4s var(--ease-out);
}
.brand:hover .brand__mark { background: var(--ink); color: var(--paper); transform: rotate(-6deg); }

.nav__links {
  position: relative;
  display: flex;
  gap: 2px;
  margin-inline: auto;
  padding: 4px;
}
.nav__links a {
  position: relative;
  z-index: 1;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.nav__links a:hover,
.nav__links a[aria-current="true"] { color: var(--ink); }

.nav__pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--sunken);
  border: 1px solid var(--rule);
  opacity: 0;
  transition: transform 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity 0.25s;
}

.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav__links + .nav__actions { margin-left: 0; }

.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.palette-trigger:hover { color: var(--ink); border-color: var(--ink-3); }
.palette-trigger .icon { width: 16px; height: 16px; }

.nav__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--leaf), var(--leaf-2) 60%, var(--sun));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px - env(safe-area-inset-top, 0px));
  overflow: hidden;
  padding-top: clamp(32px, 6vh, 72px);
  touch-action: pan-y;
}

.hero__aurora {
  position: absolute;
  inset: 0 -8% 8%;
  pointer-events: none;
  filter: blur(72px);
  -webkit-mask-image: linear-gradient(#0000, #000 22%);
  mask-image: linear-gradient(#0000, #000 22%);
}
.hero__aurora i {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.hero__aurora i:nth-child(1) {
  left: 12%;
  top: 8%;
  width: 46%;
  height: 62%;
  background: var(--aurora-a);
  animation: drift-a 19s ease-in-out infinite alternate;
}
.hero__aurora i:nth-child(2) {
  right: 8%;
  top: 22%;
  width: 40%;
  height: 58%;
  background: var(--aurora-b);
  animation: drift-b 23s ease-in-out infinite alternate;
}
.hero__aurora i:nth-child(3) {
  left: 38%;
  top: 30%;
  width: 26%;
  height: 40%;
  background: var(--aurora-c);
  translate: calc(var(--px, 0) * 90px) calc(var(--py, 0) * 60px);
  transition: translate 0.9s var(--ease-out);
}
@keyframes drift-a {
  to { transform: translate(14%, 12%) scale(1.15); }
}
@keyframes drift-b {
  to { transform: translate(-16%, -10%) scale(0.9); }
}

.hero__dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 72% 80% at 50% 42%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 80% at 50% 42%, #000 25%, transparent 78%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  margin-block: auto;
  padding-bottom: clamp(24px, 4vh, 44px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px 5px 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, color 0.2s;
}
.status:hover { color: var(--ink); border-color: var(--ink-3); }

.clock__dot { display: inline-block; margin-right: 10px; vertical-align: 1px; }
.status__dot,
.clock__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--leaf);
  flex: none;
}
.status__dot::after,
.clock__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--leaf);
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.6; }
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

.portrait {
  position: relative;
  width: 204px;
  height: 204px;
  margin-block: 4px;
}
.portrait__img {
  position: absolute;
  top: 26px;
  left: 26px;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--surface);
  box-shadow: 0 0 0 1px var(--rule), 0 10px 30px -10px rgba(23, 24, 22, 0.35);
  transform: perspective(700px) rotateY(calc(var(--px, 0) * 14deg)) rotateX(calc(var(--py, 0) * -14deg)) scale(var(--zoom, 1));
  transition: transform 0.5s var(--ease-out);
}
.portrait:hover { --zoom: 1.05; }
.portrait::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--leaf), var(--sun), var(--leaf-2), var(--leaf));
  filter: blur(16px);
  opacity: 0.55;
  animation: spin 9s linear infinite;
  transition: opacity 0.4s, inset 0.4s var(--ease-out);
}
.portrait:hover::before { opacity: 0.9; inset: 14px; }
.portrait__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.portrait__ring text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  fill: var(--ink-3);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-top: 4px;
}

.hero__name {
  position: relative;
  display: inline-block;
  padding-bottom: 0.12em;
  white-space: nowrap;
  background: linear-gradient(100deg, var(--leaf) 0%, var(--leaf-2) 38%, var(--sun) 62%, var(--leaf-2) 82%, var(--leaf) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: name-sheen 9s ease-in-out infinite alternate;
}
@keyframes name-sheen {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}
.hero__squiggle {
  position: absolute;
  left: 1%;
  bottom: -0.02em;
  width: 98%;
  height: 0.16em;
  overflow: visible;
}
.hero__squiggle path {
  fill: none;
  stroke: var(--sun);
  stroke-width: 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.js .hero__squiggle { animation: squiggle 1.1s var(--ease-out) 0.9s both; }
@keyframes squiggle {
  from { clip-path: inset(-100% 100% -100% 0); }
  to { clip-path: inset(-100% -2% -100% 0); }
}

.roles {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 1rem + 0.9vw, 1.6rem);
  color: var(--ink-2);
  line-height: 1.3;
}
.roles__prompt { color: var(--leaf); }
.roles__text { white-space: pre; }
.roles__caret {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 1px;
  background: var(--leaf);
  transform: translateY(0.15em);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__lede {
  max-width: 54ch;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.6;
  text-wrap: pretty;
}
.hero__lede strong { color: var(--ink); font-weight: 600; }

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.socials { display: flex; gap: 6px; }
.social {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s, transform 0.3s var(--ease-out);
}
.social .icon { width: 20px; height: 20px; }
.social:hover { color: var(--ink); background: var(--sunken); transform: translateY(-2px); }

.hero__hint {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* Page-load sequence */
.js .hero [data-hero-step] {
  animation: rise 0.8s var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 80ms + 60ms);
}
.hero [data-hero-step="1"] { --d: 1; }
.hero [data-hero-step="2"] { --d: 2; }
.hero [data-hero-step="3"] { --d: 3; }
.hero [data-hero-step="4"] { --d: 4; }
.hero [data-hero-step="5"] { --d: 5; }
.hero [data-hero-step="6"] { --d: 6; }
.hero [data-hero-step="7"] { --d: 7; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding-block: 16px;
  border-block: 1px solid var(--rule);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s;
}
.marquee__track li:hover { color: var(--leaf); }
.marquee__track li::after {
  content: "✦";
  margin-inline: 22px;
  font-size: 0.7rem;
  color: var(--sun);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Highlights ---------- */

.stats { padding-top: clamp(28px, 5vw, 56px); }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.stats__grid li + li { border-left: 1px solid var(--rule); }
.stat {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  padding: 24px 22px 22px;
  text-decoration: none;
  transition: background-color 0.3s;
}
.stat::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--leaf), var(--sun));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.stat:hover { background: var(--leaf-wash); }
.stat:hover::after,
.stat:focus-visible::after { transform: scaleX(1); }
.stat__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 1.5rem + 2vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--leaf), var(--leaf-2) 55%, var(--sun) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label { color: var(--ink-2); font-size: 0.925rem; line-height: 1.4; text-wrap: balance; }

/* ---------- Confetti ---------- */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Sections ---------- */

.section { padding-top: clamp(72px, 10vw, 120px); }

.section__head {
  display: grid;
  gap: 10px;
  max-width: 46rem;
  margin-bottom: clamp(28px, 4vw, 40px);
}
.section__head--split {
  max-width: none;
  grid-template-columns: minmax(0, 46rem) auto;
  align-items: end;
  justify-content: space-between;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--leaf);
  letter-spacing: 0.02em;
}
.section__head .eyebrow::after {
  content: "";
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--leaf), var(--sun), transparent);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.section__lede {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* Reveal on scroll (only for content below the first screen) */
.reveal-pending {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  filter: blur(6px);
}
.reveal-pending.is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.7s ease, transform 0.9s var(--ease-out), filter 0.7s ease;
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- Terminal / agent ---------- */

.term {
  border: 1px solid var(--term-rule);
  border-radius: var(--r-md);
  background: var(--term-bg);
  color: var(--term-ink);
  box-shadow: var(--shadow-lg), 0 50px 120px -50px var(--term-glow);
  overflow: hidden;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--term-rule);
  background: var(--term-raise);
}
.term__lights { display: flex; gap: 7px; }
.term__lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--term-rule);
}
.term:hover .term__lights i:nth-child(1) { background: #ff5f57; }
.term:hover .term__lights i:nth-child(2) { background: #febc2e; }
.term:hover .term__lights i:nth-child(3) { background: #28c840; }
.term__title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--term-dim);
  margin-inline: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term__tag {
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--term-rule);
  border-radius: 999px;
  font-size: 0.75rem;
}
.term__clear {
  padding: 3px 9px;
  border: 1px solid var(--term-rule);
  border-radius: 6px;
  background: transparent;
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
}
.term__clear:hover { color: var(--term-ink); border-color: var(--term-dim); }

.term__log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 400px;
  padding: 20px clamp(16px, 3vw, 28px) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--term-rule) transparent;
}

.msg { max-width: 72ch; font-size: 0.975rem; line-height: 1.65; }
.msg--ai code,
.msg--sys code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--term-raise);
  border: 1px solid var(--term-rule);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--term-accent);
}
.msg--sys { font-family: var(--font-mono); color: var(--term-dim); font-size: 0.9rem; }
.msg--user {
  font-family: var(--font-mono);
  font-size: 0.975rem;
  color: var(--term-ink);
  margin-top: 6px;
}
.msg__prompt { color: var(--term-accent); margin-right: 6px; }
.msg--ai { color: var(--term-ink); display: grid; gap: 10px; }
.msg--ai strong { color: #fff; font-weight: 600; }
.msg--ai a { color: var(--term-accent); text-underline-offset: 3px; }
.msg--ai ul { display: grid; gap: 6px; }
.msg--ai li { position: relative; padding-left: 18px; }
.msg--ai li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(0.8em - 1px);
  width: 8px;
  height: 2px;
  background: var(--term-accent);
}
.msg--error { color: var(--term-warm); font-family: var(--font-mono); font-size: 0.9rem; }
.msg .help {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.caret {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--term-accent);
  animation: blink 0.9s steps(1) infinite;
}

.thinking {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: linear-gradient(90deg, var(--term-dim) 0%, var(--term-ink) 50%, var(--term-dim) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.msg--tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 100%; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  max-width: 100%;
  padding: 7px 10px 7px 9px;
  border: 1px solid var(--term-rule);
  border-radius: 8px;
  background: var(--term-raise);
  color: var(--term-ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s;
}
.tool:hover { border-color: var(--term-dim); }
.tool[disabled] { cursor: progress; }
.tool__status {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--term-rule);
  border-top-color: var(--term-accent);
  animation: spin 0.8s linear infinite;
}
.tool__status .icon { display: none; width: 14px; height: 14px; color: var(--term-accent); }
.tool__status.is-done { border: 0; animation: none; }
.tool__status.is-done .icon { display: block; }
.tool__status.is-miss { border: 0; animation: none; }
.tool__status.is-miss::before { content: "∅"; color: var(--term-warm); font-size: 0.85rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool__call { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool__name { color: var(--term-accent); }
.tool__args { color: var(--term-dim); }
.tool__meta {
  flex: none;
  padding-left: 10px;
  border-left: 1px solid var(--term-rule);
  color: var(--term-dim);
  font-size: 0.78rem;
}
.tool__chev { width: 14px; height: 14px; color: var(--term-dim); transition: transform 0.25s; }
.tool[aria-expanded="true"] .tool__chev { transform: rotate(180deg); }
.tool__out {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--term-rule);
  border-radius: 8px;
  background: var(--term-raise);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--term-dim);
}
.j-k { color: var(--term-ink); }
.j-s { color: var(--term-accent); }
.j-n, .j-b { color: var(--term-warm); }

.term__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px clamp(16px, 3vw, 28px);
  border-top: 1px solid var(--term-rule);
}
.chip-btn {
  padding: 6px 11px;
  border: 1px solid var(--term-rule);
  border-radius: 7px;
  background: transparent;
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chip-btn:hover,
.chip-btn:focus-visible { color: var(--term-ink); border-color: var(--term-accent); background: rgba(134, 209, 159, 0.08); }

.term__form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px clamp(16px, 3vw, 28px);
  border-top: 1px solid var(--term-rule);
  background: var(--term-raise);
}
.term__prompt { color: var(--term-accent); font-family: var(--font-mono); font-size: 1.05rem; }
.term__input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--term-ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  caret-color: var(--term-accent);
  outline: none;
}
.term__input::placeholder { color: var(--term-dim); opacity: 1; }
.term__send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--term-rule);
  border-radius: 8px;
  background: transparent;
  color: var(--term-dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.term__send:not([disabled]):hover { color: var(--term-bg); background: var(--term-accent); border-color: var(--term-accent); }
.term__form:focus-within { box-shadow: inset 0 1px 0 var(--term-accent); }

/* ---------- Work / bento ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card--wide { grid-column: span 2; }

.card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow 0.35s, transform 0.5s var(--ease-out), border-color 0.35s;
}
.card:hover {
  box-shadow: var(--shadow), 0 30px 60px -36px var(--leaf);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
  transition-duration: 0.35s, 0.18s, 0.35s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--leaf), var(--sun) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before,
.card:hover::after { opacity: 1; }

.card__viz {
  position: relative;
  height: 196px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--rule);
  background-color: var(--sunken);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 16px 16px;
  background-position: 8px 8px;
  transition: background-color 0.4s;
}
.card:hover .card__viz { background-color: color-mix(in srgb, var(--leaf) 7%, var(--sunken)); }
.viz { width: 100%; height: 100%; overflow: visible; }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 20px 22px 22px;
}
.card__meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card__title a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.card__title .icon {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  transition: transform 0.3s var(--ease-out), color 0.3s;
}
.card:hover .card__title .icon { transform: translate(2px, -2px); color: var(--ink); }
.card__text { color: var(--ink-2); font-size: 0.975rem; text-wrap: pretty; }
.card__body .tags { margin-top: auto; padding-top: 6px; }

.metric {
  margin-top: auto;
  padding-top: 10px;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.metric__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--leaf);
  margin-right: 4px;
}
.metric__badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--leaf-wash);
  color: var(--leaf);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.card--archive { background: var(--paper); border-style: dashed; }
.card--archive .card__body { gap: 12px; }
.archive { display: grid; gap: 14px; margin-top: 4px; }
.archive li { display: grid; gap: 2px; }
.archive__name { font-weight: 600; }
.archive__name a { text-underline-offset: 3px; text-decoration-color: var(--rule); }
.archive__name a:hover { text-decoration-color: var(--ink); }
.archive__desc { color: var(--ink-3); font-size: 0.9rem; }
.archive__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
}
.archive__more:hover { color: var(--ink); }
.archive__more .icon { transition: transform 0.3s var(--ease-out); }
.archive__more:hover .icon { transform: translate(2px, -2px); }

/* Shared viz styles */
.viz * { transform-box: fill-box; }
.viz text { font-family: var(--font-mono); }
.v-label { font-size: 12px; fill: var(--ink); }
.v-mono { font-size: 11px; fill: var(--ink-2); }
.v-dim { fill: var(--ink-3); }
.v-tick { font-size: 10.5px; fill: var(--ink-3); }
.v-big { font-family: var(--font-display) !important; font-size: 19px; font-weight: 800; fill: var(--ink); }
.v-fill { fill: var(--rule); }
.v-field { fill: var(--surface); stroke: var(--ink-3); stroke-opacity: 0.5; stroke-width: 1; }
.v-wire { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 4; }
.v-node rect:first-child { fill: var(--surface); stroke: var(--ink-3); stroke-opacity: 0.55; stroke-width: 1; }
.v-node--out rect:first-child { stroke: var(--leaf); stroke-opacity: 1; stroke-width: 1.5; }
.v-node--tool rect:first-child { stroke-dasharray: 4 3; }
.v-stream { fill: var(--leaf); opacity: 0.75; transform-origin: left center; }
.v-check circle { fill: var(--leaf); }
.v-check path { fill: none; stroke: var(--surface); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v-pulse { fill: var(--leaf); }

/* Akai */
.card.is-live .v-pulse { animation: akai-pulse 2.4s linear infinite; }
.card.is-live .v-stream { animation: akai-stream 2.4s var(--ease-out) infinite; }
.card.is-live .v-stream--2 { animation-delay: 0.12s; }
.card.is-live .v-stream--3 { animation-delay: 0.24s; }
.card.is-live .v-stream--4 { animation-delay: 0.36s; }
.card.is-live .v-check { animation: akai-check 2.4s var(--ease-out) infinite; transform-origin: center; }
@keyframes akai-pulse {
  0% { transform: translateX(0); opacity: 1; }
  15% { opacity: 1; } 15.5% { opacity: 0; }
  45.5% { opacity: 0; } 46% { opacity: 1; }
  61% { opacity: 1; } 61.5% { opacity: 0; }
  91.5% { opacity: 0; } 92% { opacity: 1; }
  100% { transform: translateX(306px); opacity: 1; }
}
@keyframes akai-stream {
  0%, 88% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}
@keyframes akai-check {
  0%, 92% { transform: scale(0); }
  97% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* NeetoForm */
.v-field--active { stroke: var(--ink); stroke-opacity: 1; stroke-width: 1.5; }
.v-button { fill: var(--ink); }
.v-bar--ghost { fill: var(--rule); }
.v-bar--shrink { fill: var(--leaf); transform-origin: left center; }
.card.is-live .v-bar--shrink { animation: form-shrink 1.6s var(--ease-out) both; }
.card.is-live .v-bundle .v-big { animation: fade-in 1.6s ease both; }
.card.is-live .v-drag { animation: form-drag 1.6s var(--ease-out) both; }
@keyframes form-shrink {
  0%, 20% { transform: scaleX(5); }
  80%, 100% { transform: scaleX(1); }
}
@keyframes form-drag {
  0%, 100% { transform: none; }
  25%, 65% { transform: translate(8px, -4px); }
}
@keyframes fade-in {
  0%, 60% { opacity: 0; }
  100% { opacity: 1; }
}

/* NeetoRecord */
.v-screen { fill: var(--surface); stroke: var(--ink-3); stroke-opacity: 0.5; }
.v-zoom { fill: var(--sunken); stroke: var(--ink-3); stroke-dasharray: 4 3; transform-origin: center; }
.v-rec { fill: var(--rec); }
.v-rec-label { fill: var(--rec); font-size: 10px; }
.v-cam circle:first-child { fill: var(--sunken); stroke: var(--ink-3); stroke-width: 1.25; }
.v-cam__head { fill: var(--ink-3); }
.v-cam__body { fill: none; stroke: var(--ink-3); stroke-width: 2.4; stroke-linecap: round; }
.v-track { fill: var(--sunken); stroke: var(--ink-3); stroke-opacity: 0.4; }
.v-kept { fill: var(--leaf-wash); stroke: var(--leaf); stroke-width: 1.25; transform-origin: center; }
.v-handle { fill: var(--leaf); }
.v-playhead { stroke: var(--ink); stroke-width: 1.5; }
.card.is-live .v-rec { animation: blink 1s steps(1) infinite; }
.card.is-live .v-kept { animation: rec-trim 1.2s var(--ease-out) both; }
.card.is-live .v-handle--l { animation: rec-handle-l 1.2s var(--ease-out) both; }
.card.is-live .v-handle--r { animation: rec-handle-r 1.2s var(--ease-out) both; }
.card.is-live .v-zoom { animation: rec-zoom 1.4s var(--ease-out) both; }
.card.is-live .v-playhead { animation: rec-play 2.4s linear 1.2s infinite; }
@keyframes rec-trim { to { transform: scaleX(0.64); } }
@keyframes rec-handle-l { to { transform: translateX(50px); } }
@keyframes rec-handle-r { to { transform: translateX(-50px); } }
@keyframes rec-zoom { 0%, 25% { transform: scale(1); } 100% { transform: scale(1.16); } }
@keyframes rec-play { from { transform: translateX(10px); } to { transform: translateX(190px); } }

/* NeetoWireframe */
.v-sketch {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.v-cursor {
  fill: var(--ink);
  stroke: var(--surface);
  stroke-width: 1.2;
  stroke-linejoin: round;
  transform: translate(236px, 118px);
}
.card.is-live .v-sketch { animation: sketch 0.9s var(--ease-out) both; }
.card.is-live .v-sketch:nth-of-type(2) { animation-delay: 0.1s; }
.card.is-live .v-sketch:nth-of-type(3) { animation-delay: 0.2s; }
.card.is-live .v-sketch:nth-of-type(4) { animation-delay: 0.3s; }
.card.is-live .v-sketch:nth-of-type(5) { animation-delay: 0.4s; }
.card.is-live path.v-sketch { animation-delay: 0.35s; }
.card.is-live .v-cursor { animation: cursor-move 2.6s ease-in-out infinite alternate; }
@keyframes sketch { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cursor-move {
  0% { transform: translate(236px, 118px); }
  35% { transform: translate(60px, 60px); }
  70% { transform: translate(150px, 70px); }
  100% { transform: translate(250px, 64px); }
}

/* NeetoUI */
.v-btn rect { fill: var(--ink); transform-origin: center; }
.v-btn text { fill: var(--paper); font-family: var(--font-body) !important; font-size: 12.5px; font-weight: 600; }
.v-toggle__track { fill: var(--rule); transition: fill 0.3s 0.15s; }
.v-toggle__knob { fill: var(--surface); stroke: var(--ink-3); stroke-opacity: 0.4; transition: transform 0.35s var(--ease-out) 0.15s; }
.v-checkbox__box { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.25; transition: fill 0.25s 0.35s, stroke 0.25s 0.35s; }
.v-checkbox__tick { fill: none; stroke: var(--paper); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.35s 0.5s; }
.v-avatar circle { fill: var(--leaf-wash); stroke: var(--leaf); stroke-width: 1.25; }
.v-avatar text { fill: var(--leaf); font-size: 11px; }
.v-pill rect { fill: var(--sunken); stroke: var(--ink-3); stroke-opacity: 0.45; }
.v-pill text { fill: var(--ink-2); font-size: 11px; }
.v-pill--b rect { fill: var(--leaf-wash); stroke: var(--leaf); stroke-opacity: 0.6; }
.v-pill--b text { fill: var(--leaf); }
.card.is-live .v-btn rect { animation: press 0.5s var(--ease-out); }
.card.is-live .v-toggle__track { fill: var(--leaf); }
.card.is-live .v-toggle__knob { transform: translateX(20px); }
.card.is-live .v-checkbox__box { fill: var(--ink); stroke: var(--ink); }
.card.is-live .v-checkbox__tick { stroke-dashoffset: 0; }
@keyframes press { 50% { transform: scale(0.92); } }

/* TCS / SOC */
.v-axis { stroke: var(--ink-3); stroke-width: 1; }
.v-grid { stroke: var(--rule); stroke-dasharray: 3 3; }
.v-col--before, .v-row--before { fill: var(--ink-2); }
.v-col--after, .v-row--after { fill: var(--leaf); }
.v-col { transform-origin: bottom center; }
.v-row { transform-origin: left center; }
.v-on-bar { fill: var(--paper); }
.card.is-live .v-col--before { animation: grow-y 0.7s var(--ease-out) both; }
.card.is-live .v-col--after { animation: grow-y 0.7s var(--ease-out) 0.25s both; }
.card.is-live .v-row--before { animation: grow-x 0.9s var(--ease-out) both; }
.card.is-live .v-row--after { animation: grow-x 0.5s var(--ease-out) 0.35s both; }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }

/* ---------- Experience ---------- */

.timeline { margin-bottom: 28px; }
.timeline__track {
  position: relative;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}
.timeline__seg {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  padding-inline: 10px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.25s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.timeline__seg.is-tight { color: transparent; padding: 0; }
.timeline__seg--tcs { background: var(--ink-3); color: var(--paper); }
.timeline__seg--deel { background: var(--leaf); color: var(--paper); }
.timeline__seg--edu {
  background: repeating-linear-gradient(-45deg, var(--sunken) 0 6px, var(--rule) 6px 7px);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.timeline.has-hl .timeline__seg:not(.is-hl) { opacity: 0.35; }
.timeline.is-revealed .timeline__seg {
  transform-origin: left center;
  animation: grow-x 0.7s var(--ease-out) both;
  animation-delay: calc(var(--n, 0) * 110ms + 150ms);
}
.timeline__seg.is-hl { transform: translateY(-2px); box-shadow: var(--shadow); }
.timeline__now {
  position: absolute;
  top: 50%;
  right: -5px;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 3px var(--paper);
}
.timeline__now::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--leaf);
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.timeline__axis { position: relative; height: 24px; margin-top: 6px; }
.timeline__tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.timeline__tick::before {
  content: "";
  display: block;
  width: 1px;
  height: 5px;
  margin: 0 auto 2px;
  background: var(--ink-3);
  opacity: 0.6;
}
.timeline__caption {
  min-height: 1.5em;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.role-list { border-top: 1px solid var(--rule); }
.role { border-bottom: 1px solid var(--rule); transition: opacity 0.3s, background-color 0.3s; }
.role-list:has(.role:hover) .role:not(:hover) { opacity: 0.55; }
.role.is-hl { background: var(--leaf-wash); }

.role__summary {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto 18px;
  align-items: baseline;
  gap: 8px 20px;
  padding: 22px 8px;
  list-style: none;
  cursor: pointer;
}
.role__summary::-webkit-details-marker { display: none; }
.role--edu .role__summary { cursor: default; grid-template-columns: 11rem minmax(0, 1fr) auto; }

.role__when {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.role__head { display: grid; gap: 2px; min-width: 0; }
.role__title { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.role__at { color: var(--ink-3); font-weight: 400; }
.role__sub { color: var(--ink-2); font-size: 0.925rem; }
.role__tenure {
  padding: 2px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.role__chev {
  align-self: center;
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  transition: transform 0.3s var(--ease-out);
}
.role[open] .role__chev { transform: rotate(180deg); }
.role__summary:hover .role__title { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }

.role__body {
  display: grid;
  gap: 16px;
  padding: 0 8px 26px calc(11rem + 28px);
}
.role__points { display: grid; gap: 10px; max-width: 70ch; color: var(--ink-2); }
.role__points li { position: relative; padding-left: 20px; }
.role__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(0.8em - 1px);
  width: 9px;
  height: 2px;
  background: var(--leaf);
}
.role__points a { color: var(--ink); text-underline-offset: 3px; }

@supports selector(::details-content) {
  .role::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.4s var(--ease-out), content-visibility 0.4s allow-discrete;
  }
  .role[open]::details-content { block-size: auto; }
}

/* ---------- Tags / toolbox ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sunken);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.tags--lg { gap: 8px; }
.tags--lg li {
  padding: 5px 11px;
  font-size: 0.925rem;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.25s var(--ease-out);
}
.tags--lg li:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-2px); }

.toolbox__view {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
}
.toolbox__view--json { border: 0; background: none; }
.stack {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  align-items: baseline;
  gap: 12px 24px;
  padding: 22px 24px;
}
.stack + .stack { border-top: 1px solid var(--rule); }
.stack__label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}
.seg__btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg__btn:not([aria-pressed="true"]):hover { color: var(--ink); }

.code {
  margin: 0;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-3);
}
.code .j-k { color: var(--ink); }
.code .j-s { color: var(--leaf); }
.code .j-n, .code .j-b { color: var(--rec); }

/* ---------- Contact ---------- */

.section--contact { padding-bottom: clamp(72px, 10vw, 120px); }

.contact {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 56px);
  isolation: isolate;
  border: 2px solid transparent;
  border-radius: 22px;
  background:
    radial-gradient(var(--dot) 1px, transparent 1.3px) 0 0 / 18px 18px padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--angle, 0deg), var(--leaf), var(--sun), var(--leaf-2), var(--ink-3), var(--leaf)) border-box;
  box-shadow: 0 40px 100px -50px var(--leaf);
  text-align: center;
  overflow: hidden;
  animation: border-spin 8s linear infinite;
}
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes border-spin { to { --angle: 360deg; } }
.contact__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40% 60% at 18% 0%, var(--aurora-a), transparent 70%),
    radial-gradient(40% 60% at 85% 100%, var(--aurora-b), transparent 70%);
  opacity: 0.8;
}
.contact__title em {
  font-style: normal;
}
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.contact .section__lede { margin-inline: auto; }

.email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  margin-top: 10px;
}
.email__addr {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 1rem + 2vw, 2.25rem);
  line-height: 1.2;
  text-decoration: none;
  background-image: linear-gradient(var(--leaf), var(--leaf));
  background-size: 0% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease-out);
  overflow-wrap: anywhere;
}
.email__addr:hover { background-size: 100% 3px; }
.email__copy .icon--check { display: none; }
.email__copy.is-copied .icon--check { display: block; color: var(--leaf); }
.email__copy.is-copied .icon--copy { display: none; }

.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.link-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.link-row .icon { width: 18px; height: 18px; }
.link-row__handle { color: var(--ink-3); font-family: var(--font-mono); font-weight: 400; font-size: 0.8125rem; }
.link-row__arrow { color: var(--ink-3); transition: transform 0.3s var(--ease-out), color 0.3s; }
.link-row:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.link-row:hover .link-row__arrow { color: var(--ink); transform: translate(2px, -2px); }

.clock {
  margin-top: 10px;
  line-height: 1.7;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--rule); overflow: hidden; }
.footer__sign {
  margin: clamp(20px, 4vw, 48px) 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 13.2vw, 12.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  background:
    linear-gradient(100deg, var(--leaf), var(--leaf-2) 45%, var(--sun)) no-repeat 0 0 / 0% 100%,
    linear-gradient(var(--rule), var(--rule));
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-size 1.2s var(--ease-out);
  user-select: none;
}
.footer:hover .footer__sign { background-size: 100% 100%, auto; }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink-2);
}
.footer__top:hover { color: var(--ink); }

/* ---------- Command palette ---------- */

.palette {
  width: min(620px, calc(100vw - 32px));
  max-height: min(540px, calc(100dvh - 96px));
  margin: max(10vh, 48px) auto auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.palette[open] { display: flex; flex-direction: column; animation: pop 0.2s var(--ease-out); }
.palette::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes fade { from { opacity: 0; } }

.palette__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-3);
}
.palette__input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  outline: none;
}
.palette__input::placeholder { color: var(--ink-3); }

.palette__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
}
.palette__group {
  padding: 10px 10px 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink-2);
  scroll-margin: 8px;
}
.palette__item .icon { width: 18px; height: 18px; color: var(--ink-3); }
.palette__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__hint { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-3); }
.palette__item[aria-selected="true"] { background: var(--sunken); color: var(--ink); }
.palette__item[aria-selected="true"] .icon { color: var(--leaf); }
.palette__empty { padding: 24px 12px; text-align: center; color: var(--ink-3); }
.palette__foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.palette__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- View transition (theme switch) ---------- */

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Responsive ---------- */

.label-mobile { display: none; }

@media (max-width: 960px) {
  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats__grid li:nth-child(odd) { border-left: 0; }
  .stats__grid li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--archive { grid-column: span 2; }
}

@media (max-width: 820px) {
  .nav__links { display: none; }
  .label-desktop { display: none; }
  .label-mobile { display: inline; }
  .palette-trigger .kbd { display: none; }
  .nav__actions { margin-left: auto; }

  .role__summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "when chev" "head head" "tenure tenure";
    padding-inline: 4px;
  }
  .role--edu .role__summary { grid-template-columns: minmax(0, 1fr); grid-template-areas: "when" "head" "tenure"; }
  .role__when { grid-area: when; }
  .role__head { grid-area: head; }
  .role__tenure { grid-area: tenure; justify-self: start; }
  .role__chev { grid-area: chev; }
  .role__body { padding: 0 4px 24px; }
  .section__head--split { grid-template-columns: minmax(0, 1fr); }
  .stack { grid-template-columns: minmax(0, 1fr); padding: 18px 18px 20px; }
  .seg { justify-self: start; }
}

@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .card--wide,
  .card--archive { grid-column: auto; }
  .card__viz { height: 176px; }
  .card--wide .card__viz { height: 150px; }
  .brand__name { display: none; }
  .term__log { height: 440px; }
  .term__tag { display: none; }
  .term__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .term__chips::-webkit-scrollbar { display: none; }
  .chip-btn { flex: none; }
  .hero__title { font-size: clamp(2.3rem, 1.4rem + 5vw, 3rem); }
  .hero__aurora { filter: blur(48px); inset: 0 -30% 20%; }
  .stat { padding: 18px 16px 16px; }
  .marquee { padding-block: 13px; }
  .palette__foot { display: none; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}

html:has(dialog[open]) { overflow: hidden; }
