/* Bookgist landing page: Geist Serif (self-hosted, fonts/) for the page, Geist sans for buttons
   and the app UI drawn in cards. Black, white and grey.
   All colour comes from book covers, the tile art (art/) and real app screens (screens/). */
/* Geist Serif ships one weight (400); weights 450-550 below fall back to it. */
@font-face {
  font-family: "Geist Serif";
  src: url("/fonts/GeistSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Page */
  --bg: #f5f5f7;
  --white: #ffffff;
  --text: #0a0a0a;
  --text-2: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #000;
  --font: "Geist Serif", "Times New Roman", Times, serif;
  --sans: "Geist", -apple-system, system-ui, sans-serif;
  /* Motion and layout */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --gutter: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
h1, h2, p, blockquote, ol { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--white); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Headings share one voice: heavy, tight, short lines */
.hero-title, .cta h2 {
  font-family: var(--font);
  font-weight: 550;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 22px;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease), background-color 0.3s;
  will-change: transform;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; margin-top: -2px; }
.btn-light { background: var(--accent); color: var(--white); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .5); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -16px rgba(0, 0, 0, .55); }
.btn-light:active { transform: scale(0.98); }
.btn-small { padding: 9px 14px; font-size: 13px; background: var(--accent); color: var(--white); }
.btn-small:hover { transform: scale(1.04); }
.btn-big { padding: 15px 24px; font-size: 15px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; z-index: 50; top: 14px; left: 50%;
  width: min(1180px, calc(100% - 24px));
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 12px;
  border-radius: 999px;
  transition: background-color 0.4s, box-shadow 0.4s, color 0.4s;
}
.nav.on-dark { color: #fff; }
.nav.on-dark .btn-small { background: #fff; color: #000; }
.nav.on-dark.is-stuck { background: rgba(28, 28, 30, .66); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 10px 30px -14px rgba(0,0,0,.5); }
.nav.is-stuck {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px -14px rgba(0,0,0,.25);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 500 15px/1 var(--font); letter-spacing: -0.02em; }
.brand img { border-radius: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh; min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  display: grid; place-items: center;
  background: var(--bg);
}
.hero-gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0; transition: opacity 1.2s var(--ease); }
.gl-ready .hero-gl { opacity: 1; }
.hero::after { /* soft vignette so the table melts into the page */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 38% at 50% 50%, rgba(245,245,247,.82), rgba(245,245,247,0) 100%),
    linear-gradient(180deg, var(--bg) 0, rgba(245,245,247,0) 16%, rgba(245,245,247,0) 80%, var(--white) 100%);
}
.no-gl.hero { background: var(--bg); }
.hero-center { position: relative; text-align: center; padding: 96px var(--gutter) 40px; display: flex; flex-direction: column; align-items: center; }


.hero-title {
  font-size: clamp(34px, 4.2vw, 64px);
  line-height: 1.06;
  max-width: 15ch;
}
.hero-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.hero-title .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 55ms + 150ms); }
.is-loaded .hero-title .w > span { transform: none; }
.hero-lede { margin-top: 20px; max-width: 42ch; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.5; color: var(--text-2); letter-spacing: -0.01em; }
.hero-actions { margin-top: 34px; display: flex; justify-content: center; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--text-2); }

.load-in { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); transition-delay: var(--d, 0ms); }
.is-loaded .load-in { opacity: 1; transform: none; }



/* ---------- CTA: one big orange panel ---------- */
.cta {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 var(--gutter) var(--gutter);
  border-radius: clamp(28px, 4vw, 48px);
  background: #000; color: var(--white);
  text-align: center;
  padding: clamp(90px, 12vw, 160px) var(--gutter) clamp(80px, 10vw, 130px);
  display: flex; flex-direction: column; align-items: center;
}
.cta-icon { position: relative; width: 92px; height: 92px; border-radius: 21px; overflow: hidden; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
.cta-icon img { width: 100%; height: 100%; }
.cta-glare { position: absolute; inset: 0; background: radial-gradient(60% 50% at var(--gx, 30%) var(--gy, 20%), rgba(255,255,255,.3), transparent 60%); mix-blend-mode: soft-light; }
.cta h2 { margin: 28px 0 28px; font-size: clamp(30px, 3.8vw, 56px); line-height: 1.08; max-width: 16ch; }
.cta > p { margin: 14px auto 30px; max-width: 42ch; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.5; color: rgba(255,255,255,.85); }
.cta .btn-light { background: var(--white); color: #000; box-shadow: none; }

.foot { color: var(--text-2); font-size: 13px; padding: 8px calc(var(--gutter) * 2) calc(32px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 40px; }

/* ---------- Device: a real screen in a titanium frame. --w sets everything ---------- */
.iphone {
  --w: 300px;
  position: relative; flex: none;
  width: var(--w);
  padding: calc(var(--w) * .024);
  border-radius: calc(var(--w) * .158);
  background: linear-gradient(135deg, #8d8983 0%, #3a3835 14%, #232220 50%, #3a3835 86%, #7e7a74 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .22),
    inset 0 0 0 calc(var(--w) * .008) #0a0908,
    0 2px 3px rgba(30, 15, 10, .3),
    0 40px 80px -30px rgba(30, 15, 10, .55);
}
.iphone-screen {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 1320 / 2868;
  border-radius: calc(var(--w) * .134);
  background: #f7f2e8;
  container-type: inline-size;
}
.iphone-screen::after { /* Dynamic Island */
  content: ""; position: absolute; z-index: 5; top: 2.5cqw; left: 50%; translate: -50% 0;
  width: 30cqw; height: 8.6cqw; border-radius: 99px; background: #000;
}
.iphone-screen > img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Headings: Geist Serif only; a second line in grey ---------- */
.ch-head h2, .panel-invite h2, .more-title {
  font-family: var(--font); font-weight: 550; letter-spacing: -0.015em; line-height: 1.08; margin: 0;
}
.ch-head em { display: block; font-style: normal; color: var(--muted); text-wrap: balance; }

/* ---------- The walkthrough ---------- */
.tour { height: 640vh; background: #fff; }
.tour-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: clamp(32px, 6vw, 110px);
  padding: 56px clamp(24px, 6vw, 110px) 0;
  background: #fff;
}
.tour-index { list-style: none; margin: 0; padding: 0; justify-self: start; display: grid; gap: 2px; }
.tour-index button {
  border: 0; background: none; cursor: pointer; padding: 5px 0; text-align: left;
  font: 500 clamp(15px, 1.25vw, 18px)/1.2 var(--font); letter-spacing: -0.015em; color: #aeaeb2; transition: color .3s var(--ease);
}
.tour-index button:hover { color: #6e6e73; }
.tour-index button[aria-current="step"] { color: #000; }
.tour-device { position: relative; transform: translateY(var(--dev-y, 0)) scale(var(--dev-s, 1)); transform-origin: 50% 0; will-change: transform; }
.tour-device .iphone { --w: min(calc((100svh - 128px) * .452), 380px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), inset 0 0 0 calc(var(--w) * .008) #0a0908, 0 40px 80px -36px rgba(0,0,0,.45); }
.tour-screen { position: absolute; inset: 0; overflow: hidden; background: #f7f2e8; opacity: 0; transform: translateY(4%) scale(.985); transition: opacity .5s var(--ease), transform .7s var(--ease); }
.tour-screen.is-active { opacity: 1; transform: none; }
.tour-screen.is-past { transform: translateY(-3%) scale(.985); }
.tall { position: absolute; top: 0; left: 0; width: 100%; height: auto; max-width: none; will-change: transform; transform: translate3d(0, var(--scroll, 0), 0); }
.fixed-top { position: absolute; top: 0; left: 0; width: 100%; }
.fixed-tab { position: absolute; left: 4.55%; width: 90.9%; top: 91.1%; filter: drop-shadow(0 2px 8px rgba(0,0,0,.14)); }
.shot-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease); }
.shot-layer.is-on { opacity: 1; }

.tour-copy { position: relative; min-height: 240px; max-width: 340px; }
.tour-copy article { position: absolute; inset: 50% 0 auto; transform: translateY(calc(-50% + 16px)); opacity: 0; transition: opacity .4s var(--ease), transform .7s var(--ease); pointer-events: none; }
.tour-copy article.is-active { opacity: 1; transform: translateY(-50%); }
.tour-copy h3 { margin: 0; font: 550 clamp(22px, 1.9vw, 28px)/1.14 var(--font); letter-spacing: -0.012em; text-wrap: balance; }
.tour-copy p { margin-top: 10px; font-size: clamp(15px, 1.1vw, 17px); line-height: 1.42; letter-spacing: -0.01em; color: var(--text-2); }

/* ---------- Chapters ---------- */
.chapter { position: relative; background: #fff; color: #000; --muted: var(--text-2); padding: clamp(88px, 12vw, 170px) var(--gutter) clamp(64px, 8vw, 110px); }
.chapter > * { max-width: 1240px; margin-inline: auto; }
.chapter-dark { background: #000; color: #fff; --muted: rgba(255, 255, 255, .62); }
.ch-head { margin-bottom: clamp(36px, 5vw, 64px); }
.chapter-photos { padding-top: clamp(16px, 2vw, 24px); }
.ch-head h2 { font-size: clamp(30px, 4vw, 60px); }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.span-12 { grid-column: span 12; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
.panel {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: clamp(26px, 3vw, 40px);
  padding: clamp(26px, 3.2vw, 44px);
  min-height: clamp(420px, 42vw, 580px);
  display: flex; flex-direction: column;
}
.panel h3 { margin: 0; font: 500 clamp(17px, 1.35vw, 20px)/1.2 var(--font); letter-spacing: -0.02em; text-wrap: balance; }
.panel-text p { margin-top: 12px; max-width: 42ch; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.42; letter-spacing: -0.01em; color: var(--muted); }
.panel-grey { background: #f5f5f7; }
.panel-ink { background: #161617; }

.panel-cafe { grid-row: span 2; min-height: 0; }

.covers { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 20px); margin-bottom: clamp(24px, 4vw, 56px); }
.covers img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 6px 6px 2px; box-shadow: 0 18px 26px -18px rgba(0,0,0,.5); }


.chapter-dark { padding-bottom: clamp(72px, 9vw, 120px); }

/* Custom cards: the app's content, drawn for the page. App UI is in Geist sans, like the buttons. */
.card-thread, .task { font-family: var(--sans); }
.bento-ask { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: 1fr 1fr; }
.card { border-radius: clamp(26px, 3vw, 40px); background: #161617; padding: clamp(24px, 3vw, 40px); overflow: hidden; }
.card h3 { margin: 0; font: 500 clamp(17px, 1.35vw, 20px)/1.2 var(--font); letter-spacing: -0.02em; text-wrap: balance; }
.card-thread { grid-row: span 2; display: flex; flex-direction: column; gap: 20px; }
.bubble { align-self: flex-end; max-width: 78%; padding: 13px 18px; border-radius: 22px 22px 6px 22px; background: #fff; color: #000; font-size: clamp(15px, 1.1vw, 16px); line-height: 1.36; letter-spacing: -0.005em; }
.reading { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.stack { display: flex; }
.stack img { width: 20px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 3px 3px 2px; margin-right: -9px; box-shadow: 0 0 0 2px #161617; }
.stack img:last-child { margin-right: 0; }
.direct { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.24; font-weight: 500; letter-spacing: -0.02em; text-wrap: pretty; }
.points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; font-size: clamp(14px, 1.05vw, 15px); line-height: 1.45; letter-spacing: -0.005em; color: var(--muted); }
.points li { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); }
.points b { color: #fff; font-weight: 500; }
.cite { display: block; width: fit-content; margin-top: 9px; padding: 5px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; }
.card-thread.pre > *, .card-thread.pre .points li { opacity: 0; transform: translateY(14px); }
.card-thread > *, .points li { transition: opacity .6s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 280ms); }

.card-week { background: #fff; color: #000; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.task { display: flex; gap: 14px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: 450 clamp(16px, 1.3vw, 19px)/1.34 var(--sans); letter-spacing: -0.012em; }
.task i { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #000; transition: background-color .25s var(--ease); position: relative; }
.task i::after { content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .35s var(--ease-spring); }
.task span { background: linear-gradient(#000, #000) 0 56% / 0 1.5px no-repeat; transition: background-size .5s var(--ease), color .3s; }
.task[aria-pressed="true"] i { background: #000; }
.task[aria-pressed="true"] i::after { transform: rotate(45deg) scale(1); }
.task[aria-pressed="true"] span { color: #8e8e93; }

.card-sources { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.fan { position: relative; height: clamp(150px, 15vw, 190px); }
.fan img { position: absolute; left: 50%; bottom: 0; width: clamp(92px, 9.4vw, 118px); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 6px 6px 3px; box-shadow: 0 18px 28px -14px #000; transform-origin: 50% 120%; transform: translateX(-50%) rotate(var(--a)); transition: transform .6s var(--ease-spring); }
.card-sources:hover .fan img { transform: translateX(-50%) rotate(calc(var(--a) * 1.6)); }

/* ---------- Made for readers: five tiles ---------- */
.bento-more { grid-auto-rows: minmax(clamp(460px, 42vw, 580px), auto); }
.fx-ai { grid-column: span 8; } .fx-night { grid-column: span 4; }
.fx-ipad { grid-column: 1 / -1; }
.fx-new, .fx-request { grid-column: span 6; }
.bento-more .panel { min-height: 0; }
.fx-text h3 { transition: color .9s var(--ease); }

/* AI: a page from the reader with the book's chat over it */
.ai-stage { position: relative; flex: 1; min-height: 400px; margin: 26px calc(clamp(26px, 3.2vw, 44px) * -1) calc(clamp(26px, 3.2vw, 44px) * -1) 0; }
.ai-page {
  position: absolute; left: 0; top: 0; bottom: 0; width: 56%; opacity: 0; transition: opacity .5s var(--ease);
  padding: 18px 24px; border-radius: 20px 20px 0 0; overflow: hidden;
  background: #f7f2e8; color: #1f1716;
  font: 400 clamp(14px, 1.08vw, 16px)/1.5 ui-serif, "New York", Georgia, serif;
}
.ai-page.is-on { opacity: 1; }
.ai-page::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, #f7f2e8); }
.ai-page p + p { margin-top: .7em; }
.ai-page-bar { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid rgba(31, 23, 22, .14); font: 400 12px/1 var(--sans); color: rgba(31, 23, 22, .56); }
.ai-page h4 { margin: 18px 0 8px; font: 500 1.16em/1.22 ui-serif, "New York", Georgia, serif; }
.ai-sheet {
  position: absolute; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 2vw, 28px); width: 58%;
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 18px 16px; border-radius: 24px; background: #fff; font-family: var(--sans);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 34px 60px -28px rgba(0, 0, 0, .4);
}
.ai-book { margin-bottom: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.ai-book img { width: 20px; height: 30px; object-fit: cover; border-radius: 2px 3px 3px 2px; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); }
.ai-talk { display: grid; }
.ai-turn { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 14px; visibility: hidden; }
.ai-turn.is-on { visibility: visible; }
.ai-q { align-self: flex-end; max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 5px 18px; background: #000; color: #fff; font-size: 14px; line-height: 1.32; letter-spacing: -0.005em; opacity: 0; transform: translateY(8px); }
.ai-a { font-size: clamp(14px, 1.1vw, 16px); line-height: 1.42; letter-spacing: -0.008em; }
.ai-a span { opacity: 0; }
.ai-turn.is-on .ai-q { opacity: 1; transform: none; transition: opacity .35s var(--ease), transform .5s var(--ease); }
.ai-turn.is-on .ai-a span { opacity: 1; transition: opacity .3s linear; transition-delay: calc(var(--i) * 38ms + 450ms); }
.ai-pre .ai-q, .ai-pre .ai-a span { opacity: 0 !important; transition: none !important; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips button { border: 0; cursor: pointer; padding: 8px 12px; border-radius: 99px; background: #f0f0f2; color: #3a3a3c; font: 450 12.5px/1 var(--sans); letter-spacing: -0.005em; transition: background-color .2s, color .2s; }
.ai-chips button:hover { background: #e5e5ea; }
.ai-chips button[aria-pressed="true"] { background: #000; color: #fff; }

/* iPad: the real screen, running off the tile */
.fx-ipad { padding-bottom: 0; }
.ipad {
  width: min(100%, 940px); margin: clamp(24px, 3vw, 40px) auto -9%; padding: 12px; flex: none;
  border-radius: 30px; background: #111;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 40px 70px -34px rgba(0, 0, 0, .55);
}
.ipad img { width: 100%; height: auto; border-radius: 20px; }

/* Night Mode: the tile goes dark with the phone */
.fx-night { background: #f5f5f7; transition: background-color .9s var(--ease); padding-bottom: 0; }
.fx-night .iphone { --w: clamp(220px, 21vw, 270px); margin: auto auto calc(var(--w) * -1); padding-top: calc(var(--w) * .024); flex: none; }
.fx-text + .night-switch + .iphone { margin-top: 44px; }
.fx-night.is-night { background: #000; }
.fx-night.is-night h3 { color: #fff; }
.fx-night.is-night .fx-night.is-night .iphone { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 0 0 1px rgba(255, 255, 255, .06); }
.night-page {
  --p: #f7f2e8; --t: #1f1716; --d: rgba(31, 23, 22, .56); --l: rgba(31, 23, 22, .14);
  position: absolute; inset: 0; padding: 0 6cqw; overflow: hidden; background: var(--p); color: var(--t);
  font: 400 4.5cqw/1.48 ui-serif, "New York", Georgia, serif; transition: background-color .9s var(--ease), color .9s var(--ease);
}
.is-night .night-page { --p: #141211; --t: #ece5da; --d: rgba(236, 229, 218, .56); --l: rgba(236, 229, 218, .16); }
.night-page p + p { margin-top: .6em; }
.np-status { height: 13.5cqw; padding: 5.6cqw 5cqw 0; font: 600 4cqw/1 var(--sans); }
.np-bar { margin: 0 -6cqw; padding: 2cqw 0 3.4cqw; display: flex; flex-direction: column; align-items: center; gap: .6cqw; border-bottom: 1px solid var(--l); font: 400 2.9cqw/1.2 var(--sans); color: var(--d); }
.np-bar b { font: 500 3.4cqw/1.2 ui-serif, "New York", Georgia, serif; color: var(--t); }
.np-kicker { margin-top: 6cqw; font: 500 2.7cqw/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--d); }
.np-title { margin: 2cqw 0 0; font: 500 8cqw/1.15 ui-serif, "New York", Georgia, serif; }
.night-page .np-by { margin: 1cqw 0 7cqw; font-style: italic; font-size: 3.9cqw; color: var(--d); }
.np-lead { font-variant: small-caps; letter-spacing: .03em; }
.night-page h5 { margin: 1.1em 0 .35em; font: 500 5.6cqw/1.2 ui-serif, "New York", Georgia, serif; }
.night-switch { position: absolute; top: clamp(24px, 3vw, 42px); right: clamp(24px, 3vw, 42px); width: 52px; height: 30px; padding: 0; border: 0; border-radius: 99px; background: #d9d9de; cursor: pointer; transition: background-color .5s var(--ease); }
.night-switch::before { content: ""; position: absolute; inset: -7px 0; } /* 44pt target */
.night-switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .5s var(--ease-spring), background-color .5s; }
.night-switch i::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #000; transition: box-shadow .5s var(--ease), background-color .5s; }
.is-night .night-switch { background: #3a3a3c; }
.is-night .night-switch i { transform: translateX(22px); background: #000; }
.is-night .night-switch i::after { inset: 5px; background: transparent; box-shadow: inset -3px -2px 0 0 #fff; } /* a crescent */

/* New books land on the pile */
.pile { position: relative; flex: 1; min-height: 300px; margin-top: 12px; }
.pile img {
  position: absolute; left: 50%; top: 50%; width: clamp(128px, 12.4vw, 164px); aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 3px 7px 7px 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 22px 30px -18px rgba(0, 0, 0, .55);
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--a));
}
.pile img.is-landing { animation: land .85s var(--ease) both; }
@keyframes land {
  from { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) - 46%)) rotate(calc(var(--a) * -1.4)) scale(1.14); }
  35% { opacity: 1; }
}

/* A request, from search to reading it. .req data-step: 0 typing, 1 found, 2 writing, 3 added, 4 reading */
.req { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; margin-top: 24px; font-family: var(--sans); }
.req-search { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05); font-size: 15px; letter-spacing: -0.01em; }
.req-search svg { flex: none; width: 15px; height: 15px; fill: none; stroke: #8e8e93; stroke-width: 1.6; stroke-linecap: round; }
.req-search i { width: 1.5px; height: 17px; margin-left: -6px; background: #000; opacity: 0; }
.req[data-step="0"] .req-search i { opacity: 1; }
.req-label { position: relative; margin-top: 10px; height: 14px; font-size: 12px; font-weight: 500; line-height: 14px; color: var(--text-2); }
.req-label span { position: absolute; left: 4px; transition: opacity .4s; }
.req-label span + span { opacity: 0; }
.req[data-step="3"] .req-label span { opacity: 0; }
.req[data-step="3"] .req-label span + span { opacity: 1; }
.req-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 24px 40px -28px rgba(0, 0, 0, .4); transition: opacity .45s var(--ease), transform .6s var(--ease); }
.req-row img { flex: none; width: clamp(72px, 7vw, 92px); aspect-ratio: 1; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 12px -6px rgba(0, 0, 0, .45); }
.req-book { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--text-2); letter-spacing: -0.005em; }
.req-book b { color: #000; font: 400 17px/1.2 var(--font); letter-spacing: -0.012em; }
.req-bar { height: 2px; margin-top: 10px; border-radius: 2px; background: #e5e5ea; overflow: hidden; opacity: 0; transition: opacity .3s; }
.req-bar i { display: block; height: 100%; width: 100%; background: #000; transform: scaleX(0); transform-origin: 0 50%; }
.req[data-step="2"] .req-bar { opacity: 1; }
.req[data-step="2"] .req-bar i { transform: none; transition: transform 2.3s cubic-bezier(.3, .1, .4, 1); }
.req-btn { position: relative; flex: none; width: 66px; height: 32px; border-radius: 99px; background: #000; color: #fff; font-size: 12.5px; font-weight: 500; transition: background-color .3s, color .3s; }
.req-btn span { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .3s; }
.req[data-step="1"] .req-btn span:nth-child(1), .req[data-step="0"] .req-btn span:nth-child(1), .req[data-step="2"] .req-btn span:nth-child(2), .req[data-step="3"] .req-btn span:nth-child(3) { opacity: 1; }
.req[data-step="2"] .req-btn { background: #f0f0f2; color: #6e6e73; }
.req-reader {
  position: absolute; inset: 0 0 calc(clamp(26px, 3.2vw, 44px) * -1); padding: 16px 20px 0; border-radius: 22px 22px 0 0; overflow: hidden;
  background: #f7f2e8; color: #1f1716; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 -20px 40px -28px rgba(0, 0, 0, .35);
  font: 400 clamp(14px, 1.1vw, 16px)/1.5 ui-serif, "New York", Georgia, serif;
  opacity: 0; transform: translateY(44px); pointer-events: none; transition: opacity .35s var(--ease), transform .7s var(--ease);
}
.req[data-step="4"] .req-reader { opacity: 1; transform: none; }
.req[data-step="3"] .req-btn { animation: tap 1.5s var(--ease) both; }
@keyframes tap { 0%, 72% { transform: none; } 84% { transform: scale(.9); } 100% { transform: none; } }
.req-reader-bar { display: flex; justify-content: space-between; font: 400 12px/1 var(--sans); color: rgba(31, 23, 22, .56); }
.req-reader-line { height: 1px; margin: 12px 0 16px; background: rgba(31, 23, 22, .14); }
.req-reader-line i { display: block; height: 100%; width: 34%; background: #1f1716; transform: scaleX(.12); transform-origin: 0 50%; }
.req[data-step="4"] .req-reader-line i { transform: none; transition: transform 3.8s linear .4s; }
.req-reader h4 { margin: 0 0 8px; font: 500 1.14em/1.22 ui-serif, "New York", Georgia, serif; }
.req-reader p + h4 { margin-top: 16px; }
.req-lead { font-variant: small-caps; letter-spacing: .03em; }
.req[data-step="0"] .req-row, .req[data-step="0"] .req-label { opacity: 0; }
.req[data-step="0"] .req-row { transform: translateY(10px); }

/* Goals: what a reader wants, and the book to start with */
.tile { position: relative; display: block; overflow: hidden; border-radius: clamp(22px, 2.6vw, 34px); background: #f1f0ed; aspect-ratio: 1; color: #000; text-decoration: none; }
.tile-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: translateY(14%); transition: transform .9s var(--ease); }
.tile-lead .tile-art { transform: translateY(20%) scale(.86); }
.tile:hover .tile-art { transform: translateY(11%); }
.tile-lead:hover .tile-art { transform: translateY(17%) scale(.86); }
.tile > div { position: absolute; top: 0; left: 0; right: 0; padding: clamp(18px, 2.2vw, 30px); }
.tile h3 { margin: 0; font: 500 clamp(18px, 1.6vw, 22px)/1.18 var(--font); letter-spacing: -0.015em; text-wrap: balance; }
.tile-start { display: flex; align-items: center; gap: 10px; margin-top: 14px; font: 450 13px/1.25 var(--sans); letter-spacing: -0.005em; color: #55555a; }
.tile-covers { flex: none; display: flex; }
.tile-covers img { width: 26px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 3px 3px 2px; margin-right: -11px; box-shadow: 0 0 0 1.5px #f1f0ed, 0 4px 8px -3px rgba(0, 0, 0, .4); }
.tile-covers img:last-child { margin-right: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .tour { height: 580vh; }
  .tour-sticky { display: block; padding: 0 20px; }
  .tour-index { display: none; }
  .tour-copy { position: absolute; top: 92px; left: 20px; right: 20px; max-width: 560px; min-height: 0; }
  .tour-copy article { inset: 0 0 auto; transform: translateY(14px); }
  .tour-copy article.is-active { transform: none; }
  .tour-copy h3 { font-size: clamp(21px, 5.6vw, 26px); }
  .tour-copy p { margin-top: 6px; font-size: 15px; line-height: 1.38; }
  .tour-device { position: absolute; left: 50%; top: 214px; margin-left: calc(var(--dw) / -2); --dw: min(76vw, calc((100svh - 200px) * .62), 340px); }
  .tour-device .iphone { --w: var(--dw); }

  .span-12, .span-7, .span-6, .span-5 { grid-column: 1 / -1; }
  .bento-ask { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .card-thread { grid-row: auto; }
  .bento-more { grid-auto-rows: auto; }
  .fx-ai, .fx-ipad, .fx-request { grid-column: 1 / -1; }
  .fx-night, .fx-new { grid-column: span 6; min-height: 460px; }
  .fx-request .req { margin-top: 36px; min-height: 340px; }
  .covers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .covers img:nth-child(n + 17) { display: none; }
  .span-4 { grid-column: span 6; }
  .panel { min-height: 0; }
        .foot { padding-left: var(--gutter); padding-right: var(--gutter); }
}
@media (max-width: 640px) {
  .fx-night, .fx-new, .tile { grid-column: 1 / -1; }
  /* The chat comes first; the page sits behind it as a strip */
  .ai-stage { margin-right: 0; margin-bottom: 0; min-height: 0; padding-top: 72px; }
  .ai-page { width: 100%; bottom: auto; height: 160px; border-radius: 18px; }
  .ai-page.is-on { opacity: 1; }
  .ai-page h4, .ai-page p:not(.ai-page-bar) { display: none; }
  .ai-sheet { position: relative; inset: auto; width: 100%; margin-top: -8px; }
}
@media (max-height: 640px) and (max-width: 900px) {
  .tour-copy p { display: none; }
  .tour-device { top: 170px; --dw: min(64vw, 280px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .hero-title .w > span, .load-in { transform: none; opacity: 1; }
}
