/* ------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------ */
:root {
  --paper: #0F1A26;
  --ink: #E6ECF2;
  --ink-soft: #9AAABB;
  --rule: #26374A;
  --grid: rgba(230, 236, 242, 0.06);
  --signal: #6C8CFF;
  --signal-soft: rgba(108, 140, 255, 0.16);
  --hot: #F2A44A;
  --hot-soft: rgba(242, 164, 74, 0.2);
  --glass: rgba(20, 34, 50, 0.55);
  --glass-strong: rgba(20, 34, 50, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 60px -24px rgba(108, 140, 255, 0.45);
  --name-grad: linear-gradient(120deg, #F2F6FA 25%, #9DB6FF 100%);
  --num-grad: linear-gradient(120deg, var(--signal), var(--hot));
  --noise-alpha: 0.06;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-gap: clamp(5rem, 12vw, 9rem);

  /* the page is dark only: no light palette, no toggle */
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* blueprint grid across the whole page, faint */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  isolation: isolate;
  --mx: 50vw; --my: 30vh;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  opacity: var(--noise-alpha);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}
/* a soft torch follows the pointer and lights the grid under it */
.spotlight {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), var(--signal-soft), transparent 70%);
  opacity: 0; transition: opacity 600ms ease;
}
.spotlight::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--signal) 35%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--signal) 35%, transparent) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center top;
  -webkit-mask-image: radial-gradient(260px circle at var(--mx) var(--my), #000, transparent 100%);
          mask-image: radial-gradient(260px circle at var(--mx) var(--my), #000, transparent 100%);
}
body.has-pointer .spotlight { opacity: 1; }
@media (hover: none) { .spotlight { display: none; } }

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

.mono { font-family: var(--font-mono); font-size: 0.875em; letter-spacing: -0.01em; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.75rem; z-index: 100;
}
.skip:focus { top: 1rem; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
/* scroll progress runs along the header's bottom edge, scroll-driven */
.top::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--hot);
  transform: scaleX(0); transform-origin: left center;
}
@supports (animation-timeline: scroll()) {
  .top::after { animation: progress linear both; animation-timeline: scroll(root); }
}
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.wordmark { transition: background 200ms ease, color 200ms ease; }
.wordmark:hover { background: var(--ink); color: var(--paper); }
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left center;
  transition: transform 250ms cubic-bezier(.2,.7,.2,1);
}
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: none; }
.nav a:hover, .nav a[aria-current="true"] { text-decoration: none; }

.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; letter-spacing: 0.02em;
  padding: 0.15rem 0.4rem; border: 1.5px solid var(--ink);
}
.nav { display: flex; gap: 1.25rem; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); text-decoration: underline; }

@media (max-width: 640px) {
  .top { gap: 0.75rem; }
  .nav { gap: 0.75rem; }
  .nav a { font-size: 0.875rem; }
  .nav a:nth-child(1), .nav a:nth-child(4) { display: none; }
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(92svh, 900px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) 3rem;
  overflow: hidden;
  isolation: isolate;
}
.schematic {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
}
/* ambient light behind the drawing */
.orbs { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55;
  will-change: transform;
  animation: drift 26s ease-in-out infinite alternate;
}
.orb-a { width: 46vw; height: 46vw; right: -8vw; top: -12vw; background: var(--signal-soft); }
.orb-b { width: 34vw; height: 34vw; right: 18vw; bottom: -14vw; background: var(--hot-soft); animation-delay: -9s; animation-duration: 32s; }
.orb-c { width: 22vw; height: 22vw; left: 28vw; top: 4vw; background: var(--signal-soft); opacity: 0.35; animation-delay: -18s; animation-duration: 38s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vw, 5vw, 0) scale(1.12); }
}

.status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem; margin-bottom: 1.4rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 0.85rem; color: var(--ink-soft); box-shadow: var(--shadow);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #2FBF71;
  box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.5);
  animation: beacon 2.2s ease-out infinite;
}
@keyframes beacon {
  0%   { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(47, 191, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); }
}
.status-sep { width: 1px; height: 0.9em; background: var(--rule); }
.status .mono { font-size: 0.8rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-copy {
  position: relative; z-index: 1;
  max-width: 34rem;
}
/* staged entrance: each line rises out of a clipped box, then the buttons */
.hero-copy > * {
  animation: rise 800ms cubic-bezier(.2,.7,.2,1) both;
  animation-delay: var(--d, 0ms);
}
.hero-copy .status  { --d: 0ms; }
.hero-copy .hello   { --d: 80ms; }
.hero-copy .name    { --d: 180ms; }
.hero-copy .role    { --d: 420ms; }
.hero-copy .where   { --d: 540ms; }
.hero-copy .hero-actions { --d: 680ms; }
/* each line is its own clip box, padded so Vietnamese marks are never cut */
.name .line {
  display: block; overflow: hidden;
  padding: 0.06em 0 0.14em; margin-bottom: -0.14em;
}
.name .line > span {
  display: block;
  animation: unmask 900ms cubic-bezier(.2,.8,.2,1) both;
}
.name .line:nth-child(2) > span { animation-delay: 120ms; }
.hero-caption { animation: fade 1200ms ease both 1400ms; }

@keyframes rise   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes unmask { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
.hello {
  font-family: var(--font-mono); color: var(--ink-soft); font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.name {
  font-size: clamp(3.2rem, 9.5vw, 7.25rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.name .line > span {
  background: var(--name-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  padding-right: 0.06em; /* keep the last glyph's overhang inside the clip */
}
.role {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  max-width: 30rem;
  text-wrap: pretty;
}
.where { margin-top: 0.9rem; color: var(--ink-soft); }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-block;
  padding: 0.75rem 1.35rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500;
  background: var(--paper);
  transition: color 220ms ease, border-color 220ms ease, transform 160ms ease;
}
/* a fill sweeps in from the left like a packet crossing the node */
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform 320ms cubic-bezier(.2,.7,.2,1);
}
.btn:hover { color: var(--paper); transform: translateY(-1px); }
.btn:hover::before { transform: none; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary::before { background: var(--signal); }
.btn.primary:hover { border-color: var(--signal); box-shadow: 0 10px 30px -10px var(--signal); }
.btn { box-shadow: 0 0 0 0 transparent; transition: color 220ms ease, border-color 220ms ease, transform 160ms ease, box-shadow 300ms ease; }
.btn:active { transform: translateY(0); }

/* the caption is a framed note pinned to the drawing, never loose text on top of it */
.hero-caption {
  position: absolute; right: var(--gutter); bottom: 1.5rem; z-index: 1;
  width: min(30rem, calc(100% - 2 * var(--gutter)));
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule); border-radius: 14px;
  background: var(--glass-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--ink-soft); font-size: 0.8rem; line-height: 1.5;
  text-align: left; text-wrap: pretty;
}
.hero-caption .mono { color: var(--hot); margin-right: 0.4rem; }

/* Below this width the name and the drawing would collide, so the hero stacks:
   copy, then the drawing, then the caption. */
@media (max-width: 1200px) {
  .hero { min-height: auto; padding-bottom: 1.5rem; }
  .hero-copy { order: 1; }
  .schematic { order: 2; position: static; height: 440px; margin-top: 2.5rem; }
  .hero-caption { order: 3; position: static; width: 100%; margin-top: 1rem; }
}

/* ------------------------------------------------------------------
   Ticker
   ------------------------------------------------------------------ */
.ticker {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: var(--glass);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track {
  display: flex; width: max-content;
  animation: ticker 48s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  display: inline-flex; align-items: center; gap: 1.6rem;
  padding: 0.85rem 0 0.85rem 1.6rem;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft);
  white-space: nowrap;
}
.ticker-track span::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--hot);
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.section {
  padding: 0 var(--gutter);
  margin-top: var(--section-gap);
  scroll-margin-top: 4.5rem; /* keep anchored headings clear of the sticky header */
}
.section-head {
  position: relative;
  max-width: var(--measure);
  padding-top: 1.5rem;
  margin-bottom: 2.5rem;
}
/* the rule draws itself from the left when the section scrolls in */
.section-head::before {
  content: ""; position: absolute; left: 0; top: 0; height: 1px; width: 100%;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 900ms cubic-bezier(.2,.7,.2,1);
}
/* an amber packet runs the length of the rule as it draws */
.section-head::after {
  content: ""; position: absolute; top: -3px; left: 0; width: 7px; height: 7px;
  border-radius: 50%; background: var(--hot);
  opacity: 0;
}
.section-head > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(.2,.7,.2,1);
}
.section-head h2 { transition-delay: 250ms; }
.section-head .lede { transition-delay: 380ms; }
.section-head.in-view::before { transform: none; }
.section-head.in-view::after { animation: travel 900ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes travel {
  0%   { left: 0; opacity: 1; }
  85%  { opacity: 1; }
  100% { left: calc(100% - 7px); opacity: 0; }
}
.section-head.in-view > * { opacity: 1; transform: none; }
.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.lede { color: var(--ink-soft); max-width: 58ch; text-wrap: pretty; }

/* ------------------------------------------------------------------
   About
   ------------------------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: 2rem 3.5rem;
  align-items: start;
  max-width: 60rem;
}
.about-text { max-width: 62ch; display: grid; gap: 1rem; }
.about-text p { text-wrap: pretty; }

/* the photo: rounded, full color, lifted off the page with a soft shadow */
.portrait {
  position: relative; margin: 0;
  opacity: 0; transform: translateY(10px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(.2,.7,.2,1);
}
.about-grid.in-view .portrait { opacity: 1; transform: none; }
.portrait img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 78%;
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(18, 32, 46, 0.08),
    0 12px 32px -12px rgba(18, 32, 46, 0.35);
  transition: transform 500ms cubic-bezier(.2,.7,.2,1), box-shadow 500ms ease;
}
.portrait:hover img {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(18, 32, 46, 0.08),
    0 24px 48px -16px rgba(18, 32, 46, 0.45);
}
.about-text { opacity: 0; transform: translateY(10px); transition: opacity 600ms ease 150ms, transform 600ms cubic-bezier(.2,.7,.2,1) 150ms; }
.about-grid.in-view .about-text { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 17rem; }
}

/* ------------------------------------------------------------------
   Production figures: a bento of glass panels
   ------------------------------------------------------------------ */
.figures {
  list-style: none; max-width: 64rem;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
}
.figure {
  position: relative;
  display: grid; grid-template-columns: 1fr; gap: 0.75rem;
  padding: 1.6rem 1.6rem 1.7rem;
  border: 1px solid var(--rule); border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(.2,.7,.2,1),
              border-color 300ms ease, box-shadow 400ms ease;
  overflow: hidden;
}
.figure::before {
  /* a faint light in the top-left corner of each panel */
  content: ""; position: absolute; inset: -40% auto auto -20%; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, var(--signal-soft), transparent 70%);
  pointer-events: none; opacity: 0.8;
}
.figure.in-view { opacity: 1; transform: none; }
.figure:nth-child(2) { transition-delay: 60ms; }
.figure:nth-child(3) { transition-delay: 120ms; }
.figure:nth-child(4) { transition-delay: 180ms; }
.figure:nth-child(5) { transition-delay: 240ms; }
.figure:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--signal) 45%, var(--rule)); box-shadow: var(--shadow-hover); }
.figure-wide { grid-column: 1 / -1; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 1rem 2.5rem; align-items: start; }
.figure-num {
  position: relative;
  font-size: clamp(2.4rem, 4.2vw, 3.4rem);
  line-height: 1; font-weight: 500;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
  background: var(--num-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  padding-bottom: 0.1em;
}
.figure-body { position: relative; }
.figure-body h3 {
  font-family: var(--font-body); font-weight: 600; font-size: 1.08rem;
  margin-bottom: 0.45rem;
}
.figure-body p { color: var(--ink-soft); text-wrap: pretty; }
.bar {
  position: relative; height: 10px; margin-top: 1.1rem; max-width: 34rem;
}
.bar span {
  position: absolute; left: 0; top: 0; height: 100%;
  width: var(--w, 100%);
  border-radius: 999px;
  transform-origin: left center; transform: scaleX(0);
  transition: transform 900ms cubic-bezier(.2,.7,.2,1);
}
.bar-before { background: var(--rule); top: 0 !important; height: 4px !important; }
.bar-after  { background: var(--num-grad); top: 6px !important; height: 4px !important; }
.in-view .bar span { transform: scaleX(1); }
.in-view .bar .bar-after { transition-delay: 250ms; }
.bar-legend {
  display: flex; justify-content: space-between; max-width: 34rem;
  color: var(--ink-soft); margin-top: 0.4rem; font-size: 0.78rem;
}

@media (max-width: 720px) {
  .figures { grid-template-columns: 1fr; }
  .figure-wide { grid-template-columns: 1fr; gap: 0.5rem; }
  .figure { padding: 1.3rem 1.25rem 1.4rem; border-radius: 18px; }
}

/* ------------------------------------------------------------------
   Timeline
   ------------------------------------------------------------------ */
.timeline { list-style: none; max-width: 60rem; position: relative; }
.job {
  display: grid;
  grid-template-columns: minmax(8.5rem, 11rem) minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding: 1.5rem 0 1.75rem;
  position: relative;
}
/* rail */
.job::before {
  content: "";
  position: absolute; left: calc(11rem + 1rem - 1px); top: 0; bottom: 0;
  width: 1px; background: var(--rule);
  transform: scaleY(0); transform-origin: top center;
  transition: transform 700ms cubic-bezier(.2,.7,.2,1);
}
.job.in-view::before { transform: none; }
.job-main, .job-when { opacity: 0; transform: translateY(10px); transition: opacity 500ms ease 200ms, transform 500ms cubic-bezier(.2,.7,.2,1) 200ms; }
.job.in-view .job-main, .job.in-view .job-when { opacity: 1; transform: none; }
.job::after {
  content: "";
  position: absolute; left: calc(11rem + 1rem - 5px); top: 2.05rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink);
}
.job::after { transition: background 250ms ease, border-color 250ms ease, transform 250ms ease; }
.job.open::after { background: var(--hot); border-color: var(--hot); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--hot-soft); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.job-toggle:hover .job-company { color: var(--signal); }
.job-company { transition: color 200ms ease; }
.job:first-child::before { top: 1.6rem; }
.job:last-child::before { bottom: auto; height: 2rem; }

.job-when { color: var(--ink-soft); padding-top: 0.35rem; white-space: nowrap; }
/* every entry is a glass card; the open one is picked out by a gradient edge */
.job-main {
  min-width: 0;
  padding: 1.1rem 1.35rem 1.25rem; margin: -1rem -1.25rem;
  border-radius: 18px; border: 1px solid var(--rule);
  background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: background 300ms ease, border-color 300ms ease, box-shadow 400ms ease, transform 300ms cubic-bezier(.2,.7,.2,1);
}
.job:not(.open):hover .job-main {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--signal) 45%, var(--rule));
  box-shadow: var(--shadow-hover);
}
.job.open .job-main {
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(135deg, var(--signal), var(--hot)) border-box;
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}
.job-toggle {
  all: unset;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "company chev" "title chev";
  column-gap: 1rem;
  width: 100%;
  cursor: pointer;
  padding: 0.15rem 0;
}
.job-toggle:focus-visible { outline: 2px solid var(--hot); outline-offset: 4px; }
.job-company {
  grid-area: company;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.45rem; line-height: 1.15; letter-spacing: -0.01em;
  display: block;
}
p.job-company { margin: 0; }
.job-title { grid-area: title; color: var(--ink-soft); }
.chev {
  grid-area: chev; align-self: center;
  width: 0.7rem; height: 0.7rem;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 220ms ease;
  margin-right: 0.3rem;
}
.job.open .chev { transform: rotate(-135deg); }
.job-summary { margin-top: 0.7rem; max-width: 62ch; text-wrap: pretty; }
/* expand/collapse: the grid row animates between 0fr and 1fr */
.job-detail {
  display: grid; grid-template-rows: 0fr;
  max-width: 62ch;
  visibility: hidden;
  transition: grid-template-rows 420ms cubic-bezier(.2,.7,.2,1), visibility 0s linear 420ms, margin-top 420ms ease;
  margin-top: 0;
}
.job-detail > .job-detail-inner { overflow: hidden; min-height: 0; }
.job.open .job-detail { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; margin-top: 1rem; }
.job-detail h4 {
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  color: var(--ink); margin: 1rem 0 0.4rem;
}
.job-detail ul { list-style: none; }
.job-detail li {
  position: relative; padding-left: 1.2rem; color: var(--ink-soft);
  margin-bottom: 0.45rem; text-wrap: pretty;
}
.job-detail li::before {
  content: ""; position: absolute; left: 0; top: 0.72em;
  width: 0.5rem; height: 1px; background: var(--hot);
}


@media (max-width: 720px) {
  .job { grid-template-columns: 1fr; gap: 0.2rem; padding-left: 1.5rem; }
  .job::before { left: 4px; }
  .job::after { left: 0; top: 1.75rem; }
  .job-when { padding-top: 0; }
}

/* ------------------------------------------------------------------
   Education and honors
   ------------------------------------------------------------------ */
.creds {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
  max-width: 60rem;
}
.cred {
  position: relative; overflow: hidden;
  padding: 1.5rem 1.6rem 1.6rem;
  border: 1px solid var(--rule); border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(.2,.7,.2,1),
              border-color 300ms ease, box-shadow 400ms ease;
}
.cred::before {
  content: ""; position: absolute; inset: -40% auto auto -20%; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, var(--signal-soft), transparent 70%);
  pointer-events: none;
}
.creds.in-view .cred { opacity: 1; transform: none; }
.creds.in-view .cred:nth-child(2) { transition-delay: 80ms; }
.cred:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--signal) 45%, var(--rule));
  box-shadow: var(--shadow-hover);
}
.cred-when { position: relative; color: var(--ink-soft); margin-bottom: 0.6rem; }
.cred h3 {
  position: relative;
  font-size: 1.25rem; line-height: 1.2; margin-bottom: 0.5rem;
}
.cred > p:last-child { position: relative; color: var(--ink-soft); text-wrap: pretty; }

@media (max-width: 720px) {
  .creds { grid-template-columns: 1fr; }
  .cred { padding: 1.3rem 1.25rem 1.4rem; border-radius: 18px; }
}

/* ------------------------------------------------------------------
   Stack
   ------------------------------------------------------------------ */
.stack { margin: 0; max-width: 60rem; }
.stack-row {
  display: grid;
  grid-template-columns: minmax(8.5rem, 16rem) minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.stack-row:last-child { border-bottom: 1px solid var(--rule); }
.stack-row { transition: background 200ms ease; opacity: 0; transform: translateY(8px); }
.stack-row.in-view { opacity: 1; transform: none; transition: background 200ms ease, opacity 500ms ease, transform 500ms cubic-bezier(.2,.7,.2,1); }
.stack-row:hover dt { color: var(--signal); }
.stack dt { font-weight: 600; transition: color 200ms ease; padding-left: 0.5rem; margin-left: -0.5rem; }
.stack dd { margin: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--glass);
  font-size: 0.9rem; color: var(--ink);
  transition: transform 160ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--signal); background: var(--signal-soft);
  box-shadow: 0 8px 20px -12px var(--signal);
}
@media (max-width: 640px) { .stack-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   Contact
   ------------------------------------------------------------------ */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.contact-panel {
  position: relative; overflow: hidden;
  max-width: 64rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 28px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from var(--ang), var(--signal), var(--hot), var(--rule), var(--signal)) border-box;
  box-shadow: var(--shadow);
  animation: spin 9s linear infinite;
}
@keyframes spin { to { --ang: 360deg; } }
.contact-glow {
  position: absolute; right: -10%; top: -40%; width: 55%; aspect-ratio: 1;
  background: radial-gradient(circle, var(--signal-soft), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.contact-panel h2 {
  position: relative;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.025em;
  margin-bottom: 0.9rem;
}
.contact-panel .lede { position: relative; margin-bottom: 1.75rem; }
.contact-actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.contact-list { position: relative; list-style: none; display: grid; gap: 0.6rem; justify-items: start; }
.contact-link {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  font-weight: 500; letter-spacing: 0;
  color: var(--ink); text-decoration: none;
  word-break: break-word;
  border-bottom: 2px solid var(--rule);
  transition: border-color 160ms ease, color 160ms ease;
}
.contact-link { position: relative; display: inline-block; }
.contact-link::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--hot);
  opacity: 0;
}
.contact-link:hover { color: var(--signal); border-color: var(--signal); }
.contact-link:hover::after { animation: run 900ms cubic-bezier(.4,0,.2,1) infinite; }
@keyframes run {
  0%   { left: 0;    opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: calc(100% - 6px); opacity: 0; }
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.foot {
  margin-top: var(--section-gap);
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------
   Motion preferences
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  .bar span { transform: scaleX(1); }
  .orb, .ticker-track, .status-dot, .contact-panel { animation: none !important; }
  .spotlight { display: none; }
  .section-head::before, .job::before { transform: none; }
  .section-head > *, .figure, .cred, .job-main, .job-when, .stack-row, .portrait, .about-text { opacity: 1; transform: none; }
  .job.open::after { animation: none; }
}

/* no-JS fallback: nothing waits for an observer */
.no-js .section-head::before, .no-js .job::before { transform: none; }
.no-js .section-head > *, .no-js .figure, .no-js .cred, .no-js .job-main, .no-js .job-when, .no-js .stack-row, .no-js .portrait, .no-js .about-text { opacity: 1; transform: none; }
