@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  --quiet: #5c5c5c;
  --card: #ebebeb;
  --blue: #0012ff;
  --rule: 2.3px;
  --page: 1120px;
  --gutter: 20px;
  --logo-filter: none;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161616;
    --ink: #ededed;
    --quiet: #a8a8a8;
    --card: #2c2c2c;
    --logo-filter: invert(1);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

a { color: inherit; text-underline-offset: 3px; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 { font-weight: 300; line-height: 1.12; margin: 0; }

h1 { font-size: clamp(44px, 8vw, 88px); letter-spacing: -0.015em; }
h2 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.01em; }
h3 { font-size: 22px; font-weight: 400; }

p { margin: 0; }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header and footer: the app's heavy rule, and its plain words. */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo { display: block; width: 62px; filter: var(--logo-filter); }

nav { display: flex; gap: 20px; font-size: 16px; }

nav a { text-decoration: none; min-height: 44px; display: flex; align-items: center; }
nav a:hover { text-decoration: underline; }

.foot {
  border-top: var(--rule) solid var(--ink);
  margin-top: 72px;
  padding: 22px 0 36px;
  font-size: 15px;
}

.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot nav { flex-wrap: wrap; font-size: 15px; }
.foot nav a { min-height: 32px; }
.foot .quiet { align-self: center; }

.quiet { color: var(--quiet); }

/* Home: one story down the page, with nothing boxed off from what comes next. */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  min-height: min(84vh, 780px);
  padding-top: 16px;
  padding-bottom: 40px;
}

.hero-words p { font-size: clamp(19px, 2.2vw, 24px); margin-top: 20px; max-width: 30em; }

.soon {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
}

.phones { display: flex; justify-content: center; gap: 14px; }
.phones img:first-child { margin-top: 56px; }
.phones img { width: 50%; max-width: 250px; will-change: transform; }

.screen { border: var(--rule) solid var(--ink); background: var(--paper); }

.pitch { max-width: 34em; margin-top: 16px; font-size: 20px; }
.fine { margin-top: 14px; font-size: 15px; }
.quiet.hint { margin-top: 12px; font-size: 15px; }

section.wrap { padding-top: clamp(72px, 12vh, 140px); }

/* The phone stays while the words go past it. */

.story {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(32px, 7vw, 96px);
  align-items: start;
}

.stage {
  position: sticky;
  top: calc((100vh - 620px) / 2);
  width: 288px;
  height: 620px;
}

.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.stage img.is-on { opacity: 1; transform: none; }

.step {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step-screen { display: none; }

.step h2, .step .pitch, .step .try, .step .hint {
  transition: opacity 0.45s ease;
}

.js .step:not(.is-on) h2,
.js .step:not(.is-on) .pitch,
.js .step:not(.is-on) .try,
.js .step:not(.is-on) .hint { opacity: 0.2; }

/* A page that behaves like the app's: backspace crosses out. */

.try { position: relative; margin-top: 26px; max-width: 620px; border: 1px solid var(--ink); background: var(--paper); }
.try:focus-within { outline: var(--rule) solid var(--ink); outline-offset: -1px; }

.try-page {
  min-height: 150px;
  padding: 18px 20px;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.try-page s { text-decoration-thickness: 2px; }

.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -0.15em; background: var(--ink); opacity: 0; }
.try:focus-within .caret { opacity: 1; animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.try textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  resize: none;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  cursor: text;
}

/* Covers and paper in the air, fading into the page so that there's no band. */

.air {
  position: relative;
  min-height: 118vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  touch-action: pan-y;
}

.air-sky {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}

.air-words { position: relative; width: 100%; pointer-events: none; }

/* The words are on a sheet of their own, with the others falling behind it. */
.air-sheet {
  max-width: 600px;
  padding: 26px 28px 30px;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.air-sheet .pitch { margin-top: 14px; }

.leaf {
  position: absolute;
  top: 0;
  left: 0;
  width: 112px;
  height: 163px;
  background: #ffffff center / cover;
  will-change: transform;
}

.leaf.sheet { outline: 1px solid rgba(0, 0, 0, 0.14); outline-offset: -1px; }
.leaf.lined { background-image: repeating-linear-gradient(transparent 0 18px, rgba(0, 0, 0, 0.22) 18px 19px); }
.leaf.graph {
  background-image:
    repeating-linear-gradient(transparent 0 17px, rgba(0, 0, 0, 0.16) 17px 18px),
    repeating-linear-gradient(90deg, transparent 0 17px, rgba(0, 0, 0, 0.16) 17px 18px);
}
.leaf.dots { background-image: radial-gradient(rgba(0, 0, 0, 0.4) 1.1px, transparent 1.3px); background-size: 15px 15px; }

/* Price */

.cost {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}

.sums {
  --book: clamp(58px, 6.4vw, 84px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 3vw, 32px);
  align-items: end;
}

.sum { font-size: 15px; line-height: 1.3; }
.sum strong { display: block; margin-top: 18px; margin-bottom: 4px; font-size: clamp(27px, 3.6vw, 44px); font-weight: 300; line-height: 1.1; white-space: nowrap; }
.sum.ours strong { color: var(--blue); }

/* Three to a pack, slightly fanned. Plain brown paper with two staples: a nod, not a copy. */
.pile { position: relative; height: calc(var(--book) * 1.46 + 16px); }

.book {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--book);
  height: calc(var(--book) * 1.46);
  background: var(--card) center / cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.book:nth-child(2) { transform: translate(calc(var(--book) * 0.36), 8px); transition-delay: 0.08s; }
.book:nth-child(3) { transform: translate(calc(var(--book) * 0.72), 16px); transition-delay: 0.16s; }
.js .reveal:not(.in) .book { transform: translateY(-14px); }

.book.kraft {
  background-color: #c29e70;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78));
  background-size: 1.5px 12%, 1.5px 12%;
  background-position: 3px 24%, 3px 76%;
  background-repeat: no-repeat;
  outline: 1px solid rgba(0, 0, 0, 0.2);
  outline-offset: -1px;
}

@media (prefers-color-scheme: dark) { .sum.ours strong { color: #8d96ff; } }

/* The pen goes through it when it comes into view. */
.penned span { position: relative; display: inline-block; color: var(--quiet); }
.penned span::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 54%;
  height: 3px;
  background: var(--ink);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.6, 0, 0.3, 1) 0.45s;
}
.js .reveal:not(.in) .penned span::after { transform: scaleX(0); }

/* AI */

.ask {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}

.ask-q { padding: 14px; border: var(--rule) solid var(--ink); }
.ask-a { margin-top: 18px; }
.ask-from { margin-top: 8px; font-size: 14px; }
.ai-tag {
  display: table;
  margin-bottom: 8px;
  padding: 0 5px;
  background: #39ff14;
  color: #000000;
  font-size: 12px;
  font-weight: 500;
}

/* Prices */

.prices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 28px;
}

.price { padding: 16px; background: var(--card); }
.price strong { display: block; font-size: 32px; font-weight: 300; margin-top: 4px; }

.plan { margin-top: 8px; padding: 22px; background: var(--blue); color: #ffffff; }
.plan h3 { font-size: 30px; font-weight: 300; }
.plan strong { display: block; font-size: 24px; font-weight: 400; margin: 2px 0 10px; }

/* Things settle into place as they arrive, and no more than that. */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

/* The close: a notebook's worth of white pages, stacking like cascading windows. */

.close {
  position: relative;
  margin-top: clamp(72px, 12vh, 140px);
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
  color: #000000;
}

.cascade { position: absolute; inset: 0; }

.page-sheet {
  position: absolute;
  width: 42%;
  height: 46%;
  background-color: #ffffff;
  outline: 1px solid rgba(0, 0, 0, 0.28);
  outline-offset: -1px;
}

.page-sheet.lined { background-image: repeating-linear-gradient(transparent 0 25px, rgba(0, 0, 0, 0.07) 25px 26px); }
.page-sheet.graph {
  background-image:
    repeating-linear-gradient(transparent 0 25px, rgba(0, 0, 0, 0.06) 25px 26px),
    repeating-linear-gradient(90deg, transparent 0 25px, rgba(0, 0, 0, 0.06) 25px 26px);
}
.page-sheet.dots { background-image: radial-gradient(rgba(0, 0, 0, 0.16) 1.1px, transparent 1.3px); background-size: 22px 22px; }

.js .page-sheet { opacity: 0; transform: scale(0.97); transition: opacity 0.2s ease, transform 0.2s ease; }
.js .close.in .page-sheet { opacity: 1; transform: none; }

.close-words { position: relative; width: 100%; }
.close h2 { max-width: 12em; font-size: clamp(40px, 7vw, 76px); }
.close-words p { margin-top: 18px; font-size: 20px; }
.close .soon { background: #000000; color: #ffffff; }
.home .foot { margin-top: 0; border-top: 0; }

@media (max-width: 820px) {
  :root { --gutter: 18px; }
  body { font-size: 17px; }
  h1 { font-size: clamp(42px, 13vw, 72px); }
  h2 { font-size: clamp(30px, 8.6vw, 44px); }
  .pitch { font-size: 18px; }
  .top { padding-top: 10px; padding-bottom: 10px; }
  .hero { grid-template-columns: 1fr; gap: 30px; min-height: 0; padding-top: 8px; padding-bottom: 0; }
  .soon { display: block; width: fit-content; padding: 13px 16px; font-size: 16px; white-space: nowrap; }
  .phones { gap: 10px; }
  .phones img { width: calc(50% - 5px); max-width: none; }
  .phones img:first-child { margin-top: 28px; }
  .story { display: block; }
  .stage { display: none; }
  .step { min-height: 0; padding-top: 68px; }
  .js .step:not(.is-on) h2,
  .js .step:not(.is-on) .pitch,
  .js .step:not(.is-on) .try,
  .js .step:not(.is-on) .hint { opacity: 1; }
  .step-screen { display: block; width: 72%; max-width: 300px; margin: 0 auto 28px 0; }
  .try-page { min-height: 136px; padding: 14px 16px; font-size: 19px; }
  section.wrap { padding-top: 68px; }
  .air { min-height: 96vh; min-height: 96svh; margin-top: 44px; }
  .air-sheet { padding: 18px 18px 22px; }
  .leaf { width: 74px; height: 108px; }
  .cost, .ask { grid-template-columns: 1fr; gap: 28px; }
  .ask-card { order: 2; }
  .prices { grid-template-columns: repeat(2, 1fr); }
  .price { padding: 13px; }
  .price strong { font-size: 28px; }
  .plan { padding: 18px; }
  .close { min-height: 88vh; min-height: 88svh; }
  .close-words p { font-size: 18px; }
  .page-sheet { width: 72%; height: 38%; }
  .foot .wrap { flex-direction: column; }
  .foot .quiet { align-self: flex-start; }
  nav a { min-height: 44px; }
  .foot nav a { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .page-sheet, .stage img, .step h2, .step .pitch, .step .try, .step .hint, .penned span::after {
    transition: none;
  }
  .try:focus-within .caret { animation: none; }
}

/* Text pages: privacy, support */

.doc { max-width: 720px; padding-top: 28px; }
.doc h1 { font-size: clamp(38px, 6vw, 56px); }
.doc h2 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 30px;
  letter-spacing: 0;
}
.doc p { margin-top: 8px; }
.doc .quiet { font-size: 15px; margin-top: 10px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .prices { grid-template-columns: repeat(2, 1fr); }
  .rail { grid-auto-columns: 62vw; }
  .close { padding: 64px 0; }
  section.wrap { padding-top: 56px; }
}
