:root {
  --paper: #f1ece4;
  --page: #fbf8f2;
  --ink: #221a14;
  --rust: #b4532a;
  --peach: #e8a882;
  --rule: #d9cfc1;
  --rule-page: #e3d9cb;
  --outline: #b9ab98;
  --muted: #6e6256;
  --body: #4f453b;
  --serif: Gloock, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'DM Mono', monospace;
  --gutter: clamp(20px, 5vw, 48px);
  --hh: 66px;
}

html, body { margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
a { color: var(--ink); text-decoration-color: rgba(19, 32, 43, .3); text-underline-offset: 3px; }
a:hover { color: var(--rust); text-decoration-color: var(--rust); }
::selection { background: var(--rust); color: #fff; }
button { font-family: inherit; }

.page { font-family: var(--sans); font-size: 16px; line-height: 1.55; overflow-x: clip; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--rust); text-transform: uppercase; letter-spacing: .08em; }
.eyebrow-light { color: var(--peach); }
.mono-note { font-family: var(--mono); font-size: 12px; color: var(--muted); }
em { color: var(--rust); }

.btn { display: inline-block; text-decoration: none; padding: 13px 22px; border-radius: 999px; font-size: 15px; white-space: nowrap; cursor: pointer; }
.btn-dark, .btn-dark:hover { background: var(--ink); color: #fff; border: 0; }
.btn-outline { border: 1px solid var(--outline); padding: 12px 22px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(241, 236, 228, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.header-row { padding-top: 18px; padding-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }
.nav-chapters { display: contents; }
.chip, .chip:hover { padding: 7px 12px; border-radius: 999px; text-decoration: none; background: transparent; color: var(--ink); }
.chip.is-active, .chip.is-active:hover { background: var(--rust); color: #fff; }
.chip-dark, .chip-dark:hover { background: var(--ink); color: #fff; }
.progress { height: 2px; background: var(--rule); }
.progress-bar { height: 2px; width: 0; background: var(--rust); }

/* Hero */
.hero { padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(48px, 7vw, 80px); display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.hero-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.2vw, 72px); line-height: 1; letter-spacing: -.025em; text-wrap: balance; }
.hero-lede { margin: 0; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--body); text-wrap: pretty; max-width: 36em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.portrait { aspect-ratio: 4 / 5; width: 100%; max-width: 420px; justify-self: start; border-radius: 20px; overflow: hidden; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Timeline */
.timeline { padding-bottom: clamp(64px, 8vw, 96px); position: relative; }
.timeline-line { position: absolute; left: var(--gutter); right: var(--gutter); top: 6px; height: 2px; background: var(--rule); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 28px; position: relative; }
.tile, .tile:hover { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.tile-last { background: #fff; border-radius: 16px; padding: 12px 20px 20px; margin: -12px -20px 0; box-shadow: 0 1px 2px rgba(34, 26, 20, .06); }
.tile-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--rust); box-shadow: 0 0 0 6px var(--paper); }
.tile-last .tile-dot { background: var(--ink); box-shadow: 0 0 0 6px #fff; }
.tile-tag { font-family: var(--mono); font-size: 12px; color: var(--rust); margin-top: 6px; }
.tile-last .tile-tag { color: var(--ink); }
.tile-title { font-family: var(--serif); font-size: 24px; line-height: 1.12; }
.tile-summary { font-size: 15px; color: #574c42; line-height: 1.45; }

/* Book */
.book-sec { border-top: 1px solid var(--rule); overflow-x: clip; }
.book-inner { position: sticky; top: var(--hh); height: calc(100vh - var(--hh)); max-width: 1200px; margin: 0 auto; padding: 28px clamp(20px, 4vw, 48px) 20px; display: flex; flex-direction: column; justify-content: safe center; gap: 28px; overflow: hidden; }
.book-wrap { position: relative; }
.stage { position: relative; height: clamp(520px, calc(100vh - var(--hh) - 140px), 780px); perspective: 2600px; transition: height .45s ease, transform 1000ms cubic-bezier(.645, .045, .355, 1); }
.stage.is-closed { transform: translateX(-50%); }
.board { position: absolute; top: -10px; bottom: -16px; left: 50%; width: calc(50% + 10px); background: var(--ink); border-radius: 0 10px 10px 0; box-shadow: 0 40px 70px -30px rgba(34, 26, 20, .55), 0 10px 24px rgba(34, 26, 20, .12); }

.face { position: absolute; transform-origin: left center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face-board { background: var(--ink); border-radius: 10px 0 0 10px; }
.shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(to right, rgba(34, 26, 20, .3), rgba(34, 26, 20, .06)); }

.cover { position: absolute; inset: 0; cursor: pointer; border-radius: 0 10px 10px 0; background: linear-gradient(to right, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 6%, rgba(255, 255, 255, .04) 7%, rgba(0, 0, 0, 0) 9%), var(--ink); color: var(--paper); padding: clamp(22px, 3vw, 36px); }
.cover-frame { height: 100%; border: 1px solid rgba(241, 236, 228, .2); border-radius: 4px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; padding: clamp(28px, 4vw, 56px) clamp(18px, 3vw, 40px); }
.cover-kicker { font-family: var(--mono); font-size: 12px; color: var(--peach); text-transform: uppercase; letter-spacing: .14em; }
.cover-mid { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cover-name { font-family: var(--serif); font-size: clamp(44px, 5.4vw, 76px); line-height: .98; letter-spacing: -.02em; text-wrap: balance; }
.cover-rule { width: 56px; height: 1px; background: var(--peach); }
.cover-sub { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px); color: var(--peach); }
.cover-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cover-hint { font-family: var(--serif); font-size: 20px; color: var(--paper); }
.cover-years { font-family: var(--mono); font-size: 12px; color: #c2b5a5; letter-spacing: .08em; }

.paper { position: absolute; inset: 0; background: linear-gradient(to right, rgba(34, 26, 20, .14), rgba(34, 26, 20, 0) 9%), var(--page); border-radius: 3px; overflow: hidden; color: var(--ink); }
.paper-left { background: linear-gradient(to left, rgba(34, 26, 20, .14), rgba(34, 26, 20, 0) 9%), var(--page); }
.paper-edge { box-shadow: 0 2px 0 var(--rule-page), 0 4px 0 var(--page), 0 5px 0 var(--rule-page); }
.paper-inner { position: relative; height: 100%; display: flex; flex-direction: column; gap: 18px; padding: clamp(22px, 3.2vw, 40px) clamp(22px, 3.6vw, 48px) clamp(16px, 2.2vw, 24px); }
.running-head { font-family: var(--mono); font-size: 11px; color: #8a7d70; text-transform: uppercase; letter-spacing: .1em; text-align: center; }
.page-num { font-family: var(--mono); font-size: 11px; color: #8a7d70; text-align: center; }
.page-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 22px; scrollbar-width: thin; }

.opener { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.opener-num { font-family: var(--serif); font-size: clamp(64px, 7vw, 104px); line-height: .8; color: var(--rust); }
.opener-tag { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.opener-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.04; letter-spacing: -.02em; text-wrap: balance; }
.opener-meta { font-size: 15px; color: var(--muted); }
.photo { width: 100%; background-size: cover; border-radius: 6px; margin-top: 8px; }

.stamps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; width: 100%; max-width: 374px; padding: 10px 8px 4px; margin-top: 4px; }
.stamp { flex: none; padding: 6px; position: relative; background: radial-gradient(circle, var(--page) 2.6px, transparent 3px) -4px -4px / 8px 8px round, #fff; filter: drop-shadow(0 3px 5px rgba(34, 26, 20, .22)); }
.stamp-img { width: 100%; height: 100%; background-size: cover; outline: 1px solid rgba(34, 26, 20, .12); }

.lede { margin: 0; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.45; color: #2e251e; text-wrap: pretty; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 84px), 1fr)); gap: 8px; }
.stat { background: var(--paper); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.stat-v { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 30px); line-height: 1; }
.stat-k { font-size: 13px; color: var(--muted); line-height: 1.3; }
.points { display: flex; flex-direction: column; }
.point { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--rule-page); }
.point-k { font-weight: 600; font-size: 15.5px; }
.point-v { font-size: 15px; line-height: 1.45; color: var(--body); text-wrap: pretty; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { border: 1px solid var(--outline); text-decoration: none; padding: 9px 18px; border-radius: 999px; font-size: 14px; }

.edge { position: absolute; top: 0; bottom: 0; width: 44px; z-index: 50; border: 0; padding: 0; cursor: pointer; background: transparent; }
.edge-prev { left: 0; }
.edge-next { right: 0; }
.edge-prev:hover { background: linear-gradient(to right, rgba(34, 26, 20, .09), rgba(34, 26, 20, 0)); }
.edge-next:hover { background: linear-gradient(to left, rgba(34, 26, 20, .09), rgba(34, 26, 20, 0)); }
.edge[hidden] { display: none; }

.cta { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; display: flex; align-items: center; padding-left: clamp(32px, 5vw, 80px); opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.cta.is-visible { opacity: 1; pointer-events: auto; }
.cta-inner { display: flex; flex-direction: column; gap: 20px; max-width: 420px; }
.cta-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 64px); line-height: 1; letter-spacing: -.025em; }
.cta-lede { margin: 0; font-size: 18px; line-height: 1.5; color: var(--body); text-wrap: pretty; }
.cta-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ctrl { flex: none; border: 1px solid var(--outline); background: transparent; color: var(--ink); padding: 11px 20px; border-radius: 999px; font-size: 15px; white-space: nowrap; cursor: pointer; }
.ctrl:disabled { cursor: default; opacity: .35; }
.ctrl-label { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.ctrl-title { font-family: var(--serif); font-size: clamp(17px, 2vw, 20px); line-height: 1.2; text-wrap: balance; }
.ctrl-pages { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Recognition */
.recognition { background: var(--ink); color: var(--paper); }
.recognition-grid { padding-top: clamp(64px, 8vw, 96px); padding-bottom: clamp(64px, 8vw, 96px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(24px, 5vw, 64px); }
.recognition-head { display: flex; flex-direction: column; gap: 12px; }
.recognition-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; }
.recognition-list { grid-column: span 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 36px; }
.rec { padding: 20px 0; border-top: 1px solid #3a3028; display: flex; flex-direction: column; gap: 4px; }
.rec-title { font-family: var(--serif); font-size: 21px; line-height: 1.25; }
.rec-detail { font-size: 14px; color: #c2b5a5; text-wrap: pretty; }

/* Contact */
.contact { padding-top: clamp(72px, 10vw, 128px); padding-bottom: 40px; display: flex; flex-direction: column; gap: 40px; scroll-margin-top: 80px; }
.contact-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7.6vw, 104px); line-height: .98; letter-spacing: -.025em; text-wrap: balance; }
.contact-foot { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid var(--rule); }
.contact-links { display: flex; gap: 28px; flex-wrap: wrap; font-size: 17px; }

/* Single-page book (phones and small tablets) */
@media (max-width: 859.98px) {
  .book-inner { height: calc(100svh - var(--hh)); max-width: none; padding: 20px 22px 14px 12px; gap: 18px; }
  .stage { height: max(360px, calc(100svh - var(--hh) - 118px)); margin-right: 10px; }
  .stage.is-closed { transform: none; }
  .board { left: 0; width: calc(100% + 10px); }
  .cta { display: none; }
  .ctrl { padding: 0; width: 48px; height: 48px; }
}

/* Phones */
@media (max-width: 719.98px) {
  .nav-chapters, .timeline-line { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tile, .tile-last { gap: 6px; padding: 18px 0; margin: 0; border-top: 1px solid var(--rule); background: none; border-radius: 0; box-shadow: none; }
  .tile-dot { display: none; }
}
