/* =============================================================
   site.css — the product front door (/) only.

   /privacy/ and /delete-account/ keep loading assets/legal.css and are
   deliberately untouched by this file: legal pages are reviewed text, and
   the cheapest way to prove their rendering did not change is to not share
   a stylesheet with a page that animates.

   Palette and type mirror src/ui/tokens.ts — paper, ink, brass, Fraunces —
   by hand rather than by import, because this is a separately-deployed
   static site with no build step.

   Every motion rule is an enhancement over a readable static page. Without
   JavaScript there is no `.js` class, so nothing pins and nothing fades:
   the page is stacked prose with screenshots and three working CTAs.
   ============================================================= */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-900.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #fdfbf6;
  --surface: #f7f3ea;
  --surface-2: #efeae0;
  --ink: #171614;
  --ink-2: #5a574f;
  --ink-3: #6d6a60;
  --hairline: #ddd7ca;
  --brass: #a66e00;
  --brass-bright: #c98500;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;

  --gutter: clamp(1.15rem, 5vw, 4rem);
  --measure: 32rem;
  --bar: 3.5rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Ink sections flip the variables rather than restating the rules. */
.act--ink,
.band--ink {
  color-scheme: dark;
  --paper: #0f0f0d;
  --surface: #191916;
  --surface-2: #242420;
  --ink: #f2efe6;
  --ink-2: #a8a499;
  --ink-3: #918d82;
  --hairline: #2a2a26;
  --brass: #eda100;
  --brass-bright: #eda100;
  background: var(--paper);
  color: var(--ink);
}

a { color: var(--brass); text-underline-offset: 0.16em; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { top: 1rem; }

/* ======================== THE CALL TO ACTION ========================
   One primary action, three placements, one visual treatment. The sticky
   placement lives inside the header rather than floating over the page:
   a bar that overlays content is the version that costs a conversion on a
   phone, and a header cannot cover what it sits above.

   NOTE FOR THE ASSET PASS: this is a typographic stand-in for Apple's
   official "Download on the App Store" badge. The real badge is licensed
   artwork from Apple's Marketing Resources and is not reproducible from
   memory — drop the SVG into assets/ and swap the <span>s for an <img>;
   the layout and the ids do not change.
   ================================================================= */

.badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.6rem;
  background: #171614;
  color: #fdfbf6;
  text-decoration: none;
  line-height: 1.15;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.badge:hover { background: #000; color: #fdfbf6; transform: translateY(-1px); }
.badge__sub { font-size: 0.7rem; letter-spacing: 0.04em; opacity: 0.82; }
.badge__name { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; }

.badge--lg { min-height: 3.75rem; padding-inline: 1.75rem; }
.badge--lg .badge__name { font-size: 1.45rem; }

/* The header placement is compact but still clears the 44px tap floor. */
.badge--sm { min-height: 2.75rem; padding: 0.35rem 0.9rem; border-radius: 0.5rem; }
.badge--sm .badge__sub { font-size: 0.6rem; }
.badge--sm .badge__name { font-size: 0.95rem; }

.hero__copy .badge { margin-top: 1.75rem; }

/* ---------------------------- chrome ---------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--bar);
  padding: 0.5rem var(--gutter);
  background: var(--paper);
  transition: box-shadow 0.3s ease;
}
.js .site-header.is-stuck {
  box-shadow: 0 1px 0 var(--hairline), 0 0.6rem 1.5rem -1rem rgba(23, 22, 20, 0.4);
}

/* The sticky CTA only exists once the hero's own CTA has left. Before
   that it would be a second copy of a button already on screen. */
.js #sticky-cta {
  opacity: 0;
  transform: translateY(-0.4rem);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.js .site-header.is-stuck #sticky-cta {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* 2.75rem = the 44px tap floor. The wordmark is a link home, so it is held
   to the same minimum as every other target on the page. */
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark--sm { font-size: 1.25rem; }
.wordmark b { color: var(--brass-bright); font-weight: inherit; }

.site-footer {
  padding: 2.25rem var(--gutter) 3rem;
  border-top: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 0.9rem;
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-2);
}
.site-footer nav a:hover { color: var(--ink); }

/* The one knowing line on the page, and the only place the marketing
   voice speaks (FR-26: company channels only, never in the product). */
.site-footer__wink {
  max-width: 30rem;
  margin: 1.25rem 0 0;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 0.95rem;
}

/* The scroll ring — the brass dot closing as the page is read. Desktop
   only: on a phone the bottom-right corner belongs to the thumb. */
.ring {
  position: fixed;
  right: clamp(0.9rem, 2.5vw, 2rem);
  bottom: clamp(0.9rem, 2.5vw, 2rem);
  z-index: 30;
  width: 40px;
  height: 40px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.ring--on { opacity: 1; }
.ring__c { width: 100%; height: 100%; display: block; }
@media (max-width: 51.999rem) { .ring { display: none; } }

/* ---------------------------- type ---------------------------- */

h1, h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* The floor is set by the longest word, not by taste: Fraunces 900 runs
   about 10.7x the font size for a twelve-character word, and a larger
   floor pushed the headline past the right edge of a 375px phone. */
h1 { font-size: clamp(2.1rem, 7.4vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 4.4vw, 3rem); }

.lede {
  max-width: var(--measure);
  margin: 1.1rem 0 0;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.act__num {
  margin: 0 0 0.7rem;
  color: var(--brass);
  font-family: var(--serif);
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

/* ---------------------------- hero ---------------------------- */

.hero {
  position: relative;
  padding: clamp(1.5rem, 4vh, 3rem) var(--gutter) clamp(2.5rem, 7vh, 5rem);
  overflow: hidden;
}
.hero__stamp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: min(100%, 74rem);
  margin-inline: auto;
}
.hero__copy { min-width: 0; }
.hero__visual { display: flex; justify-content: center; min-width: 0; }

/* ---------------------------- note ---------------------------- */

.note {
  width: min(100% - 2 * var(--gutter), 44rem);
  margin: 0 auto 1rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--hairline);
  color: var(--ink-3);
  font-size: 0.85rem;
}

/* ---------------------------- acts ---------------------------- */

.act { position: relative; }
.act__track { position: relative; }
.act__pin { padding: clamp(3rem, 9vh, 5rem) var(--gutter); }

.act__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 23rem);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  width: min(100%, 74rem);
  margin-inline: auto;
}
/* Flipping the sides flips the TRACK WIDTHS too. `order` alone moves the
   copy into the narrow column and the phone into the wide one. */
.act__grid--flip { grid-template-columns: minmax(0, 23rem) minmax(0, 1fr); }
.act__grid--flip > .act__copy { order: 2; }
.act__grid--flip > .act__visual { order: 1; }

.act__copy { min-width: 0; }
.act__lede {
  max-width: var(--measure);
  margin: 1rem 0 0;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
}

.steps {
  max-width: var(--measure);
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  margin-top: 0.85rem;
  padding-left: 1.9rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--brass);
  font-family: var(--serif);
  font-weight: 900;
  font-size: 0.85rem;
}
.js .steps li {
  opacity: 0.28;
  transform: translateY(0.3rem);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.js .steps li.is-active { opacity: 1; transform: none; color: var(--ink); }

/* ------------------------- the device ------------------------- */

.act__visual { display: flex; justify-content: center; min-width: 0; }

/* A 1206x2622 phone is very tall: at 21rem wide it is 730px, which does not
   fit inside a 100vh pin on any laptop with a short window, and the pin
   clips it top and bottom. So inside a pinned act the device is sized by
   HEIGHT and lets `aspect-ratio` derive the width — which requires
   `width: auto`, since a definite width would win and `max-height` would
   squash the ratio instead of shrinking the box. */
.device {
  position: relative;
  height: min(74vh, 42rem);
  width: auto;
  max-width: 100%;
  aspect-ratio: 1206 / 2622;
  border-radius: clamp(1.4rem, 3.2vw, 2.1rem);
  overflow: hidden;
  background: var(--surface);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent),
    0 2.5rem 5rem -1.5rem color-mix(in srgb, var(--ink) 34%, transparent);
}

/* The 3D slot: 4:5, sized for a 720x900 render sequence. The hero is not
   pinned, so this one stays width-driven. */
.device--hero {
  width: min(100%, 26rem);
  height: auto;
  aspect-ratio: 4 / 5;
  border-radius: clamp(1rem, 2.4vw, 1.5rem);
}

.device__poster,
.device__c,
.device__ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.device__ink { z-index: 2; pointer-events: none; }
/* The poster hides only once a canvas has ACTUALLY drawn a frame. A
   declared-but-missing sequence (the hero, until the renders land) leaves
   the class off, so the fallback stays visible instead of the stage going
   blank. */
.device--drawn .device__poster { visibility: hidden; }

/* ---------------------------- bands ---------------------------- */

.band { padding: clamp(3.5rem, 11vh, 8rem) var(--gutter); }
.band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  width: min(100%, 74rem);
  margin-inline: auto;
}
.band__copy { min-width: 0; }
.band__visual { display: flex; justify-content: center; min-width: 0; will-change: transform; }
.band__visual img {
  width: min(100%, 18rem);
  height: auto;
  border-radius: clamp(1.2rem, 2.6vw, 1.8rem);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent),
    0 2rem 4rem -1.5rem #000;
}

/* --------------------------- end cap --------------------------- */

.close { padding: clamp(4rem, 14vh, 9rem) var(--gutter) 3rem; text-align: center; }
.close__inner { width: min(100%, 44rem); margin-inline: auto; }
.close .badge { margin-top: 2rem; }
.close__note { margin: 1.5rem 0 0; color: var(--ink-3); font-size: 0.85rem; }

/* ---------------------------- reveal ---------------------------- */

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

/* ==================================================================
   THE PIN — desktop only, and only with JavaScript running.
   ================================================================== */

@media (min-width: 52rem) {
  .js .act__track { height: calc(var(--len, 2) * 100vh); }
  .js .act__pin {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    height: 100vh;
    padding-block: calc(var(--bar) + 1rem) 2rem;
  }
  .js .act[data-len='2'] { --len: 2; }
  .js .act[data-len='3'] { --len: 3; }
  .js .act[data-len='4'] { --len: 4; }
}

/* Short desktop windows: a pinned panel is exactly 100vh, so tighten
   rather than clip. Nothing is hidden, only compressed. */
@media (min-width: 52rem) and (max-height: 46rem) {
  .js .act__pin { padding-block: calc(var(--bar) + 0.5rem) 1rem; }
  .act__copy h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
  .act__lede { margin-top: 0.8rem; font-size: 1rem; }
  .steps li { margin-top: 0.6rem; font-size: 0.98rem; }
}

/* ==================================================================
   PHONES DO NOT PIN.
   A pinned act must fit inside 100vh, and once the copy is a single
   column several of them do not on a 390x844 screen. The options were to
   cut copy on the smaller screen or to stop pinning; pinning is also the
   thing the reduced-motion guidance warns about. So phones get ordinary
   document flow and the sequences stay tied to each act's traversal of
   the viewport instead — the animation survives, the scroll-jacking does
   not. trackProgress() in scroll.js detects the un-pinned case itself.
   ================================================================== */

@media (max-width: 51.999rem) {
  .hero__grid,
  .act__grid,
  .act__grid--flip,
  .band__inner { grid-template-columns: minmax(0, 1fr); }
  .act__grid--flip > .act__copy,
  .act__grid--flip > .act__visual { order: initial; }

  /* Above the fold on a phone: wordmark, headline, one line, the CTA.
     The hero visual starts just below it, which is the invitation to
     scroll rather than a thing competing with the button. */
  .hero__visual { margin-top: 2rem; }
  .act__visual { margin-top: 2rem; }
  .band__visual { margin-top: 2rem; }
  .band__visual img { width: min(66%, 14rem); }

  /* Phones do not pin, so nothing constrains height here and the device
     goes back to being sized by width.
     Order matters: `.device` and `.device--hero` have equal specificity, so
     the hero rule has to come second or the phone-sized default wins and
     the 4:5 slot renders at two-thirds width. */
  .device { width: min(68%, 16rem); height: auto; }
  .device--hero { width: min(100%, 24rem); height: auto; }

  /* Nothing is pinned, so nothing competes for a fixed 100vh. */
  .js .steps li { opacity: 1; transform: none; color: var(--ink-2); }
  .js .steps li.is-active { color: var(--ink); }

  .site-footer__row { flex-direction: column; align-items: flex-start; }
}

/* ==================================================================
   REDUCED MOTION. No pinning, no scroll-tying, no transitions. scroll.js
   makes the same check and never starts the rAF loop.
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
  .js .act__track { height: auto; }
  .js .act__pin { position: static; height: auto; padding-block: 4rem; }
  .js .steps li { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  .js #sticky-cta { opacity: 1; transform: none; pointer-events: auto; }
  .device--drawn .device__poster { visibility: visible; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .ring, .hero__stamp, .site-header { display: none; }
  .act__track { height: auto; }
  .act__pin { position: static; height: auto; }
}
