/* Jonathan Katzman — personal site
   Ink & ember: deep ink ground, warm paper type, amber signal colour. */

:root {
  --bg: #0b0c0f;
  --bg-rgb: 11, 12, 15;
  --surface: #13151a;
  --surface-2: #1a1d24;
  --line: rgba(236, 231, 220, 0.12);
  --line-strong: rgba(236, 231, 220, 0.28);
  --text: #ece7dc;
  --muted: #9b968b;
  --accent: #7da7ff;
  --accent-2: #f08a6c;
  --accent-ink: #06102a;
  --blueprint: #86a8f0;
  --wisdom: #feda77;
  --band: transparent;
  --band-ink: var(--text);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --surface: #fcf8f8;
  --surface-2: #f3eeee;
  --line: rgba(10, 10, 10, 0.14);
  --line-strong: rgba(10, 10, 10, 0.6);
  --text: #0a0a0a;
  --muted: #584048;
  --accent: #3d63b3;
  --accent-2: #e2725b;
  --accent-ink: #ffffff;
  --blueprint: #2a4a9c;
  --wisdom: #a07a12;
  --band: #feda77;
  --band-ink: #0a0a0a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="light"] body::after { mix-blend-mode: multiply; filter: invert(1); opacity: 0.035; }

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.accent { color: var(--accent); }

/* ───────── nav ───────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(rgba(var(--bg-rgb), 0.92), rgba(var(--bg-rgb), 0));
  transition: background 0.3s;
}
.nav.scrolled {
  background: rgba(var(--bg-rgb), 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--display); font-style: italic; font-size: 1rem; font-weight: 500;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand-mark { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: rotate(-12deg); }
.nav-links { display: flex; gap: clamp(12px, 2.4vw, 30px); }
.nav-links a { position: relative; font-size: 0.92rem; color: var(--muted); padding: 6px 0; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.theme-toggle {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--text); cursor: pointer;
  display: grid; place-items: center; transition: border-color 0.2s, transform 0.4s;
}
.theme-toggle:hover { border-color: var(--line-strong); transform: rotate(40deg); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ───────── hero (home) ───────── */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 120px 0 clamp(36px, 6vh, 64px); overflow: hidden; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 80% at 20% 100%, rgba(var(--bg-rgb), 0.92) 0%, rgba(var(--bg-rgb), 0.35) 55%, transparent 80%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero-eyebrow { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: clamp(18px, 3vh, 34px); }
.hero-eyebrow span::before { content: "◆"; color: var(--accent); margin-right: 9px; font-size: 0.6em; vertical-align: 0.15em; }
h1.name {
  margin: 0;
  font-family: var(--display);
  font-weight: 340;
  font-size: clamp(4.3rem, 13.4vw, 12.2rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 144, "SOFT" 60;
}
h1.name .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
h1.name .line > span { display: inline-block; transform: translateY(105%); animation: rise 1.1s cubic-bezier(.16,.9,.2,1) forwards; }
h1.name .line:nth-child(2) > span { animation-delay: 0.12s; font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; color: var(--accent); padding-right: 0.06em; }
@keyframes rise { to { transform: none; } }
.hero-foot { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-top: clamp(26px, 5vh, 54px); }
.lede { margin: 0; max-width: 34em; font-size: clamp(1.08rem, 1.6vw, 1.38rem); line-height: 1.5; text-wrap: pretty; }
.lede em { font-family: var(--display); font-style: italic; font-size: 1.08em; color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 0.92rem; font-weight: 500; white-space: nowrap;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn .arr { transition: transform 0.25s; }
.btn:hover .arr { transform: translateX(4px); }

/* ───────── marquee ───────── */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 20px 0; -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: slide 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 300; padding: 0 26px; white-space: nowrap; }
.marquee-track span:nth-child(even) { color: var(--accent); font-size: 0.9rem; align-self: center; padding: 0; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ───────── sections ───────── */
section { padding: clamp(72px, 11vw, 150px) 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 24px 40px; margin-bottom: clamp(36px, 6vw, 72px); align-items: start; }
.sec-head h2, .page-head h1 { margin: 0; font-family: var(--display); font-weight: 340; letter-spacing: -0.03em; line-height: 1; font-variation-settings: "opsz" 144, "SOFT" 60; text-wrap: balance; }
.sec-head h2 { font-size: clamp(2.2rem, 5.2vw, 4.2rem); }
.sec-head h2 em, .page-head h1 em { font-style: italic; color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.sec-head .mono { padding-top: 0.9em; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 30px 24px 30px 0; border-bottom: 1px solid var(--line); }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-weight: 300; font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat b sup { font-size: 0.4em; color: var(--accent); vertical-align: top; margin-left: 2px; position: relative; top: 0.3em; }
.stat p { margin: 14px 0 0; color: var(--muted); font-size: 0.93rem; line-height: 1.45; max-width: 22em; }

/* chapter list (home) */
.chapters { border-top: 1px solid var(--line); }
.chapter {
  position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.2fr) 40px; gap: 24px; align-items: center;
  padding: clamp(22px, 3.4vw, 40px) 0; border-bottom: 1px solid var(--line); isolation: isolate;
}
.chapter::before { content: ""; position: absolute; inset: 0 calc(var(--gutter) * -0.5); z-index: -1; background: var(--surface); border-radius: 14px; opacity: 0; transform: scaleY(0.7); transition: opacity 0.3s, transform 0.4s cubic-bezier(.2,.8,.2,1); }
.chapter:hover::before { opacity: 1; transform: none; }
.chapter h3 { margin: 0; font-family: var(--display); font-weight: 340; font-size: clamp(1.9rem, 4.6vw, 3.6rem); letter-spacing: -0.03em; line-height: 1; transition: transform 0.4s cubic-bezier(.2,.8,.2,1), color 0.3s; }
.chapter:hover h3 { transform: translateX(10px); color: var(--accent); font-style: italic; }
.chapter p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.chapter .go { justify-self: end; font-size: 1.4rem; transition: transform 0.3s; }
.chapter:hover .go { transform: translate(4px, -4px); color: var(--accent); }

/* now / cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  transition: border-color 0.3s, transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--tint, var(--accent)) 20%, transparent), transparent 65%);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card h3 { margin: 14px 0 10px; font-family: var(--display); font-weight: 360; font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -0.02em; line-height: 1.08; }
.card p { margin: 0 0 14px; color: var(--muted); }
.card .foot { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.tag.live { color: var(--tint, var(--accent)); border-color: color-mix(in srgb, var(--tint, var(--accent)) 45%, transparent); }
.tag.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 7px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.link { display: inline-flex; gap: 8px; align-items: center; color: var(--text); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; font-size: 0.93rem; transition: color 0.2s, border-color 0.2s; }
.link:hover { color: var(--accent); border-color: var(--accent); }

/* ───────── sub-page head ───────── */
.page-head { padding: clamp(140px, 20vh, 220px) 0 clamp(40px, 6vw, 80px); position: relative; }
.page-head .idx { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.page-head .idx::after { content: ""; flex: 0 0 80px; height: 1px; background: var(--accent); }
.page-head h1 { font-size: clamp(3rem, 10.5vw, 9rem); line-height: 0.9; letter-spacing: -0.045em; }
.page-head .intro { margin: clamp(24px, 4vw, 44px) 0 0; max-width: 38em; font-size: clamp(1.05rem, 1.5vw, 1.28rem); color: var(--muted); text-wrap: pretty; }
.page-head .intro strong { color: var(--text); font-weight: 500; }
section.tight { padding-top: 0; }

/* ───────── timeline (career) ───────── */
.timeline { position: relative; }
.era { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 20px 48px; padding: clamp(36px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.era-side { position: sticky; top: 96px; align-self: start; }
.era-years { font-family: var(--display); font-weight: 300; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 0.95; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.era-years small { display: block; font-size: 0.42em; color: var(--muted); letter-spacing: -0.01em; margin-top: 6px; }
.era-side .mono { margin-top: 16px; display: block; }
.era-body h2 { margin: 0; font-family: var(--display); font-weight: 380; font-size: clamp(1.9rem, 3.6vw, 3rem); letter-spacing: -0.025em; line-height: 1.02; }
.era-body .role { margin: 10px 0 20px; color: var(--accent); font-size: 1.02rem; font-weight: 500; }
.era-body > p { margin: 0 0 18px; max-width: 40em; text-wrap: pretty; }
.era-body h3 { margin: 30px 0 12px; font-family: var(--mono); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.era-body h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
ul.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 42em; }
ul.hits li { position: relative; padding-left: 26px; color: var(--muted); }
ul.hits li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
ul.hits li strong { color: var(--text); font-weight: 600; }
.ladder { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.ladder .tag:not(:last-child)::after { content: "→"; margin-left: 10px; color: var(--accent); }
.exit { display: inline-flex; align-items: center; gap: 9px; margin-top: 22px; padding: 8px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 0.86rem; font-weight: 500; }

/* ───────── writing ───────── */
.entries { border-top: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px 32px; padding: 30px 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: padding 0.35s cubic-bezier(.2,.8,.2,1); }
a.entry:hover { padding-left: 14px; }
.entry h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 380; font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.14; letter-spacing: -0.02em; text-wrap: balance; transition: color 0.2s; }
a.entry:hover h3 { color: var(--accent); }
.entry p { margin: 0; color: var(--muted); max-width: 44em; }
.entry .where { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.entry .yr { font-family: var(--display); font-size: 1.5rem; font-weight: 300; color: var(--accent); font-variant-numeric: tabular-nums; }
.pull { margin: 0; padding: clamp(40px, 7vw, 90px) 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.7rem, 4.2vw, 3.4rem); line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; max-width: 20em; }
.pull em { color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.pull cite { display: block; margin-top: 24px; font-family: var(--mono); font-style: normal; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ───────── patents ───────── */
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.plate {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), border-color 0.3s, box-shadow 0.4s;
}
.plate:hover { transform: translateY(-6px) rotate(-0.4deg); border-color: var(--blueprint); box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--blueprint) 70%, transparent); }
.plate-fig {
  position: relative; aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); overflow: hidden; color: var(--blueprint);
  background-image: linear-gradient(color-mix(in srgb, var(--blueprint) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--blueprint) 9%, transparent) 1px, transparent 1px);
  background-size: 20px 20px; background-position: -1px -1px;
}
.plate-fig svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate-fig .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(.3,.6,.2,1); }
.plate.in .plate-fig .draw { stroke-dashoffset: 0; }
.plate-fig .figno { position: absolute; left: 12px; bottom: 9px; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; opacity: 0.8; }
.plate-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.plate-no { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--blueprint); display: flex; justify-content: space-between; gap: 12px; }
.plate-no span:last-child { color: var(--muted); }
.plate h3 { margin: 12px 0 10px; font-family: var(--display); font-weight: 400; font-size: 1.32rem; line-height: 1.18; letter-spacing: -0.015em; text-wrap: balance; }
.plate p { margin: 0 0 16px; color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.plate .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.plate:hover .foot b { color: var(--blueprint); }
.plate .foot b { font-weight: 500; transition: color 0.2s; }
.note { margin-top: 40px; padding: 22px 26px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 0.95rem; max-width: 52em; }
.note strong { color: var(--text); font-weight: 600; }

/* ───────── projects ───────── */
.feature {
  --tint: #7da7ff;
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px);
  padding: clamp(28px, 4.5vw, 64px); border: 1px solid var(--line); border-radius: 28px; margin-bottom: 18px;
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--tint) 16%, transparent), transparent 60%), var(--surface);
}
.feature h2 { margin: 16px 0 6px; font-family: var(--display); font-weight: 340; font-size: clamp(2.3rem, 5.4vw, 4.4rem); line-height: 0.96; letter-spacing: -0.035em; }
.feature h2 em { color: var(--tint); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.feature .tagline { font-family: var(--display); font-style: italic; font-size: 1.2rem; color: var(--muted); margin: 0 0 22px; }
.feature p { margin: 0 0 16px; max-width: 36em; }
.feature .foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; align-items: center; }
.sages { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.bubble { max-width: 92%; padding: 14px 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(var(--bg-rgb), 0.55); font-size: 0.95rem; line-height: 1.45; backdrop-filter: blur(6px); }
.bubble.q { align-self: flex-end; border-bottom-right-radius: 4px; background: color-mix(in srgb, var(--tint) 20%, var(--surface)); border-color: transparent; }
.bubble.a { border-bottom-left-radius: 4px; }
.bubble b { display: block; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tint); margin-bottom: 5px; font-weight: 500; }
.bubble i { font-family: var(--display); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips span { font-size: 0.74rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.card .glyph { font-family: var(--display); font-size: 3.4rem; line-height: 1; font-weight: 300; color: var(--tint, var(--accent)); font-style: italic; letter-spacing: -0.04em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* ───────── footer ───────── */
footer { border-top: 1px solid var(--line); padding: clamp(60px, 9vw, 120px) 0 36px; position: relative; overflow: hidden; }
.foot-big { display: block; font-family: var(--display); font-weight: 300; font-size: clamp(2.6rem, 9.5vw, 8.5rem); line-height: 0.92; letter-spacing: -0.045em; margin: 0 0 clamp(36px, 6vw, 70px); }
.foot-big em { color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; transition: letter-spacing 0.6s cubic-bezier(.2,.8,.2,1); }
a.foot-big:hover em { letter-spacing: -0.01em; }
.foot-row { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; align-items: center; padding-top: 26px; border-top: 1px solid var(--line); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot-links a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.foot-links a:hover { color: var(--accent); }

/* ───────── motion ───────── */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

/* ───────── responsive ───────── */
@media (max-width: 900px) {
  .hero-foot, .sec-head, .era, .feature { grid-template-columns: minmax(0, 1fr); }
  .hero-cta { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .era-side { position: static; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
  .era-side .mono { margin-top: 0; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .chapter { grid-template-columns: 44px minmax(0, 1fr) 30px; }
  .chapter p { grid-column: 2 / 3; }
  .chapter .go { grid-row: 1; grid-column: 3; }
  .sec-head .mono { padding-top: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-name { display: none; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.84rem; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat + .stat { padding: 24px 0; border-left: 0; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .entry .where { order: -1; }
  .entry .yr { font-size: 1.1rem; }
}

/* ───────── six-word story ───────── */
.six { margin: 0 0 18px; font-size: clamp(1.25rem, 2.3vw, 1.9rem); line-height: 1.2; letter-spacing: -0.01em; }
.six .old { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.six .new { font-family: var(--mono); font-size: 0.74em; letter-spacing: 0.02em; color: var(--blueprint); white-space: nowrap; }
.card.wide { grid-column: 1 / -1; }
.dual { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; }
.half { padding: clamp(26px, 4vw, 56px); }
.half h3 { margin: 10px 0 16px; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 0.95; letter-spacing: -0.035em; font-weight: 340; }
.half p { margin: 0 0 26px; color: var(--muted); max-width: 26em; }
.half ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.half li a { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 15px 0; border-bottom: 1px solid var(--line); transition: padding 0.3s cubic-bezier(.2,.8,.2,1); }
.half li a:hover { padding-left: 10px; }
.half li b { font-weight: 500; transition: color 0.2s; }
.half li span { color: var(--muted); font-size: 0.86rem; }
.half.old { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%), var(--surface); }
.half.old h3 { font-family: var(--display); font-style: italic; color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.half.old li a:hover b { color: var(--accent); }
.half.new {
  background-color: var(--surface);
  background-image: linear-gradient(color-mix(in srgb, var(--blueprint) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--blueprint) 8%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
.half.new h3 { font-family: var(--mono); font-weight: 400; font-size: clamp(1.7rem, 3.7vw, 3.1rem); letter-spacing: -0.04em; color: var(--blueprint); line-height: 1.1; }
.half.new .mono, .half.new li span { font-family: var(--mono); }
.half.new li span { font-size: 0.74rem; }
.half.new li a:hover b { color: var(--blueprint); }
.semi { display: grid; place-items: center; width: clamp(54px, 8vw, 110px); border-inline: 1px solid var(--line); background: var(--bg); font-family: var(--display); font-weight: 300; font-size: clamp(4rem, 10vw, 9rem); line-height: 1; background-image: linear-gradient(90deg, var(--accent), var(--blueprint)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dual-note { margin: 28px 0 0; max-width: 38em; font-family: var(--display); font-style: italic; font-size: clamp(1.1rem, 1.8vw, 1.4rem); color: var(--muted); }
@media (max-width: 900px) {
  .dual { grid-template-columns: minmax(0, 1fr); }
  .semi { width: auto; height: 84px; border-inline: 0; border-block: 1px solid var(--line); font-size: 4.4rem; padding-bottom: 14px; }
}

.card .tag { align-self: flex-start; }
.card .foot .tag { align-self: auto; }
.feature.chez { align-items: center; }
.chez-art { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--display); font-weight: 300; line-height: 0.82; letter-spacing: -0.05em; font-size: clamp(4.5rem, 13vw, 11rem); user-select: none; }
.chez-art span:first-child { color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--tint) 70%, transparent); }
.chez-art span:last-child { font-style: italic; color: var(--tint); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; padding-right: 0.06em; }
@media (max-width: 900px) { .chez-art { align-items: flex-start; } }

/* ───────── palette v2: ChezJK magenta + sunshine, Sefaria blue ───────── */
.marquee { background: var(--band); color: var(--band-ink); }
:root[data-theme="light"] .marquee { border-color: #0a0a0a; -webkit-mask-image: none; mask-image: none; }
:root[data-theme="light"] .marquee-track span:nth-child(even) { color: #3d63b3; }
.six .old, .half.old h3 { color: var(--wisdom); }
.half.old { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--wisdom) 15%, transparent), transparent 65%), var(--surface); }
.half.old li a:hover b { color: var(--wisdom); }
.semi { background-image: linear-gradient(90deg, var(--wisdom), var(--blueprint)); }
:root[data-theme="light"] .card, :root[data-theme="light"] .plate, :root[data-theme="light"] .dual, :root[data-theme="light"] .feature { border-color: #0a0a0a; }
:root[data-theme="light"] .card:hover { box-shadow: 6px 6px 0 #0a0a0a; transform: translate(-3px, -3px); }
:root[data-theme="light"] .plate:hover { box-shadow: 6px 6px 0 var(--blueprint); border-color: var(--blueprint); }
:root[data-theme="light"] .stats, :root[data-theme="light"] .chapters, :root[data-theme="light"] .entries { border-top: 2px solid #0a0a0a; }
:root[data-theme="light"] .chapter:hover::before { background: var(--band); }
:root[data-theme="light"] .chapter:hover h3, :root[data-theme="light"] .chapter:hover .go { color: #0a0a0a; }
:root[data-theme="light"] .chapter:hover p { color: #0a0a0a; }
:root[data-theme="light"] .btn.primary:hover { background: #0a0a0a; border-color: #0a0a0a; color: #fff; }
:root[data-theme="light"] .exit { background: var(--band); color: #0a0a0a; }
:root[data-theme="light"] footer { --text: #ffffff; --muted: #c9bfc3; --line: rgba(255,255,255,0.2); --accent: #86a8f0; background: #0a0a0a; color: #fff; border-top: 0; }

/* ChezJK featured block: the brand's full-bleed magenta-to-sunset variant */
.feature.chez { background: linear-gradient(120deg, #ae0062 0%, #d02a7b 48%, #e2725b 100%); color: #fff; border-color: transparent !important; }
.feature.chez h2 em { color: #feda77; }
.feature.chez .tagline { color: rgba(255,255,255,0.86); }
.feature.chez .tag { color: #fff; border-color: rgba(255,255,255,0.5); }
.feature.chez .btn { background: #fff; border-color: #fff; color: #0a0a0a; }
.feature.chez .btn:hover { background: #feda77; border-color: #feda77; color: #0a0a0a; }
.feature.chez .link { color: #fff; border-color: rgba(255,255,255,0.6); }
.feature.chez .link:hover { color: #feda77; border-color: #feda77; }
.chez-art span:first-child { -webkit-text-stroke: 1.5px rgba(255,255,255,0.85); }
.chez-art span:last-child { color: #feda77; }
.card.chezcard { background: linear-gradient(120deg, #ae0062 0%, #d02a7b 55%, #e2725b 100%); color: #fff; border-color: transparent !important; }
.card.chezcard p { color: rgba(255,255,255,0.9); }
.card.chezcard .tag, .card.chezcard .link { color: #fff; border-color: rgba(255,255,255,0.55); }

.health-intro { margin: 0; max-width: 40em; font-size: clamp(1.05rem, 1.5vw, 1.25rem); text-wrap: pretty; }
.stat b sup { white-space: nowrap; }
#health .stat b { font-size: clamp(2.4rem, 4.6vw, 3.9rem); }
.card .glyph { white-space: nowrap; }
:root[data-theme="light"] .card .glyph, :root[data-theme="light"] .feature:not(.chez) h2 em, :root[data-theme="light"] .bubble b, :root[data-theme="light"] .tag.live { color: color-mix(in srgb, var(--tint, var(--accent)) 62%, #000); }
:root[data-theme="light"] .card.chezcard .tag.live, :root[data-theme="light"] .feature.chez .tag.live { color: #fff; }
