/* =========================================================================
   Liyu Cao — homepage
   Editorial / Anthropic idiom: cream canvas · Fraunces serif · coral accent
   ========================================================================= */

:root {
  /* palette (claude brand tokens) */
  --primary:        #cc785c;
  --primary-active: #a9583e;
  --primary-ink:    #9e5238;   /* coral for small text: 5.4:1 on canvas */
  --primary-fill:   #9e5238;   /* coral behind light text: 5.4:1 with cream */
  --primary-fill-hover: #8a4630;
  --ink:            #141413;
  --body:           #3d3d3a;
  --body-strong:    #252523;
  --muted:          #65635d;
  --muted-soft:     #8e8b82;
  --hairline:       #e6dfd8;
  --hairline-soft:  #ebe6df;
  --canvas:         #faf9f5;
  --surface-soft:   #f5f0e8;
  --surface-card:   #efe9de;
  --surface-strong: #e8e0d2;
  --dark:           #181715;
  --dark-elev:      #252320;
  --dark-soft:      #1f1e1b;
  --on-dark:        #faf9f5;
  --on-dark-soft:   #a09d96;
  --teal:           #5db8a6;
  --amber:          #e8a55a;

  /* type */
  --serif: "Fraunces", "Copernicus", "Tiempos Headline", Georgia, serif;
  --sans:  "Inter", "StyreneB", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --easing: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --page:   min(1200px, 92vw);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  color: var(--body);
  background: var(--canvas);
  line-height: 1.55;
  overflow-x: hidden;
}

::selection { background: rgba(204,120,92,0.22); color: var(--ink); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------------------------------------------------- ambient layers */
/* canvas spike-field lives behind everything */
#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* film grain */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-3%, 4%); }
  80% { transform: translate(5%, 2%); }
}

/* cursor glow + dot */
.cursor-glow, .cursor-dot {
  position: fixed; top: 0; left: 0;
  z-index: 60; pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-glow {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(204,120,92,0.14), transparent 62%);
  transition: opacity .4s;
}
.cursor-dot {
  display: none;
  width: 9px; height: 9px;
  background: var(--primary);
  mix-blend-mode: multiply;
  transition: width .25s var(--easing), height .25s var(--easing), background .25s;
}
.cursor-dot.grow { width: 46px; height: 46px; background: rgba(204,120,92,0.25); }
@media (hover: none), (pointer: coarse) { .cursor-glow, .cursor-dot { display: none; } }

/* content sits above ambient layers */
.shell { position: relative; z-index: 2; }

/* ------------------------------------------------------------- spike mark */
.spike {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.12em;
  color: var(--ink);
}
.spike svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px calc((100vw - var(--page)) / 2);
  transition: padding .4s var(--easing), background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-top: 12px; padding-bottom: 12px;
  background: rgba(250,249,245,0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 20px; letter-spacing: -0.4px; color: var(--ink);
}
.brand .spike { width: 18px; height: 18px; }
.brand .mark { width: 24px; height: 24px; flex: none; }   /* the cone mark — assets/brand/mark.svg */
.brand .spike svg { animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  position: relative;
  font-size: 14px; font-weight: 500; color: var(--body-strong);
  padding: 8px 14px; border-radius: 8px;
  transition: color .25s, background .25s;
}
.nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 1.5px; background: var(--primary);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--easing);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-cta {
  font-size: 14px; font-weight: 500;
  color: var(--on-dark); background: var(--ink);
  padding: 9px 18px; border-radius: 9999px;
  transition: transform .3s var(--easing), background .3s;
}
.nav-cta:hover { background: var(--primary-fill); }

.nav-toggle { display: none; }

/* -------------------------------------------------------- shared layout */
section { position: relative; }
.wrap { width: var(--page); margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--primary);
}

/* reveal-on-scroll base — only hide when JS is active (no-JS shows everything) */
.js [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s var(--easing), transform .9s var(--easing);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ hero */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 150px 0 90px;
}
.hero .wrap { max-width: 1000px; }

.hero-eyebrow { margin-bottom: 30px; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 8vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero h1 .em {
  font-style: italic;
  color: var(--primary);
}
/* word-by-word mask reveal (only masked when JS is active) */
.hero h1 .word { display: inline-block; overflow: hidden; vertical-align: top; }
.js .hero h1 .word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1s var(--easing);
  transition-delay: var(--wd, 0ms);
}
.js .hero.ready h1 .word > span { transform: none; }

.hero-sub {
  margin-top: 34px; max-width: 560px;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  color: var(--body); line-height: 1.6;
}
.hero-sub strong { color: var(--body-strong); font-weight: 600; }

.hero-actions {
  margin-top: 42px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}

.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500;
  padding: 14px 26px; border-radius: 9999px;
  transition: transform .3s var(--easing), background .3s, color .3s, box-shadow .3s;
  will-change: transform;
}
.btn-primary {
  background: var(--primary-fill); color: var(--on-dark);
  box-shadow: 0 8px 24px -12px rgba(204,120,92,0.7);
}
.btn-primary:hover { background: var(--primary-fill-hover); box-shadow: 0 14px 34px -12px rgba(204,120,92,0.85); }
.btn-primary .arrow { transition: transform .3s var(--easing); }
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  color: var(--ink); border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.4);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(255,255,255,0.8); }

/* scroll cue */
.hero { position: relative; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue .rail {
  width: 1px; height: 44px;
  background: linear-gradient(var(--muted-soft), transparent);
  position: relative; overflow: hidden;
}
.scroll-cue .rail::after {
  content: ""; position: absolute; top: -50%; left: 0; width: 1px; height: 50%;
  background: var(--primary);
  animation: drop 2s var(--easing) infinite;
}
@keyframes drop { 0% { top: -50%; } 70%,100% { top: 100%; } }

/* --------------------------------------------------------------- marquee */
.marquee {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 26px 0;
  overflow: hidden;
  background: var(--surface-soft);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; align-items: center; gap: 54px;
  width: max-content;
  animation: slide 34s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--serif); font-size: 1.45rem; color: var(--body-strong);
  white-space: nowrap;
}
.marquee-item .spike { width: 13px; height: 13px; color: var(--primary); }
@keyframes slide { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------- sections */
.section { padding: 120px 0; }
.section-head { max-width: 640px; margin-bottom: 64px; }
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08;
  letter-spacing: -0.02em; color: var(--ink);
  margin-top: 20px;
}
.section-head p { margin-top: 20px; font-size: 1.1rem; color: var(--body); }

/* work grid */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 18px;
  padding: 34px;
  overflow: hidden;
  transition: transform .5s var(--easing), box-shadow .5s var(--easing), border-color .5s;
  transform-style: preserve-3d;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(360px circle at var(--mx,50%) var(--my,0%), rgba(204,120,92,0.10), transparent 60%);
  opacity: 0; transition: opacity .5s;
}
.card:hover { box-shadow: 0 30px 60px -34px rgba(20,20,19,0.45); border-color: var(--hairline); }
.card:hover::before { opacity: 1; }

.card.span-7 { grid-column: span 7; }
.card.span-5 { grid-column: span 5; }
.card.span-6 { grid-column: span 6; }
.card.span-4 { grid-column: span 4; }

.card .tag {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--primary-ink); margin-bottom: 20px;
}
.card h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.7rem; line-height: 1.12; color: var(--ink);
  letter-spacing: -0.01em;
}
.card p { margin-top: 14px; color: var(--body); font-size: 0.98rem; }
.card .meta {
  margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--hairline); border-radius: 9999px; padding: 4px 11px;
}
.card .go {
  position: absolute; top: 30px; right: 30px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  color: var(--ink); background: var(--canvas);
  transition: transform .4s var(--easing), background .4s, color .4s;
}
.card:hover .go { transform: rotate(-45deg); background: var(--primary); color: var(--on-dark); border-color: var(--primary); }

/* dark feature card variant (product surface) */
/* dark surfaces keep the bright coral for text, in either theme */
.card.dark, .widget.dark, .walk-figure, .essay-feature { --primary-ink: var(--primary); }
.card.dark {
  background: var(--dark); border-color: var(--dark-elev); color: var(--on-dark-soft);
}
.card.dark h3 { color: var(--on-dark); }
.card.dark p { color: var(--on-dark-soft); }
.card.dark .chip { border-color: rgba(255,255,255,0.14); color: var(--on-dark-soft); }
.card.dark .go { background: var(--dark-elev); border-color: rgba(255,255,255,0.14); color: var(--on-dark); }
.card.dark::before { background: radial-gradient(360px circle at var(--mx,50%) var(--my,0%), rgba(204,120,92,0.20), transparent 60%); }

/* mini code window inside dark card */
.code-win { margin-top: 24px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.code-win .dots { display: flex; gap: 6px; margin-bottom: 16px; }
.code-win .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--dark-elev); }
.code-win .dots i:nth-child(1){ background:#c96442; } .code-win .dots i:nth-child(2){ background:#c9a642; } .code-win .dots i:nth-child(3){ background:#5db872; }
.code-win .ln { white-space: pre; }
.code-win .k { color: #cc9b7a; } .code-win .s { color: var(--teal); } .code-win .c { color: var(--muted-soft); } .code-win .f { color: var(--amber); }

/* -------------------------------------------------------------- stats */
.stats-band {
  background: var(--dark); color: var(--on-dark);
  border-radius: 26px; padding: 68px 56px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px;
  position: relative; overflow: hidden;
}
.stats-band::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px circle at 12% -20%, rgba(204,120,92,0.22), transparent 55%);
  pointer-events: none;
}
.stat { position: relative; z-index: 1; }
.stat .num {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; color: var(--on-dark);
  letter-spacing: -0.02em;
}
.stat .num .suffix { color: var(--primary); }
.stat .lbl { margin-top: 12px; font-size: 0.9rem; color: var(--on-dark-soft); line-height: 1.5; }

/* -------------------------------------------------------------- about */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; align-items: start; }
.about-lead {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.3;
  color: var(--ink); letter-spacing: -0.01em;
}
.about-lead .em { font-style: italic; color: var(--primary); }
.about-body p { color: var(--body); font-size: 1.05rem; margin-bottom: 20px; }
.about-body p:last-child { margin-bottom: 0; }

.rail-list { margin-top: 8px; border-top: 1px solid var(--hairline); }
.rail-item {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: baseline;
  padding: 22px 4px; border-bottom: 1px solid var(--hairline);
  transition: padding-left .4s var(--easing), background .4s;
}
.rail-item:hover { padding-left: 16px; background: var(--surface-soft); }
.rail-item .yr { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.rail-item .role { color: var(--ink); font-weight: 500; }
.rail-item .role span { display: block; color: var(--muted); font-weight: 400; font-size: 0.92rem; margin-top: 3px; }
.rail-item .place { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* -------------------------------------------------------------- writing */
.notes { display: grid; gap: 2px; border-top: 1px solid var(--hairline); }
.note {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 26px; align-items: center;
  padding: 30px 12px; border-bottom: 1px solid var(--hairline);
  transition: background .4s, padding-left .4s var(--easing);
}
.note:hover { background: var(--surface-soft); padding-left: 26px; }
.note .date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.note h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.4rem; color: var(--ink);
  letter-spacing: -0.01em; transition: color .3s;
}
.note:hover h3 { color: var(--primary); }
.note .arrow-s { color: var(--muted-soft); transition: transform .35s var(--easing), color .3s; }
.note:hover .arrow-s { transform: translate(4px,-4px); color: var(--primary); }

/* -------------------------------------------------------------- CTA */
.cta-band {
  background: var(--primary-fill); color: var(--on-dark);
  border-radius: 28px; padding: clamp(48px, 7vw, 96px);
  text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px circle at 80% 120%, rgba(255,255,255,0.18), transparent 55%);
}
.cta-band h2 {
  position: relative; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.06; letter-spacing: -0.02em;
}
.cta-band p { position: relative; margin: 22px auto 0; max-width: 460px; color: rgba(255,255,255,0.92); }
.cta-band .btn {
  position: relative; margin-top: 40px;
  background: var(--ink); color: var(--on-dark);
}
.cta-band .btn:hover { background: #000; }

/* -------------------------------------------------------------- footer */
.footer {
  background: var(--dark); color: var(--on-dark-soft);
  margin-top: 120px; padding: 84px 0 40px;
}
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
.footer .brand { color: var(--on-dark); margin-bottom: 20px; }
.footer .brand .spike { color: var(--on-dark); }
.footer .brand .mark { color: var(--on-dark); }
.footer-blurb { max-width: 300px; font-size: 0.95rem; line-height: 1.6; }
.footer h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted-soft); margin-bottom: 20px; font-weight: 500;
}
.footer-col a { display: block; padding: 7px 0; color: var(--on-dark); font-size: 0.98rem; transition: color .25s, transform .25s; width: fit-content; }
.footer-col a:hover { color: var(--primary); transform: translateX(4px); }
.footer-base {
  width: var(--page); margin: 60px auto 0; padding-top: 28px;
  border-top: 1px solid var(--dark-elev);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted-soft);
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .card.span-7, .card.span-5, .card.span-6, .card.span-4 { grid-column: span 12; }
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; padding: 48px 34px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
  .note { grid-template-columns: 1fr auto; }
  .note .date { display: none; }
  .rail-item { grid-template-columns: 64px 1fr; }
  .rail-item .place { display: none; }
}
@media (max-width: 560px) {
  .section { padding: 84px 0; }
  .footer .wrap { grid-template-columns: 1fr; gap: 34px; }
  .footer-base { flex-direction: column; gap: 12px; text-align: center; }
  .hero-actions { width: 100%; }
  .btn { flex: 1; justify-content: center; }
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .hero h1 .word > span { transform: none; }
  html { scroll-behavior: auto; }
}

/* Research content uses the site's existing palette, typography and motion. */
.research-hero .hero-sub { max-width: 660px; }
.research-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.research-tile {
  display: flex; flex-direction: column; min-height: 300px; padding: 30px;
  border: 1px solid var(--hairline); border-radius: 16px;
  background: var(--surface-soft); color: var(--body);
  transition: transform .3s var(--easing), border-color .3s var(--easing);
}
a.research-tile:hover { transform: translateY(-4px); border-color: var(--primary); }
.tile-index, .project-meta, .research-boundary {
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
}
.tile-index { color: var(--primary-ink); text-transform: uppercase; }
.research-tile h3 { margin: 32px 0 12px; font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 400; line-height: 1.15; color: var(--ink); }
.research-tile p { line-height: 1.65; }
.tile-link { margin-top: auto; padding-top: 24px; font-size: 13px; color: var(--primary-ink); }
.method-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; padding: clamp(30px, 5vw, 64px); background: var(--dark); color: var(--on-dark); border-radius: 20px; }
.method-panel .eyebrow { color: var(--on-dark-soft); }
.method-panel h2 { margin-top: 26px; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.3rem); font-weight: 400; line-height: 1.1; }
.method-panel p { margin: 22px 0; color: var(--on-dark-soft); line-height: 1.7; }
.method-steps { list-style: none; border-top: 1px solid rgba(255,255,255,.16); }
.method-steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.method-steps li span { grid-row: span 2; font: 11px var(--mono); color: var(--primary); padding-top: 4px; }
.method-steps li strong { font-weight: 500; }
.method-steps li small { color: var(--on-dark-soft); line-height: 1.5; }
.text-link, .card-link, .inline-link { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 4px; }
.method-panel .text-link, .card.dark .card-link { color: var(--primary); }
.card-link { display: inline-block; margin-top: 24px; font-size: 14px; position: relative; }
.research-stack, .project-list, .notes-stack { border-top: 1px solid var(--hairline); }
/* grid children must be allowed to shrink, or the 720px swipeable figure blows the row out on phones */
.research-entry > div, .project-entry > div { min-width: 0; }
.research-entry, .project-entry { display: grid; grid-template-columns: minmax(190px, .45fr) 1fr; gap: clamp(22px, 5vw, 80px); padding: 44px 0; border-bottom: 1px solid var(--hairline); scroll-margin-top: 110px; }
.research-entry h2, .project-entry h2, .note-essay h2 { font-family: var(--serif); font-weight: 400; color: var(--ink); font-size: clamp(1.8rem, 3.3vw, 2.7rem); line-height: 1.15; }
.research-entry p, .project-entry p, .note-essay p { max-width: 70ch; margin-top: 16px; line-height: 1.72; }
.research-entry .research-boundary, .project-entry .research-boundary { color: var(--muted); margin-top: 18px; line-height: 1.6; }
.project-meta { display: flex; flex-direction: column; gap: 8px; color: var(--primary-ink); text-transform: uppercase; }
.project-entry .text-link { display: inline-block; margin-top: 20px; }
.note-essay { padding: 48px 0; border-bottom: 1px solid var(--hairline); scroll-margin-top: 110px; }
.note-essay h2 { margin-top: 16px; }
.note-essay .text-link { display: inline-block; margin-top: 20px; }
@media (max-width: 900px) {
  .research-grid { grid-template-columns: 1fr; }
  .research-tile { min-height: 0; }
  .method-panel { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 660px) {
  .research-entry, .project-entry { grid-template-columns: 1fr; gap: 15px; }
  .project-meta { flex-direction: row; flex-wrap: wrap; gap: 12px; }
}

/* keyboard focus */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* =========================================================================
   MULTI-PAGE ADDITIONS — WebGL, transitions, sub-pages, lab widgets
   ========================================================================= */

/* WebGL hero canvas — behind everything, above nothing */
#webgl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#webgl.hidden { display: none; }

/* page-load / page-exit wipe (GSAP driven) */
.page-wipe {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.page-wipe span { background: var(--primary); transform: scaleY(0); transform-origin: bottom; }
.page-wipe span:nth-child(odd) { background: var(--primary-active); }
.page-wipe.show { pointer-events: all; }

/* active nav link */
.nav-link.active { color: var(--ink); }
.nav-link.active::after { transform: scaleX(1); background: var(--ink); }

/* mobile menu */
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--hairline);
  border-radius: 9999px; background: rgba(255,255,255,0.5); position: relative; cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 11px; width: 20px; height: 1.6px; background: var(--ink);
  transition: transform .35s var(--easing), opacity .25s;
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--canvas);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 0 8vw;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity .4s var(--easing), transform .4s var(--easing), visibility .4s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu a {
  font-family: var(--serif); font-size: clamp(2rem, 9vw, 3.4rem); color: var(--ink);
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: baseline; gap: 16px;
}
.mobile-menu a .idx { font-family: var(--mono); font-size: 13px; color: var(--primary-ink); }

/* -------------------------------------------------------- sub-page hero */
.page-hero { padding: 170px 0 60px; position: relative; }
.crumb {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 26px;
}
.crumb a { color: var(--muted); transition: color .25s; }
.crumb a:hover { color: var(--primary); }
.crumb .sep { color: var(--hairline); }
.page-hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.02; letter-spacing: -0.03em; color: var(--ink);
  max-width: 15ch;
}
.page-hero h1 .em { font-style: italic; color: var(--primary); }
.page-hero .lead {
  margin-top: 26px; max-width: 560px; font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--body);
}

/* -------------------------------------------------------- filter tabs */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.filter {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 1px solid var(--hairline);
  border-radius: 9999px; padding: 8px 16px; cursor: pointer;
  transition: color .3s, background .3s, border-color .3s;
}
.filter:hover { color: var(--ink); border-color: var(--muted-soft); }
.filter.active { color: var(--on-dark); background: var(--ink); border-color: var(--ink); }
.card.is-hidden { display: none; }

/* -------------------------------------------- approach / scroll-draw SVG */
.approach { position: relative; padding: 120px 0; overflow: hidden; }
.approach .wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; align-items: center; }
.approach h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1; letter-spacing: -0.02em; color: var(--ink);
}
.approach p { margin-top: 20px; color: var(--body); font-size: 1.08rem; max-width: 42ch; }
.walk-figure {
  background: var(--dark); border-radius: 22px; padding: 30px; position: relative; overflow: hidden;
}
.walk-figure .cap {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--on-dark-soft); margin-bottom: 6px;
}
.walk-figure .cap b { color: var(--primary-ink); }
.walk-figure svg { width: 100%; height: auto; display: block; }
.walk-path { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.walk-axis { stroke: rgba(255,255,255,0.12); stroke-width: 1; }
.walk-band { fill: rgba(204,120,92,0.08); }

/* -------------------------------------------------------- LAB widgets */
.lab-grid { display: grid; gap: 30px; }
.widget {
  background: var(--surface-card); border: 1px solid var(--hairline-soft);
  border-radius: 22px; padding: 30px; position: relative; overflow: hidden;
}
.widget.dark { background: var(--dark); border-color: var(--dark-elev); }
.widget-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.widget-head .eyebrow { color: var(--primary-ink); }
.widget.dark .widget-head .eyebrow { color: var(--primary); }
.widget h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em;
  color: var(--ink); margin-top: 10px;
}
.widget.dark h3 { color: var(--on-dark); }
.widget .desc { font-size: 0.95rem; color: var(--body); max-width: 46ch; }
.widget.dark .desc { color: var(--on-dark-soft); }

.widget-stage { position: relative; border-radius: 14px; overflow: hidden; background: var(--canvas); }
.widget.dark .widget-stage { background: var(--dark-soft); }
.widget-stage canvas { display: block; width: 100%; height: auto; }

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.ctrl {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px;
  color: var(--ink); background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: 9999px; padding: 10px 18px; cursor: pointer;
  transition: transform .25s var(--spring), background .25s, color .25s, border-color .25s;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ctrl:hover { transform: translateY(-2px); border-color: var(--muted-soft); }
.ctrl:active { transform: translateY(0) scale(0.96); }
.ctrl.primary { background: var(--primary-fill); color: var(--on-dark); border-color: var(--primary-fill); }
.ctrl.primary:hover { background: var(--primary-fill-hover); border-color: var(--primary-fill-hover); }
.widget.dark .ctrl { background: var(--dark-elev); color: var(--on-dark); border-color: rgba(255,255,255,0.14); }
.widget.dark .ctrl.primary { background: var(--primary-fill); border-color: var(--primary-fill); }

.readout { display: flex; gap: 26px; flex-wrap: wrap; margin-left: auto; }
.readout .k { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.widget.dark .readout .k { color: var(--on-dark-soft); }
.readout .v { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); line-height: 1; }
.widget.dark .readout .v { color: var(--on-dark); }
.readout .v .accent { color: var(--primary-ink); }

/* game canvas (Pong) */
.widget-stage canvas.game { cursor: crosshair; touch-action: none; outline: none; }
.widget-stage:has(canvas.game:focus-visible) { box-shadow: 0 0 0 2px var(--primary); }
.ctrl.toggle::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 8px; vertical-align: 1px; background: currentColor; opacity: 0.3;
  transition: opacity .2s, background-color .2s;
}
.ctrl.toggle[aria-pressed="true"]::before { opacity: 1; background: var(--teal); }

/* slider */
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row label { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.widget.dark .slider-row label { color: var(--on-dark-soft); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 2px; width: 140px;
  background: var(--hairline); border-radius: 2px; outline-offset: 6px;
}
.widget.dark input[type="range"] { background: rgba(255,255,255,0.18); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: 3px solid var(--canvas);
  transition: transform .2s;
}
.widget.dark input[type="range"]::-webkit-slider-thumb { border-color: var(--dark-soft); }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; border: 3px solid var(--canvas);
}

/* -------------------------------------------------------- prev/next pager */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-top: 1px solid var(--hairline); margin-top: 30px; padding-top: 40px;
}
.pager a {
  display: flex; flex-direction: column; gap: 8px; padding: 26px;
  border: 1px solid var(--hairline-soft); border-radius: 16px; background: var(--surface-soft);
  transition: transform .4s var(--easing), border-color .4s, background .4s;
}
.pager a:hover { transform: translateY(-3px); border-color: var(--hairline); background: var(--surface-card); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .dir { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.pager .ttl { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); }

/* -------------------------------------------------- writing / essays */
.essay-feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
  background: var(--dark); color: var(--on-dark); border-radius: 24px; padding: 48px;
  margin-bottom: 60px; position: relative; overflow: hidden;
}
.essay-feature::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px circle at 90% -10%, rgba(204,120,92,0.22), transparent 55%); pointer-events: none;
}
.essay-feature .body { position: relative; z-index: 1; }
.essay-feature .tag { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--primary-ink); }
.essay-feature h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem,3vw,2.6rem); line-height: 1.1; margin-top: 16px; letter-spacing: -0.01em; }
.essay-feature p { color: var(--on-dark-soft); margin-top: 18px; max-width: 48ch; }
.essay-feature .btn { margin-top: 26px; background: var(--primary-fill); color: var(--on-dark); }
.essay-feature .glyph { position: relative; z-index: 1; display: grid; place-items: center; }
.essay-feature .glyph svg { width: 60%; height: auto; opacity: 0.9; }
.note .rt { font-family: var(--mono); font-size: 11px; color: var(--muted-soft); }

/* -------------------------------------------------- "currently" list */
.currently { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.now-card { background: var(--surface-soft); border: 1px solid var(--hairline-soft); border-radius: 16px; padding: 26px; transition: transform .4s var(--easing); }
.now-card:hover { transform: translateY(-4px); }
.now-card .k { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--primary-ink); }
.now-card .v { margin-top: 12px; color: var(--ink); font-size: 1.02rem; line-height: 1.5; }

/* -------------------------------------------------- responsive add-ons */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .approach .wrap { grid-template-columns: 1fr; gap: 40px; }
  .essay-feature { grid-template-columns: 1fr; padding: 34px; }
  .essay-feature .glyph { display: none; }
  .currently { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .readout { width: 100%; margin-left: 0; }
  .mc-layout { grid-template-columns: 1fr !important; }
}

/* -------------------------------------------------- reduced motion add-ons */
@media (prefers-reduced-motion: reduce) {
  .page-wipe { display: none !important; }
  .walk-path { stroke-dashoffset: 0 !important; }
}

/* =========================================================================
   FEATURE PACK 2 — dark mode, ⌘K palette, calibration, copy, easter egg,
   antilibrary + now feed
   ========================================================================= */

/* -------------------------------------------------------- dark theme */
:root { color-scheme: light; }
[data-theme="dark"] {
  color-scheme: dark;
  --ink:            #f3efe5;
  --body:           #c8c3b8;
  --body-strong:    #eae5da;
  --muted:          #928d80;
  --muted-soft:     #908a7d;
  --primary-ink:    #cc785c;
  --hairline:       rgba(243,239,229,0.13);
  --hairline-soft:  rgba(243,239,229,0.07);
  --canvas:         #14130f;
  --surface-soft:   #1b1a13;
  --surface-card:   #211e16;
  --surface-strong: #29251a;
  --dark:           #211e16;
  --dark-elev:      #2c281c;
  --dark-soft:      #1a1710;
  --on-dark:        #f3efe5;
  --on-dark-soft:   #9a9488;
}
/* smooth cross-fade during a toggle */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .28s var(--ease-out), color .28s var(--ease-out), border-color .28s var(--ease-out), fill .28s var(--ease-out), stroke .28s var(--ease-out) !important;
}
/* dark-mode fixups for hardcoded / inverted surfaces */
[data-theme="dark"] .nav.scrolled { background: rgba(20,19,15,0.72); }
[data-theme="dark"] .nav-cta { color: var(--canvas); }
[data-theme="dark"] .nav-cta:hover { color: var(--on-dark); }
[data-theme="dark"] .btn-ghost { background: rgba(243,239,229,0.05); border-color: var(--hairline); color: var(--ink); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(243,239,229,0.1); border-color: var(--muted-soft); }
[data-theme="dark"] .cta-band .btn { background: #14130f; color: #f3efe5; }
[data-theme="dark"] .cta-band .btn:hover { background: #000; }
[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.04; }
[data-theme="dark"] .cursor-dot { mix-blend-mode: screen; }
[data-theme="dark"] .btn-ghost.btn { background: rgba(243,239,229,0.05); }

/* nav icon buttons (theme toggle + ⌘K) — injected by JS */
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9999px; border: 1px solid var(--hairline);
  background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer;
  transition: transform .3s var(--easing), background .3s, border-color .3s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--muted-soft); background: var(--surface-soft); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .sun { display: none; } .icon-btn .moon { display: block; }
[data-theme="dark"] .icon-btn .sun { display: block; } [data-theme="dark"] .icon-btn .moon { display: none; }
.kbd-btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px;
  color: var(--muted); border: 1px solid var(--hairline); border-radius: 9999px; padding: 8px 12px;
  background: transparent; cursor: pointer; transition: color .25s, border-color .25s;
}
.kbd-btn:hover { color: var(--ink); border-color: var(--muted-soft); }
.kbd-btn kbd { font-family: var(--mono); background: var(--surface-card); border: 1px solid var(--hairline); border-radius: 4px; padding: 1px 5px; font-size: 11px; color: var(--body-strong); }
@media (max-width: 1080px) { .kbd-btn .kbd-label { display: none; } }
@media (max-width: 900px) { .kbd-btn { display: none; } }

/* -------------------------------------------------------- ⌘K palette */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,14,11,0.42); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: flex-start; justify-content: center; padding: 14vh 20px 20px;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.cmdk-backdrop.open { opacity: 1; visibility: visible; }
.cmdk {
  width: min(560px, 100%); background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: 16px; overflow: hidden; box-shadow: 0 40px 90px -24px rgba(0,0,0,0.55);
  transform: translateY(-12px) scale(0.985); transition: transform .28s var(--easing);
}
.cmdk-backdrop.open .cmdk { transform: none; }
.cmdk-input {
  width: 100%; border: 0; background: transparent; padding: 20px 22px; box-sizing: border-box;
  font-family: var(--sans); font-size: 1.05rem; color: var(--ink); outline: none;
  border-bottom: 1px solid var(--hairline);
}
.cmdk-input::placeholder { color: var(--muted-soft); }
.cmdk-list { max-height: min(48vh, 360px); overflow-y: auto; padding: 8px; }
.cmdk-group { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-soft); padding: 12px 14px 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; cursor: pointer;
  color: var(--body-strong);
}
.cmdk-item .ico { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); flex: none; }
.cmdk-item .ico svg { width: 16px; height: 16px; }
.cmdk-item .lbl { flex: 1; font-size: 0.96rem; }
.cmdk-item .hint { font-family: var(--mono); font-size: 11px; color: var(--muted-soft); }
.cmdk-item.sel, .cmdk-item:hover { background: var(--surface-soft); color: var(--ink); }
.cmdk-item.sel .ico, .cmdk-item:hover .ico { color: var(--primary); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.cmdk-foot { display: flex; gap: 18px; padding: 11px 18px; border-top: 1px solid var(--hairline); font-family: var(--mono); font-size: 11px; color: var(--muted-soft); }
.cmdk-foot kbd { background: var(--surface-card); border: 1px solid var(--hairline); border-radius: 3px; padding: 0 5px; }

/* -------------------------------------------------- calibration: CI bars */
.stat .ci { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--on-dark-soft); }
.ci-bar { position: relative; width: 74px; height: 2px; background: rgba(255,255,255,0.16); flex: none; }
.ci-bar::before { content: ""; position: absolute; top: 50%; left: var(--lo, 22%); right: var(--hi, 22%); height: 2px; transform: translateY(-50%); background: var(--primary); }
.ci-bar i { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--on-dark); transform: translate(-50%,-50%); }

/* calibration: epistemic status */
.epi-legend { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.epi { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.epi-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.epi-dot.validated,  .epi.validated  .epi-dot { background: var(--teal); }   .epi.validated  { color: var(--teal); }
.epi-dot.working,    .epi.working    .epi-dot { background: var(--amber); }  .epi.working    { color: var(--amber); }
.epi-dot.speculative,.epi.speculative .epi-dot { background: var(--primary); } .epi.speculative { color: var(--primary-ink); }
.epi-dot.dead,       .epi.dead       .epi-dot { background: var(--muted-soft); } .epi.dead { color: var(--muted-soft); }
.note h3 .epi-dot { margin-right: 14px; vertical-align: middle; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }

/* -------------------------------------------------- copy toast */
.copied-toast {
  position: fixed; bottom: 30px; left: 50%; z-index: 120;
  transform: translateX(-50%) translateY(22px); background: var(--ink); color: var(--canvas);
  font-family: var(--mono); font-size: 13px; padding: 12px 22px; border-radius: 9999px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--easing);
}
.copied-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* easter-egg rain canvas */
#egg-rain { position: fixed; inset: 0; z-index: 110; pointer-events: none; opacity: 0; transition: opacity .5s; }
#egg-rain.on { opacity: 1; }

/* -------------------------------------------------- antilibrary shelf */
.shelf { border-top: 1px solid var(--hairline); }
.book {
  display: grid; grid-template-columns: 1fr auto; gap: 20px 30px; align-items: baseline;
  padding: 24px 8px; border-bottom: 1px solid var(--hairline);
  transition: padding-left .4s var(--easing), background .4s;
}
.book:hover { padding-left: 18px; background: var(--surface-soft); }
.book .bk { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); letter-spacing: -0.01em; }
.book .bk .by { display: block; font-family: var(--sans); font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.book .why { color: var(--body); font-size: 0.95rem; max-width: 40ch; }
.book .st { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-soft); white-space: nowrap; }
@media (max-width: 720px) { .book { grid-template-columns: 1fr; gap: 8px; } .book .why { max-width: none; } }

/* -------------------------------------------------- scrollytelling */
.scrolly { position: relative; }
.scrolly-pin { min-height: 100vh; display: flex; align-items: center; }
.scrolly-inner { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center; }
.scrolly-text .stage-num { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--muted); margin: 20px 0 14px; }
.scrolly-text .stage-num span { color: var(--primary-ink); }
.scrolly-text h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.06; letter-spacing: -0.02em; color: var(--ink); }
.scrolly-text p { margin-top: 16px; color: var(--body); font-size: 1.06rem; max-width: 38ch; min-height: 3.4em; }
.sc-sharpe { margin-top: 28px; font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; gap: 14px; }
.sc-sharpe span { font-family: var(--serif); font-size: 2.6rem; color: var(--primary); letter-spacing: -0.02em; }
.scrolly-chart { background: var(--dark); border-radius: 22px; padding: 26px 26px 22px; }
.sc-cap { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--on-dark-soft); margin-bottom: 14px; }
.scrolly-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.sc-line { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.sc-area { fill: rgba(204,120,92,0.12); stroke: none; }
.sc-axis { stroke: rgba(255,255,255,0.12); stroke-width: 1; }
.sc-progress { margin-top: 18px; height: 2px; background: rgba(255,255,255,0.14); position: relative; }
.sc-progress i { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--primary); }
.scrolly-text .text-link { display: inline-block; margin-top: 24px; }
.scrolly-gates { display: grid; gap: 10px; }
.gate-card {
  display: grid; grid-template-columns: 110px 1fr; column-gap: 18px;
  padding: 16px 18px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; background: var(--dark-soft);
  transition: border-color .2s var(--easing), background-color .2s var(--easing);
}
.gate-card.active { border-color: var(--primary); background: var(--dark-elev); }
.gate-card span { grid-row: span 2; font-family: var(--mono); font-size: 11px; color: var(--primary); letter-spacing: .05em; align-self: center; }
.gate-card strong { color: var(--on-dark); font-weight: 500; }
.gate-card small { color: var(--on-dark-soft); line-height: 1.4; }
@media (max-width: 900px) {
  .scrolly-inner { grid-template-columns: 1fr; gap: 34px; }
  .scrolly-pin { min-height: auto; padding: 80px 0; }
  .scrolly-text p { min-height: 0; }
  .gate-card { border-color: rgba(255,255,255,.22); }
}
@media (max-width: 560px) {
  .gate-card { grid-template-columns: 1fr; gap: 5px; }
  .gate-card span { grid-row: auto; }
}

/* Figures and project case pages keep the existing paper/card language. */
.figure-frame { margin: 28px 0; border: 1px solid var(--hairline); border-radius: 20px; overflow: hidden; background: var(--surface-soft); }
.figure-frame img { display: block; width: 100%; height: auto; }
.figure-frame figcaption { border-top: 1px solid var(--hairline); padding: 14px 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.figure-frame figcaption a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }
.feature-figure { max-width: 1034px; margin: 0 auto; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case-panel { background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: 16px; padding: clamp(26px, 4vw, 40px); }
.case-panel h2 { margin-top: 24px; font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.15; color: var(--ink); }
.case-panel p { max-width: 62ch; margin-top: 16px; line-height: 1.7; }
.case-back { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 38px; }
@media (max-width: 760px) { .case-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .figure-frame { overflow-x: auto; }
  .figure-frame img { width: 720px; max-width: none; }
  .figure-frame figcaption::before { content: "Swipe the figure to read it. "; color: var(--primary-ink); }
}

/* -------------------------------------------------- now feed */
.nowfeed { list-style: none; border-left: 1px solid var(--hairline); margin: 10px 0 0 6px; }
.nowfeed li { position: relative; padding: 0 0 34px 34px; }
.nowfeed li:last-child { padding-bottom: 0; }
.nowfeed li::before {
  content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}
.nowfeed .d { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.nowfeed .x { color: var(--body); margin-top: 7px; font-size: 1.02rem; line-height: 1.5; }
.nowfeed .x b { color: var(--ink); font-weight: 600; }
