@font-face {
  font-family: 'Newsreader';
  src: url('newsreader.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #cdd0d4;
  --ink: #16181c;
  --muted: #4c525b;
  --faint: #6c727b;
  --rule: rgba(22, 24, 28, 0.16);
  --panel: rgba(226, 228, 231, 0.9);
  --hl: #ffd43a;
  --read: #3982ff;
  --compare: #54c74b;
  --contrast: #f08e2f;
  --write: #c83af1;
  --ins: #2f6fe4;
  --del: #d8443a;
  --serif: 'Newsreader', Georgia, serif;
  --sans: system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --gut: clamp(1rem, 5.5vw, 6.5rem);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0f1114;
  --ink: #ecebe7;
  --muted: #b4b7bc;
  --faint: #8d9198;
  --rule: rgba(236, 235, 231, 0.18);
  --panel: rgba(15, 17, 20, 0.84);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); transition: background-color 0.6s; }
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.scene-ready #scene { opacity: 1; }

#content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--read); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header ---------- */
.top {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem var(--gut);
  font-size: 0.9rem;
  transition: background-color 0.4s, box-shadow 0.4s;
}
.top.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 1px 0 var(--rule);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 1.35rem/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.top nav { display: flex; gap: 1.5rem; }
.top nav a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.top nav a:hover { color: var(--ink); }
.controls { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.ctl {
  appearance: none;
  white-space: nowrap;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  height: 2.2rem;
  padding: 0 0.9rem;
  border-radius: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.ctl:hover { background: var(--rule); }
.sound[aria-pressed='true'] { border-color: var(--read); }
.theme { width: 2.2rem; padding: 0; display: grid; place-items: center; }
.theme span {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  height: 3rem;
  padding: 0 1.4rem;
  border-radius: 0.4rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: 500 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}
.btn:hover { background: var(--rule); }
.btn.primary { background: var(--hl); border-color: transparent; color: #16181c; }
.btn.primary:hover { background: #ffdd5c; transform: translateY(-1px); }
.btn.small { height: 2.2rem; padding: 0 1rem; font-size: 0.85rem; border-radius: 1.1rem; }

/* ---------- Sections ---------- */
.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem var(--gut);
}
.copy { width: min(30rem, 36vw); }
.hero .copy { width: min(36rem, 42vw); }

h1, h2 { font-family: var(--serif); color: var(--ink); margin: 0; font-optical-sizing: auto; }
h1 {
  font-weight: 300;
  font-size: clamp(3.6rem, 7.6vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 2.2rem;
}
h1 span { display: block; }
h2 {
  font-weight: 330;
  font-size: clamp(2.4rem, 4.1vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}
p { margin: 0 0 1rem; color: var(--muted); max-width: 34rem; }
.lead { font-size: 1.2rem; line-height: 1.5; color: var(--ink); }
.small, .fine { font-size: 0.875rem; color: var(--faint); }
.cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 2rem 0 1.2rem; }

.mode {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.3rem;
}
.mode::before {
  content: '';
  width: 1.6rem;
  height: 0.55rem;
  border-radius: 0.15rem;
  background: var(--c);
}

/* Hero entrance: the one orchestrated moment, timed with the sheet landing. */
.hero h1 span, .hero .lead, .hero .cta, .hero .fine {
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ready .hero h1 span, .ready .hero .lead, .ready .hero .cta, .ready .hero .fine { opacity: 1; transform: none; }
.ready .hero .l1 { transition-delay: 0.35s; }
.ready .hero .l2 { transition-delay: 0.6s; }
.ready .hero .lead { transition-delay: 1.15s; }
.ready .hero .cta { transition-delay: 1.35s; }
.ready .hero .fine { transition-delay: 1.5s; }

/* Speedread, in step with the voice on the sheet */
.speed {
  margin: 1.8rem 0 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.3rem 0 0.9rem;
}
.speed-words {
  font: 400 clamp(1.8rem, 2.6vw, 2.6rem)/1.15 var(--serif);
  color: var(--ink);
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.speed-words b {
  font-weight: inherit;
  background: linear-gradient(transparent 12%, var(--hl) 12%, var(--hl) 88%, transparent 88%);
  color: #16181c;
  border-radius: 0.1em;
  box-decoration-break: clone;
}
.speed-meta { display: flex; gap: 1.2rem; margin-top: 0.7rem; font-size: 0.8rem; color: var(--faint); }

/* Library query */
.query {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.8rem;
  height: 3.2rem;
  padding: 0 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  font-size: 1.05rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.query svg { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; }
.caret { width: 1.5px; height: 1.2em; background: var(--read); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.legend { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--ink); margin-top: 1.6rem; }
.key { display: inline-block; width: 1.4rem; height: 0.8rem; border-radius: 0.15rem; }
.key.shared { background: #9fe09a; }
.key.ins { background: #bcd4ff; box-shadow: inset 0 -2px var(--ins); }
.key.del { background: #ffc6c2; box-shadow: inset 0 -2px var(--del); margin-left: 0.9rem; }

/* Pricing */
.price { display: flex; align-items: flex-end; gap: 1.4rem; margin: 3.2rem 0 1.6rem; }
.amount { margin: 0; font: 300 clamp(5rem, 8vw, 8rem)/0.8 var(--serif); letter-spacing: -0.04em; color: var(--ink); }
.price-note { margin: 0 0 0.3rem; font-size: 0.95rem; line-height: 1.45; }
.amount.soon { font-size: clamp(2.6rem, 4.4vw, 4.4rem); line-height: 1; letter-spacing: -0.025em; }
.terms { margin: 0 0 0.5rem; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.terms li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.get-note { min-height: 1.6em; color: var(--ink); }
/* Thumbnails of the real app, opening the lightbox */
.thumbs { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.thumb {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  width: min(14rem, 100%);
}
.thumb-img {
  display: block;
  border-radius: 0.45rem;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--rule), 0 10px 26px rgba(20, 24, 32, 0.22);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}
.thumb img { display: block; width: 100%; height: auto; }
.thumb:hover .thumb-img, .thumb:focus-visible .thumb-img { transform: translateY(-3px); box-shadow: 0 1px 0 var(--rule), 0 16px 34px rgba(20, 24, 32, 0.3); }
.thumb-label { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.thumb-label svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.thumb .d, .lb-img .d { display: none; }
:root[data-theme='dark'] .thumb .l, :root[data-theme='dark'] .lb-img .l { display: none; }
:root[data-theme='dark'] .thumb .d, :root[data-theme='dark'] .lb-img .d { display: block; }

/* The lightbox */
.lb-open, .lb-open body { overflow: hidden; }
.lightbox {
  width: min(96rem, 100vw - 2rem);
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 0.9rem;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(12, 14, 18, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lightbox[open] { animation: lb-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes lb-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.lb-inner { position: relative; display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(18rem, 1fr); max-height: calc(100vh - 2rem); }
.lb-shot { margin: 0; padding: clamp(1rem, 2.5vw, 2.2rem); display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 5%, var(--bg)); }
.lb-img img { display: block; width: 100%; height: auto; max-height: calc(100vh - 6rem); object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.25)); }
.lb-text { padding: clamp(1.4rem, 2.6vw, 2.6rem); overflow-y: auto; display: flex; flex-direction: column; }
.lb-mode { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; font-weight: 500; color: var(--ink); margin: 0 0 1rem; }
.lb-mode::before { content: ''; width: 1.6rem; height: 0.55rem; border-radius: 0.15rem; background: var(--c); }
.lb-text h2 { font-size: clamp(1.9rem, 2.6vw, 2.7rem); margin-bottom: 0.9rem; padding-right: 2rem; }
.lb-lead { color: var(--ink); font-size: 1.05rem; }
.lb-facts { list-style: none; margin: 0.6rem 0 1.2rem; padding: 0; }
.lb-facts li { position: relative; padding: 0.65rem 0 0.65rem 1.3rem; border-top: 1px solid var(--rule); color: var(--muted); line-height: 1.5; font-size: 0.95rem; }
.lb-facts li::before { content: ''; position: absolute; left: 0; top: 1.2rem; width: 0.5rem; height: 2px; background: var(--c); }
.lb-more { font-size: 0.92rem; }
.lb-more a { text-underline-offset: 0.25em; text-decoration-color: var(--rule); }
.lb-nav { margin-top: auto; padding-top: 1rem; display: flex; align-items: center; gap: 0.8rem; color: var(--faint); font-size: 0.85rem; }
.lb-nav button, .lb-close {
  appearance: none; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.lb-nav button:hover, .lb-close:hover { background: var(--rule); }
.lb-nav svg, .lb-close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { position: absolute; top: 0.9rem; right: 0.9rem; background: var(--bg); }

@media (max-width: 820px), (max-aspect-ratio: 4/5) {
  .thumbs { gap: 0.7rem; }
  .thumb { width: calc(50% - 0.35rem); }
  .lightbox { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
  .lb-inner { grid-template-columns: 1fr; max-height: calc(100vh - 1rem); overflow-y: auto; }
  .lb-text { overflow: visible; }
}

.foot {
  padding: 5rem var(--gut) 4rem;
  border-top: 1px solid var(--rule);
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  align-items: baseline;
}
.foot p { margin: 0; color: var(--faint); font-size: 0.9rem; }
.foot .foot-mark { font: 400 1.6rem/1 var(--serif); color: var(--ink); margin-right: auto; }

/* ---------- Narrow screens: the scene sits above, the words below ---------- */
@media (max-width: 820px), (max-aspect-ratio: 4/5) {
  .top { gap: 1rem; padding: 0.8rem 1rem; }
  .top nav { display: none; }
  .ctl.sound { padding: 0 0.75rem; font-size: 0.8rem; }
  .top .btn.small { display: none; }
  .panel { align-items: flex-end; padding: 52vh 1rem 2.2rem; min-height: 100svh; }
  .copy, .hero .copy {
    width: 100%;
    padding: 1.4rem 1.25rem 1.2rem;
    background: var(--panel);
    border-radius: 0.9rem;
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
  }
  h1 { font-size: clamp(3rem, 15vw, 4.4rem); margin-bottom: 1.2rem; }
  h2 { font-size: clamp(2rem, 9.5vw, 2.8rem); }
  .lead { font-size: 1.08rem; }
  .speed-meta span:nth-child(2) { display: none; }
  .foot { padding: 3rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 span, .hero .lead, .hero .cta, .hero .fine { transition: none; }
  .caret { animation: none; }
}
