/* Andrei Media reader library.
   Principles: one focal object per screen, a physical answer to every touch,
   progress you can see, and one crafted moment at the end of each task. */

@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --well: #f0f0f3;
  --ink: #1d1d1f;
  --ink-2: #5f5f66;
  --ink-3: #86868b;
  --rule: rgba(0, 0, 0, .08);
  --rule-2: rgba(0, 0, 0, .16);
  --fill: rgba(0, 0, 0, .055);
  --gold: #a5772a;
  --gold-hi: #c9993f;
  --ok: #1f8a3b;
  --danger: #c5162e;
  --glass: rgba(245, 245, 247, .84);
  --ring: rgba(165, 119, 42, .45);
  --btn: #1d1d1f;
  --btn-ink: #f5f5f7;
  --cover-shadow: 0 1px 1px rgba(0,0,0,.06), 0 4px 10px -2px rgba(0,0,0,.12), 0 22px 40px -14px rgba(0,0,0,.30);
  --cover-shadow-hi: 0 2px 2px rgba(0,0,0,.06), 0 10px 18px -4px rgba(0,0,0,.16), 0 36px 60px -18px rgba(0,0,0,.36);
  --panel-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 50px -20px rgba(0,0,0,.18);

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --wrap: 1180px;
  --gutter: clamp(16px, 4.2vw, 44px);
  --bar-h: 52px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121 24%, 1.149 27.3%, 1.159 29.6%, 1.16 31.5%, 1.151, 1.13 37.3%, 1.02 47.4%, .989 52.9%, .976 58.5%, .981 66.2%, 1.001 82%, 1); }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #000000;
    --surface: #161618;
    --well: #1d1d20;
    --ink: #f5f5f7;
    --ink-2: #a8a8ae;
    --ink-3: #7c7c82;
    --rule: rgba(255, 255, 255, .09);
    --rule-2: rgba(255, 255, 255, .18);
    --fill: rgba(255, 255, 255, .08);
    --gold: #d4a24c;
    --gold-hi: #e9bc66;
    --ok: #34c759;
    --danger: #ff5a6e;
    --glass: rgba(12, 12, 14, .8);
    --ring: rgba(212, 162, 76, .5);
    --btn: #f5f5f7;
    --btn-ink: #1d1d1f;
    --cover-shadow: 0 1px 1px rgba(0,0,0,.5), 0 6px 14px -2px rgba(0,0,0,.6), 0 26px 46px -14px rgba(0,0,0,.8);
    --cover-shadow-hi: 0 2px 2px rgba(0,0,0,.5), 0 12px 22px -4px rgba(0,0,0,.6), 0 40px 70px -18px rgba(0,0,0,.85);
    --panel-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px -24px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"] {
  --canvas: #000000;
  --surface: #161618;
  --well: #1d1d20;
  --ink: #f5f5f7;
  --ink-2: #a8a8ae;
  --ink-3: #7c7c82;
  --rule: rgba(255, 255, 255, .09);
  --rule-2: rgba(255, 255, 255, .18);
  --fill: rgba(255, 255, 255, .08);
  --gold: #d4a24c;
  --gold-hi: #e9bc66;
  --ok: #34c759;
  --danger: #ff5a6e;
  --glass: rgba(12, 12, 14, .8);
  --ring: rgba(212, 162, 76, .5);
  --btn: #f5f5f7;
  --btn-ink: #1d1d1f;
  --cover-shadow: 0 1px 1px rgba(0,0,0,.5), 0 6px 14px -2px rgba(0,0,0,.6), 0 26px 46px -14px rgba(0,0,0,.8);
  --cover-shadow-hi: 0 2px 2px rgba(0,0,0,.5), 0 12px 22px -4px rgba(0,0,0,.6), 0 40px 70px -18px rgba(0,0,0,.85);
  --panel-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px -24px rgba(0,0,0,.9);
}
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--sans); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--gold) 30%, transparent); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.skip:focus { position: fixed; z-index: 100; left: 16px; top: 12px; width: auto; height: auto; clip: auto; padding: 10px 16px; border-radius: 999px; background: var(--btn); color: var(--btn-ink); }
.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- header: glass that gains an edge once you scroll ---------- */
.bar { position: sticky; top: 0; z-index: 50; height: var(--bar-h); background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 transparent; transition: box-shadow .3s var(--ease); }
.bar.is-scrolled { box-shadow: 0 1px 0 var(--rule); }
.bar-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; color: var(--ink); border-radius: 4px; }
.logo svg { height: 30px; width: auto; }
.nav { display: flex; gap: clamp(18px, 3vw, 34px); font-size: .875rem; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 6px 0; transition: color .2s; }
.nav a:hover { color: var(--ink); }
.bar-end { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 26px); }
.theme { position: relative; width: 34px; height: 34px; margin-right: -6px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .25s, color .2s, transform .5s var(--spring); }
.theme:hover { background: var(--fill); color: var(--ink); }
.theme:active { transform: scale(.88); transition-duration: .12s; }
.theme svg { position: absolute; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .7s var(--spring), opacity .3s var(--ease); }
.theme .sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
.theme .moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .theme .moon { opacity: 0; transform: rotate(90deg) scale(.4); }
}
:root[data-theme="dark"] .theme .sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme .moon { opacity: 0; transform: rotate(90deg) scale(.4); }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.03em; margin: 0; }
.kicker { margin: 0; font-size: .9375rem; font-weight: 500; color: var(--gold); letter-spacing: -.01em; }
.sec-head { max-width: 46rem; }
.sec-title { font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1.05; letter-spacing: -.04em; text-wrap: balance; }
.sec-lede { margin: 16px 0 0; font-size: clamp(1.0625rem, 1.5vw, 1.3125rem); line-height: 1.45; color: var(--ink-2); max-width: 36em; text-wrap: pretty; }

/* ---------- buttons: they give way under your finger ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink); font: 600 1rem/1 var(--sans); letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .5s var(--spring), opacity .2s, background-color .3s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { opacity: .86; text-decoration: none; }
.btn:active { transform: scale(.96); transition-duration: .12s; }
.btn[disabled] { cursor: progress; }
.btn .i { width: 18px; height: 18px; stroke-width: 2; }
.btn-text { border: 0; background: none; padding: 8px 4px; font-weight: 500; font-size: .9375rem; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: .2em; }
.btn-text:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- covers: paper, a hinge, and light that follows you ---------- */
.cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; overflow: hidden;
  background: var(--tint, #888); box-shadow: var(--cover-shadow); isolation: isolate; }
.cover picture, .cover img { width: 100%; height: 100%; }
.cover img { object-fit: cover; -webkit-user-drag: none; user-select: none; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0,0,0,.22) 0, rgba(255,255,255,.16) 1.4%, rgba(0,0,0,.08) 3%, rgba(0,0,0,0) 6.5%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 28%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.cover::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.42), rgba(255,255,255,0) 52%);
  mix-blend-mode: soft-light; transition: opacity .5s var(--ease); }
[data-tilt].is-tilting .cover::before { opacity: 1; }
.badge { position: absolute; z-index: 4; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(20, 16, 8, .52);
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
  box-shadow: 0 0 0 1px rgba(233, 188, 102, .7), 0 2px 8px rgba(0,0,0,.25); }
.badge .i { width: 14px; height: 14px; stroke: #f2cf86; stroke-width: 2.2; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(32px, 5.5vh, 72px); overflow: hidden; }
.hero-copy { text-align: center; }
.hero h1 { font-size: clamp(2.4rem, 4.6vw, 4.4rem); line-height: 1.03; letter-spacing: -.048em; font-weight: 650; text-wrap: balance; }
.hero h1 .ln { display: inline-block; }
.hero .lede { margin: 18px auto 0; max-width: 34em; font-size: clamp(1.0625rem, 1.7vw, 1.375rem); line-height: 1.42; color: var(--ink-2); text-wrap: balance; }

/* the stage: a cover flow you can swipe, drag, click or arrow through */
.stage { position: relative; margin-top: clamp(8px, 2vh, 28px); --item: clamp(150px, min(19vw, 25.5vh), 258px); --gap: clamp(14px, 2vw, 28px); }
.glow { position: absolute; left: 50%; top: 4%; width: min(820px, 90vw); height: 72%; translate: -50% 0;
  border-radius: 50%; background-color: #b38a3c; opacity: .34; filter: blur(70px); pointer-events: none;
  transition: background-color 1s var(--ease); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .glow { opacity: .3; } }
:root[data-theme="dark"] .glow { opacity: .3; }
.flow { position: relative; display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  padding: 34px calc(50% - var(--item) / 2) 56px; outline: none; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); }
.flow::-webkit-scrollbar { display: none; }
.flow.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.flow:focus-visible { outline: none; }
.flow:focus-visible .flow-item.is-center .cover { outline: 3px solid var(--ring); outline-offset: 6px; }
.flow-item { flex: 0 0 var(--item); scroll-snap-align: center; display: block; border-radius: 6px; transform-origin: 50% 50%;
  will-change: transform; -webkit-tap-highlight-color: transparent; }
.flow-item .cover { transition: box-shadow .6s var(--ease); }
.flow-item.is-center .cover { box-shadow: var(--cover-shadow-hi); }
.js .flow:not(.is-ready) { visibility: hidden; }
.flow-btn { position: absolute; top: calc(34px + var(--item) * .75); translate: 0 -50%; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 0 0 1px var(--rule), 0 6px 18px -6px rgba(0,0,0,.25);
  transition: transform .5s var(--spring), opacity .3s; }
.flow-btn .i { width: 20px; height: 20px; stroke-width: 2.2; }
.flow-btn:active { transform: scale(.9); }
.flow-btn[disabled] { opacity: 0; pointer-events: none; }
.flow-btn.prev { left: max(var(--gutter), calc(50% - var(--item) * 1.9)); }
.flow-btn.next { right: max(var(--gutter), calc(50% - var(--item) * 1.9)); }
@media (hover: none), (max-width: 640px) { .flow-btn { display: none; } }
.caption { position: relative; text-align: center; padding: 0 var(--gutter); min-height: 140px; margin-top: -26px; }
.cap-meta { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.cap-title { margin: 4px 0 16px; font-size: clamp(1.5rem, 2.6vw, 2.125rem); letter-spacing: -.035em; line-height: 1.1; }

/* ---------- how it works ---------- */
.how { padding-top: clamp(96px, 13vw, 168px); }
.how-steps { list-style: none; margin: clamp(40px, 6vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface); border-radius: 28px; box-shadow: var(--panel-shadow); counter-reset: how; }
.how-steps li { position: relative; padding: clamp(26px, 3.4vw, 44px); counter-increment: how; }
.how-steps li + li { border-left: 1px solid var(--rule); }
.how-steps li::before { content: counter(how); position: absolute; top: clamp(22px, 3vw, 36px); right: clamp(22px, 3vw, 36px);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 .8125rem/1 var(--sans);
  color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-2); }
.how-steps h3 { margin-top: 26px; font-size: 1.25rem; letter-spacing: -.025em; }
.how-steps p { margin: 8px 0 0; color: var(--ink-2); line-height: 1.5; }
.art { width: 120px; height: 90px; }
.art .ln { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art .thin { stroke: var(--ink-3); stroke-width: 1.6; }
.art .fill { fill: var(--ink); }
.art .gold { fill: var(--gold); }
.art .tick { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- library ---------- */
.library { padding-top: clamp(96px, 13vw, 168px); }
.lib-head { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px; }
.lock-note { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; vertical-align: -.32em; margin: 0 .1em;
  background: rgba(20, 16, 8, .78); box-shadow: 0 0 0 1px rgba(233,188,102,.7); }
.lock-note .i { width: .82em; height: .82em; stroke: #f2cf86; stroke-width: 2.4; }
.lib-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font: 500 .875rem/1.2 var(--sans); color: var(--ink-2); white-space: nowrap; transition: color .25s; -webkit-tap-highlight-color: transparent; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg button:focus-visible { outline-offset: -2px; }
.seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 3px 10px -2px rgba(0,0,0,.12); transition: transform .55s var(--spring), width .55s var(--spring); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-thumb { background: #3a3a3e; } }
:root[data-theme="dark"] .seg-thumb { background: #3a3a3e; }
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search input { width: 220px; height: 40px; border-radius: 999px; border: 0; background: var(--fill); padding: 0 16px 0 38px;
  font: 400 .9375rem var(--sans); color: var(--ink); transition: box-shadow .25s, width .5s var(--ease), background-color .25s; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 1px var(--rule-2), 0 0 0 5px var(--ring); }
.grid { list-style: none; padding: 0; margin: clamp(36px, 5vw, 56px) 0 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(184px, 42vw), 1fr)); gap: clamp(36px, 4vw, 56px) clamp(18px, 2.6vw, 34px); }
.card[hidden] { display: none; }
.card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.card-link:hover { text-decoration: none; }
.card-art { display: block; transition: scale .6s var(--spring); transform-origin: 50% 80%; }
.card-art .cover { transition: box-shadow .6s var(--ease), translate .6s var(--spring); }
.card-link:hover .card-art .cover { box-shadow: var(--cover-shadow-hi); translate: 0 -6px; }
.card-link:active .card-art { scale: .97; transition-duration: .15s; }
.card-title { margin-top: 18px; font-weight: 600; font-size: 1.0625rem; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; }
.card-meta { margin-top: 5px; font-size: .875rem; line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
.card-go { margin-top: 10px; font-size: .875rem; font-weight: 600; color: var(--ink-3); }
.card-go.is-vault { color: var(--gold); }
.empty { margin: 40px 0 0; color: var(--ink-2); font-size: 1.0625rem; }

/* ---------- about ---------- */
.about { padding-top: clamp(96px, 13vw, 168px); padding-bottom: clamp(96px, 12vw, 150px); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 64px; align-items: end; }
.about .sec-title { font-size: clamp(1.875rem, 4vw, 3rem); }
.about-body p { margin: 0 0 14px; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.55; }
.about-body p:last-child { margin: 0; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); background: var(--canvas); font-size: .875rem; color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px 48px; padding-top: 44px; padding-bottom: 28px; }
.foot-brand .logo svg { height: 26px; }
.foot-brand p { margin: 14px 0 0; line-height: 1.5; }
.foot-nav { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 40px; align-content: start; }
.foot-nav a { text-decoration: none; }
.foot-nav a:hover { color: var(--ink); }
.foot-fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--ink-3); }

/* ---------- book page ---------- */
.book-wrap { padding-top: 22px; padding-bottom: clamp(80px, 10vw, 130px); }
.back { display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; font-size: .9375rem; font-weight: 500; text-decoration: none; color: var(--ink-2); padding: 6px 4px; transition: color .2s; }
.back .i { width: 18px; height: 18px; stroke-width: 2.2; transition: translate .4s var(--spring); }
.back:hover { color: var(--ink); text-decoration: none; }
.back:hover .i { translate: -3px 0; }
.book { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 7vw, 100px); margin-top: clamp(20px, 4vw, 44px); align-items: start; }
.book-art { position: sticky; top: calc(var(--bar-h) + 36px); display: grid; justify-items: center; }
.art-stage { width: min(100%, 400px); transform-style: preserve-3d; will-change: transform; }
.art-stage .cover { view-transition-name: var(--vt); box-shadow: var(--cover-shadow-hi); }
.floor { width: 74%; height: 26px; margin-top: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.22), transparent); filter: blur(6px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .floor { background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) 45%, transparent), transparent); filter: blur(14px); } }
:root[data-theme="dark"] .floor { background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) 45%, transparent), transparent); filter: blur(14px); }
.book-copy h1 { margin-top: 10px; font-size: clamp(2.375rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 650; text-wrap: balance; }
.book-copy .sub { margin: 18px 0 0; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.45; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }

/* the unlock panel */
.unlock { margin-top: clamp(28px, 4vw, 40px); background: var(--surface); border-radius: 26px; padding: clamp(22px, 3.6vw, 36px); box-shadow: var(--panel-shadow); }
.unlock-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.unlock-head h2 { font-size: 1.375rem; letter-spacing: -.03em; }
.unlock-time { margin: 0; font-size: .875rem; color: var(--ink-3); }
.progress { list-style: none; margin: 18px 0 28px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.progress .bar { display: block; height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .8s var(--ease); }
.progress li.is-done .bar i { transform: scaleX(1); }
.progress li.is-active .bar i { transform: scaleX(.16); }
.progress li:last-child.is-done .bar i { background: var(--gold); }
.progress .lbl { display: flex; align-items: center; gap: 5px; margin-top: 9px; font-size: .8125rem; font-weight: 500; color: var(--ink-3); transition: color .3s; }
.progress .lbl .i { width: 0; height: 13px; stroke-width: 2.6; opacity: 0; transition: width .4s var(--spring), opacity .3s; }
.progress li.is-done .lbl, .progress li.is-active .lbl { color: var(--ink); }
.progress li.is-done .lbl .i { width: 13px; opacity: 1; }
.panes { position: relative; margin: -6px; padding: 6px; transition: height .5s var(--ease); overflow: clip; }
.pane h3 { font-size: 1.125rem; letter-spacing: -.02em; }
.pane .hint { margin: 6px 0 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.5; max-width: 34em; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.field { position: relative; flex: 1 1 250px; display: block; }
.input { width: 100%; height: 52px; border-radius: 14px; border: 1px solid var(--rule-2); background: var(--well); padding: 0 16px; color: var(--ink);
  font: 500 1.0625rem var(--sans); letter-spacing: -.01em; transition: border-color .2s, box-shadow .25s, background-color .25s; }
.input::placeholder { color: var(--ink-3); font-weight: 400; }
.input:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.input.code { font: 500 1.0625rem var(--mono); letter-spacing: .08em; text-transform: uppercase; padding-right: 48px; }
.field-ok { position: absolute; right: 14px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; transform: scale(0); transition: transform .5s var(--spring); }
.field-ok .i { width: 16px; height: 16px; stroke-width: 2.8; }
.field.is-ok .input { border-color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.field.is-ok .field-ok { transform: scale(1); }
.field.is-bad .input { border-color: var(--danger); }
.shake { animation: shake .44s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { translate: -2px 0; } 20%, 80% { translate: 4px 0; } 30%, 50%, 70% { translate: -8px 0; } 40%, 60% { translate: 8px 0; } }
.btn-lock .lock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.btn-lock .shackle { transform-box: fill-box; transform-origin: 100% 100%; transition: transform .55s var(--spring); }
.btn-lock.is-open .shackle { transform: translateY(-2px) rotate(32deg); }
.btn-lock.is-open { background: var(--ok); color: #fff; opacity: 1; }
.spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-busy .spin { display: block; }
@keyframes spin { to { rotate: 1turn; } }
.msg { margin: 10px 0 0; min-height: 1.45em; font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.msg.err { color: var(--danger); font-weight: 500; }
.consent { margin: 8px 0 0; font-size: .8125rem; line-height: 1.55; color: var(--ink-3); max-width: 38em; }
.consent a { color: var(--ink-2); }
.sent { display: flex; gap: 20px; align-items: center; }
.sent p { margin: 6px 0 0; color: var(--ink-2); line-height: 1.5; }
.sent strong { color: var(--ink); font-weight: 600; word-break: break-word; }
.envelope { width: 96px; height: 72px; flex: none; overflow: visible; }
.envelope path, .envelope rect { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.envelope .env-body { fill: var(--surface); }
.envelope .env-lines { stroke: var(--ink-3); stroke-width: 1.8; }
.envelope .env-seal { fill: var(--gold); stroke: none; transform-box: fill-box; transform-origin: center; }
.envelope .env-letter, .envelope .env-lines { transition: translate .7s var(--ease) .1s; }
.sent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
.small { margin: 16px 0 0; font-size: .8125rem; color: var(--ink-3); line-height: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .pane.is-arriving .env-letter, .pane.is-arriving .env-lines { animation: tuck .9s var(--ease) both; }
  .pane.is-arriving .env-seal { animation: stamp .6s var(--spring) .75s both; }
}
@keyframes tuck { from { translate: 0 -14px; } to { translate: 0 10px; } }
@keyframes stamp { from { scale: 1.9; opacity: 0; } to { scale: 1; opacity: 1; } }

/* what is inside */
.inside { margin-top: clamp(56px, 8vw, 88px); }
.inside h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.inside > p { margin: 10px 0 0; color: var(--ink-2); max-width: 36em; line-height: 1.5; }
.contents { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.contents li { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); column-gap: 12px; align-content: start; padding: 18px 0; border-top: 1px solid var(--rule); }
.contents .n { grid-row: span 2; font-size: 1.625rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.contents .k { font-weight: 600; letter-spacing: -.015em; }
.contents .d { margin-top: 3px; font-size: .9375rem; line-height: 1.45; color: var(--ink-2); }
.buy { margin: 36px 0 0; font-size: .9375rem; color: var(--ink-2); }

/* welcome: the end of the task gets the best moment */
.done-check { width: 64px; height: 64px; margin-bottom: 22px; }
.done-check .dc-ring { fill: none; stroke: var(--ok); stroke-width: 3; stroke-dasharray: 183; stroke-dashoffset: 0; transform-origin: center; rotate: -90deg; }
.done-check .dc-tick { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .done-check { animation: pop .7s var(--spring) .9s both; }
  .done-check .dc-ring { animation: draw-ring .8s var(--ease) .1s both; }
  .done-check .dc-tick { animation: draw-tick .45s var(--ease) .7s both; }
}
@keyframes draw-ring { from { stroke-dashoffset: 183; } }
@keyframes draw-tick { from { stroke-dashoffset: 40; } }
@keyframes pop { 0% { scale: 1; } 40% { scale: 1.12; } 100% { scale: 1; } }
.welcome .dl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.welcome h2 { font-size: 1.375rem; letter-spacing: -.03em; }
.dl-meta { margin: 4px 0 0; color: var(--ink-2); font-size: .9375rem; }
.quick-title { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--rule); font-size: 1rem; letter-spacing: -.015em; }
.quick { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 18px; }
.quick li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
.qn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--btn); color: var(--btn-ink); font: 600 .8125rem/1 var(--sans); }
.quick h4 { font-size: 1rem; letter-spacing: -.015em; line-height: 30px; }
.quick p { margin: 2px 0 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.5; }

/* ---------- text pages ---------- */
.prose { max-width: 42rem; padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(80px, 10vw, 120px); }
.prose h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -.045em; line-height: 1.04; margin: 0 0 28px; }
.prose h2 { font-size: 1.25rem; letter-spacing: -.02em; margin: 40px 0 8px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.6; }
.prose .fill { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--ink); padding: 1px 6px; border-radius: 6px; }
.notfound { padding: clamp(64px, 12vw, 140px) 0 clamp(96px, 12vw, 160px); max-width: 36rem; }
.notfound h1 { margin-top: 12px; font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -.045em; line-height: 1.04; }
.notfound p { color: var(--ink-2); font-size: 1.125rem; }

/* ---------- motion: one orchestrated entrance, then scroll-linked reveals ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .ln { animation: rise 1.1s var(--ease) both; }
  .hero h1 .ln + .ln { animation-delay: .09s; }
  .hero .lede { animation: rise 1.1s var(--ease) .2s both; }
  .stage { animation: stage-in 1.4s var(--ease) .28s both; }
  .p-book .book-art, .p-welcome .book-art { animation: lift 1.2s var(--ease) both; }
  .p-book .book-copy > *, .p-welcome .book-copy > * { animation: rise 1s var(--ease) both; }
  .p-book .book-copy > :nth-child(2), .p-welcome .book-copy > :nth-child(2) { animation-delay: .05s; }
  .p-book .book-copy > :nth-child(3), .p-welcome .book-copy > :nth-child(3) { animation-delay: .1s; }
  .p-book .book-copy > :nth-child(4), .p-welcome .book-copy > :nth-child(4) { animation-delay: .16s; }
  .p-book .book-copy > :nth-child(n+5), .p-welcome .book-copy > :nth-child(n+5) { animation-delay: .22s; }
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
    .grid .card { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
  }
}
@keyframes rise { from { opacity: 0; translate: 0 22px; filter: blur(10px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes stage-in { from { opacity: 0; translate: 0 56px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes lift { from { opacity: 0; translate: 0 40px; scale: .94; filter: blur(8px); } to { opacity: 1; translate: 0 0; scale: 1; filter: blur(0); } }
@keyframes reveal { from { opacity: 0; translate: 0 36px; filter: blur(8px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }

/* moving between pages: the cover travels with you */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(root) { animation: .25s var(--ease-in) both vt-out; }
::view-transition-new(root) { animation: .45s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .how-steps { grid-template-columns: 1fr; }
  .how-steps li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .about { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 860px) {
  .book { grid-template-columns: 1fr; gap: 28px; }
  .book-art { position: static; }
  .art-stage { width: min(58vw, 260px); }
  .contents { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stage { --item: min(52vw, 31vh, 230px); --gap: 12px; }
  .flow { padding-top: 22px; padding-bottom: 48px; }
  .caption { margin-top: -28px; }
  .nav .nav-how { display: none; }
  .lib-tools { width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .form-row .btn { width: 100%; }
  .sent { flex-direction: column; align-items: flex-start; gap: 14px; }
  .envelope { width: 80px; height: 60px; }
  .foot-nav { grid-template-columns: 1fr 1fr; gap: 10px 24px; }
}
/* short screens (laptops, small phones): keep the open book and its button on the first screen */
@media (max-height: 800px) and (min-width: 641px) {
  .hero { padding-top: 22px; }
  .hero h1 { font-size: clamp(2.4rem, 4.2vw, 3.6rem); }
  .hero .lede { margin-top: 12px; font-size: 1.125rem; }
  .stage { --item: clamp(140px, 23vh, 220px); margin-top: 4px; }
  .flow { padding-top: 22px; padding-bottom: 44px; }
  .caption { min-height: 120px; margin-top: -28px; }
  .cap-title { font-size: 1.5rem; margin-bottom: 12px; }
}
@media (max-height: 720px) and (max-width: 640px) {
  .hero { padding-top: 22px; }
  .hero h1 { font-size: 2.125rem; }
  .hero .lede { font-size: 1rem; margin-top: 12px; }
  .stage { --item: min(46vw, 27vh); margin-top: 0; }
  .flow { padding-top: 16px; padding-bottom: 40px; }
  .caption { margin-top: -28px; }
  .cap-title { font-size: 1.375rem; margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
