@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-var-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #f6efe1;
  --paper-2: #efe5d1;
  --card: #fbf7ee;
  --ink: #221a12;
  --ink-2: #4a3d2e;
  --muted: #8c7f6c;
  --line: rgba(34, 26, 18, 0.14);
  --red: #8f2f1e;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* paper grain: a tiny SVG noise, fixed so it does not scroll with content */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.27  0 0 0 0 0.16  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
main, header, footer { position: relative; z-index: 1; }
a { color: inherit; }
img, canvas, svg { display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 27px; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 30px; font-size: 14px; color: var(--ink-2); }
.nav a { text-decoration: none; opacity: .8; transition: opacity .2s; }
.nav a:hover, .nav a[aria-current] { opacity: 1; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 11px 20px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-size: 14px; font-weight: 500;
  border: 0; cursor: pointer; font-family: var(--sans); transition: transform .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); background: #000; }
.btn svg { width: 15px; height: 15px; }
.btn.big { padding: 18px 44px; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--card); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 450; letter-spacing: -0.025em; margin: 0; }
h1 em, h2 em, h3 em { color: var(--muted); font-style: italic; font-weight: 400; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.lede { color: var(--ink-2); font-size: 18px; line-height: 1.6; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: max(calc(100svh - 72px), 620px); display: flex; flex-direction: column; align-items: center; padding-top: 48px; overflow: hidden; }
.hero h1 { font-size: clamp(46px, 8.4vw, 118px); line-height: 0.95; text-align: center; max-width: 12ch; }
.hero .lede { text-align: center; max-width: 560px; margin: 26px auto 34px; font-size: 17px; }
.hero-copy { position: relative; z-index: 2; text-align: center; padding: 0 22px; }
.hero-art { position: absolute; inset: 0; z-index: 1; }
.hero-art canvas { width: 100%; height: 100%; touch-action: pan-y; }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 10vh; background: linear-gradient(transparent, rgba(246, 239, 225, .0) 40%, var(--paper)); z-index: 2; pointer-events: none; }
.hero .plate {
  position: absolute; z-index: 3; bottom: 7vh; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); letter-spacing: .32em; text-transform: uppercase; font-size: 12px; color: var(--ink-2);
  border-top: 1px solid var(--ink-2); border-bottom: 1px solid var(--ink-2); padding: 6px 14px; white-space: nowrap;
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
.marquee .track { display: flex; gap: 46px; width: max-content; animation: slide 46s linear infinite; font-family: var(--serif); font-size: clamp(26px, 3.4vw, 44px); color: var(--ink-2); align-items: center; }
.marquee .track span.d { width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); display: inline-block; }
.marquee .track i { font-style: italic; color: var(--muted); font-size: .55em; margin-left: 10px; letter-spacing: .02em; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- journey ---------- */
.journey { position: relative; }
.journey-head { padding: 140px 0 40px; }
.journey-head h2 { font-size: clamp(40px, 6vw, 84px); line-height: 1; max-width: 13ch; }
.journey-head p { max-width: 520px; margin-top: 22px; }
.journey-stage { position: relative; }
.journey-pin { position: sticky; top: 72px; height: calc(100svh - 72px); overflow: hidden; }
.journey-pin canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.journey-pin .era-year {
  position: absolute; right: 4vw; bottom: 3vh; font-family: var(--serif); font-size: clamp(64px, 12vw, 190px);
  color: rgba(34, 26, 18, 0.07); line-height: 1; font-variant-numeric: oldstyle-nums; pointer-events: none; letter-spacing: -0.03em;
}
.journey-pin .rail { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 9px; }
.journey-pin .rail b { width: 18px; height: 1px; background: var(--ink); opacity: .2; transition: width .35s, opacity .35s; }
.journey-pin .rail b.on { width: 40px; opacity: .9; }
.chapters { position: relative; margin-top: calc(-100svh + 72px); pointer-events: none; }
.chapter { height: 100svh; display: flex; align-items: center; }
.chapter .card {
  pointer-events: auto; width: min(400px, 100%); margin-left: max(70px, calc((100vw - var(--max)) / 2 + 40px));
  background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 28px 24px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 30px 60px -40px rgba(34, 26, 18, .45);
}
.chapter .num { font-family: var(--serif); font-size: 15px; color: var(--muted); letter-spacing: .2em; }
.chapter h3 { font-size: 38px; line-height: 1.02; margin: 8px 0 4px; }
.chapter .when { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 19px; }
.chapter p { font-size: 15px; color: var(--ink-2); margin: 14px 0 18px; }
.chapter a.more { font-size: 14px; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* ---------- sections ---------- */
section.block { padding: 150px 0; }
.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: center; }
.split h2, .center h2 { font-size: clamp(40px, 5.4vw, 74px); line-height: 1; }
.split p { margin: 22px 0 30px; max-width: 440px; }
.center { text-align: center; }
.center h2 { margin: 0 auto; max-width: 16ch; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 70px; }
.steps > div { border-top: 1px solid var(--line); padding-top: 26px; }
.steps .rn { font-family: var(--serif); font-size: 66px; line-height: 1; color: var(--ink-2); }
.steps h3 { font-size: 26px; margin: 18px 0 6px; }
.steps p { color: var(--ink-2); font-size: 15px; margin: 0; max-width: 300px; }
.note { margin-top: 44px; font-size: 13px; color: var(--muted); }

.pool { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.pool canvas { width: 100%; aspect-ratio: 1.1; }
.ledger { margin-top: 30px; border-top: 1px solid var(--line); }
.ledger div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.ledger div span:last-child { font-family: var(--serif); font-size: 20px; }
.ledger div span:first-child { color: var(--ink-2); }

.term {
  background: #1d1711; color: #e9dfcb; border-radius: 16px; padding: 26px 28px; font-family: var(--mono); font-size: 13.5px; line-height: 1.9;
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .7); overflow-x: auto;
}
.term .p { color: #8f826d; }
.term .ok { color: #b9c98d; }
.term .k { color: #e3b878; }

.cta { padding: 170px 0 150px; text-align: center; position: relative; overflow: hidden; }
.cta h2 { font-size: clamp(44px, 6.4vw, 96px); line-height: .98; max-width: 14ch; margin: 0 auto 22px; }
.cta p { margin: 0 auto 36px; max-width: 460px; }
.cta canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }

.faq { max-width: 820px; margin: 0 auto; }
.faq h2 { font-size: clamp(40px, 5vw, 64px); margin-bottom: 30px; }
.faq details { border-top: 1px solid var(--line); padding: 22px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; font-family: var(--serif); font-size: 24px; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-weight: 300; color: var(--muted); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 12px 0 0; max-width: 680px; }

footer { border-top: 1px solid var(--line); padding: 36px 0 50px; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer a { text-decoration: none; }

.prelim { display: inline-block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-2); background: var(--card); }

/* ---------- problem card (shared with the library) ---------- */
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 40px 80px -50px rgba(34, 26, 18, .5); }
.pcard .bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); gap: 10px; }
.pcard .bar b { font-weight: 500; color: var(--ink-2); }
.pcard .model { position: relative; aspect-ratio: 16 / 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.pcard .model canvas { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.pcard .model .hint { position: absolute; left: 14px; bottom: 10px; font-size: 11px; color: var(--muted); pointer-events: none; }
.pcard .body { padding: 20px 22px 22px; }
.pcard h3 { font-size: 27px; line-height: 1.1; }
.pcard .stmt { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--ink-2); margin: 10px 0 16px; }
.pcard .stmt b { color: var(--ink); font-weight: 600; }
.answer { display: flex; gap: 10px; }
.answer input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 12px 18px;
  font-family: var(--serif); font-size: 18px; color: var(--ink); outline: none;
}
.answer input:focus { border-color: var(--ink-2); }
.verdict { font-size: 14px; margin-top: 12px; min-height: 22px; color: var(--ink-2); }
.verdict.ok { color: #3f5d2a; }
.verdict.no { color: var(--red); }
.tier { font-family: var(--serif); font-style: italic; font-size: 14px; }

@media (max-width: 900px) {
  .nav { display: none; }
  .split, .pool { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: 1fr; gap: 10px; margin-top: 40px; }
  section.block { padding: 100px 0; }
  .chapter { align-items: flex-end; padding-bottom: 6svh; }
  .chapter .card { margin: 0 auto; width: calc(100% - 36px); padding: 20px 20px 18px; }
  .chapter h3 { font-size: 30px; }
  .chapter p { font-size: 14px; margin: 10px 0 12px; }
  .journey-pin .rail { display: none; }
  .journey-pin .era-year { top: 2vh; bottom: auto; right: 18px; font-size: 76px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .top .btn { padding: 9px 14px; font-size: 13px; }
  .brand { font-size: 23px; }
  .hero { padding-top: 30px; min-height: max(calc(100svh - 72px), 600px); }
  .hero .lede { font-size: 15.5px; margin: 20px auto 26px; }
  .btn.big { padding: 15px 34px; }
  .hero .plate { font-size: 10px; letter-spacing: .22em; bottom: 4vh; }
  .pcard .stmt { font-size: 17px; }
  .faq summary { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee .track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- header right, wallet, X ---------- */
.top-right { display: flex; align-items: center; gap: 10px; }
.xlink { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--line); background: var(--card); }
.xlink svg { width: 16px; height: 16px; }
[data-connect] { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-connect].holder { background: #2f4a22; }
.foot-links a { text-decoration: none; }

/* ---------- hero scenery ---------- */
.hero-art canvas { background: #cdbf9f; }
.hero-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 96%, transparent) 0%, color-mix(in srgb, var(--paper) 80%, transparent) 26%, color-mix(in srgb, var(--paper) 22%, transparent) 46%, transparent 60%); }
.hero h1, .hero .lede { text-shadow: 0 1px 18px rgba(246, 239, 225, .7); }
.hero .lede { color: var(--ink); }
.era-cap { position: absolute; z-index: 3; left: 28px; bottom: 26px; color: #fbf6ea; font-size: 13px; text-shadow: 0 1px 10px rgba(0, 0, 0, .55); max-width: min(520px, calc(100% - 56px)); transition: opacity .6s; }
.era-cap b { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.era-cap span { font-family: var(--serif); font-style: italic; font-size: 17px; opacity: .9; margin-left: 6px; }
.era-cap small { display: block; font-size: 11.5px; opacity: .8; margin-top: 3px; }
.era-ticks { display: flex; gap: 6px; margin-bottom: 10px; }
.era-ticks i { width: 26px; height: 2px; background: rgba(251, 246, 234, .35); border-radius: 2px; overflow: hidden; }
.era-ticks i.on { background: #fbf6ea; }
@media (max-width: 560px) {
  .xlink { width: 34px; height: 34px; }
  [data-connect] { max-width: 150px; padding: 9px 12px; font-size: 12.5px; }
  .era-cap { left: 18px; bottom: 18px; }
  .era-cap b { font-size: 18px; }
  .era-cap span { font-size: 15px; }
}
.hero-fade { display: none; }

/* hero text always readable over the painting: a soft paper glow sized to the copy block */
.hero-copy { isolation: isolate; padding: 18px 26px 26px; }
.hero-copy::before {
  content: ""; position: absolute; z-index: -1; inset: -40px -90px -50px;
  background: radial-gradient(closest-side, rgba(246, 239, 225, .94) 0%, rgba(246, 239, 225, .9) 55%, rgba(246, 239, 225, .62) 78%, rgba(246, 239, 225, 0) 100%);
  filter: blur(6px); pointer-events: none;
}
.hero h1 em { color: #6f6352; }
.hero .lede { color: #1f1912; font-weight: 450; text-shadow: 0 0 14px rgba(246, 239, 225, .95), 0 0 2px rgba(246, 239, 225, .9); }
.hero h1 { text-shadow: 0 0 24px rgba(246, 239, 225, .85); }
@media (max-width: 560px) { .hero-copy::before { inset: -30px -40px -40px; } }
