/* The landing page. The app's one ground and three fonts, from /tokens.css (written by design/tokens/build.py from tokens.json): New York for the person's words
   and the titles, SF for the rest. scrollcraft.css is the engine's floor and is not edited. */

:root {
  color-scheme: dark;
  --sc-canvas: var(--color-ground);
  --sc-surface: var(--color-surface);
  --sc-ink: var(--color-ink);
  --sc-ink-soft: var(--color-muted);
  --sc-accent: var(--thread-glint);
  --sc-accent-ink: var(--color-on-ink);
  --sc-font-display: var(--font-title);
  --sc-font-text: var(--font-ui);
  --words: var(--font-words);
  --ink-words: var(--color-ink-soft);
  --glass: var(--color-glass);
  --glass-border: var(--color-glass-border);
  --title-hero: clamp(2.5rem, 1.2rem + 3.2vw, 4rem);
  --title-xl: clamp(2rem, 1.3rem + 2vw, 3rem);
  --title-l: clamp(1.75rem, 1.1rem + 1.6vw, 2.6rem);
}

html { scroll-behavior: auto; }
body { letter-spacing: 0; line-height: 1.55; }
/* the ground's two faint glows, as in the app; fixed so the page reads as one place */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(120, 72, 52, 0.16), transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(142, 156, 216, 0.06), transparent 62%);
}
main { position: relative; z-index: 1; }

/* the light: one canvas over the whole page, drawn by threads.js */
#light { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; z-index: 40; pointer-events: none; }

/* the titles' face, style and weight come from the tokens; sizes and lines are the site's own */
h1, h2 { text-wrap: balance; margin: 0; color: var(--sc-ink); }
h1 { font: var(--type-title-hero); font-size: var(--title-hero); line-height: 1.06; letter-spacing: var(--tracking-title-hero); }
h1 span { display: block; }
h2 { font: var(--type-title-x-l); font-size: var(--title-xl); line-height: 1.08; letter-spacing: var(--tracking-title-x-l); }
p { margin: 0; text-wrap: pretty; }
.words { font: 400 clamp(1.25rem, 1rem + 0.8vw, 1.55rem)/1.35 var(--words); color: var(--ink-words); letter-spacing: -0.01em; }
.soft { color: var(--sc-ink-soft); font-size: 1.0625rem; }

/* the one action: Apple's badge exactly as Apple draws it, 48 px tall, with at least a quarter of its height clear around it */
.store { display: inline-block; line-height: 0; }
.store img { height: 48px; width: auto; }

/* ------------------------------------------------------------------ iPhone
   Drawn in CSS around a real screenshot (402 x 874 pt): titanium band, black bezel, island, side buttons.
   Everything inside scales with the phone's width (cqw). threads.js hides the light behind this same shape. */
.phone { --pw: clamp(220px, 30vh, 300px); width: var(--pw); aspect-ratio: 421 / 893; position: relative; margin: 0; flex: none; container-type: inline-size; }
.phone::before, .phone::after { content: ""; position: absolute; width: 1.1%; border-radius: 2px; z-index: -1; }
.phone::before { left: -0.6%; top: 17.5%; height: 22%; background: linear-gradient(to bottom, #3d3833 0 16%, transparent 16% 30%, #3d3833 30% 62%, transparent 62% 70%, #3d3833 70% 100%); }
.phone::after { right: -0.6%; top: 26%; height: 12%; background: #3d3833; }
.phone__body {
  position: absolute; inset: 0; padding: 2.26cqw; border-radius: 16.9cqw; background: #060505;
  box-shadow: 0 3cqw 5cqw -2cqw rgba(0, 0, 0, 0.6), 0 16cqw 28cqw -14cqw rgba(0, 0, 0, 0.9);
}
.phone__body::before {
  content: ""; position: absolute; inset: 0; padding: 0.85cqw; border-radius: inherit; pointer-events: none;
  background: linear-gradient(145deg, #6a635b 0%, #2c2824 16%, #191715 50%, #2e2a26 84%, #585149 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.phone__glass { position: relative; height: 100%; border-radius: 14.7cqw; overflow: hidden; background: var(--sc-canvas); }
.phone__glass img { width: 100%; height: 100%; object-fit: cover; }
.phone__glass::before { content: ""; position: absolute; left: 50%; top: 2.6cqw; width: 29.9cqw; height: 8.8cqw; margin-left: -14.95cqw; border-radius: 99cqw; background: #000; z-index: 1; }
.phone__glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0) 74%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ------------------------------------------------------- 1. the moment (pinned) */
.mark { position: absolute; top: clamp(1rem, 3.2vh, 2rem); left: var(--sc-gutter); z-index: 21; display: flex; align-items: center; gap: 0.6rem; font: 600 0.9375rem/1 var(--sc-font-text); color: var(--sc-ink); }
.mark img { width: 32px; height: 32px; border-radius: 7.5px; }

/* threads.js moves it with the scroll; this is where it stands before the script runs */
#moment { --hero-pw: clamp(210px, 34.9vh, 330px); }
.phone--hero { --pw: var(--hero-pw); position: absolute; left: 0; top: 0; translate: calc(73vw - 50%) calc(55svh - 50%); rotate: 4.5deg; will-change: translate, rotate, scale; }

.hero { position: absolute; inset: 0; display: flex; align-items: center; padding-inline: var(--sc-gutter); z-index: 20; pointer-events: none; }
.hero__copy { max-width: min(46rem, 50vw); pointer-events: auto; }
.hero__copy h1 { max-width: 11.5em; }
.hero__copy .words { margin-top: 1.4rem; }
.hero__copy .soft { margin-top: 0.9rem; max-width: 33rem; }
.hero__copy .store { margin-top: 1.9rem; }
/* text comes out of the dark, as in the app: a little after its thread */
.hero__copy > * { animation: emerge 0.7s cubic-bezier(0.23, 1, 0.32, 1) both; }
.hero__copy > :nth-child(1) { animation-delay: 0.15s; }
.hero__copy > :nth-child(2) { animation-delay: 0.32s; }
.hero__copy > :nth-child(3) { animation-delay: 0.44s; }
.hero__copy > :nth-child(4) { animation-delay: 0.56s; }
@keyframes emerge { from { opacity: 0; filter: blur(4px); transform: translateY(6px); } }

/* beside the phone once it stands in the middle: never wider than the room left of it or right of it */
.beat { position: absolute; z-index: 20; bottom: clamp(3rem, 14vh, 9rem); max-width: min(22rem, calc(50vw - var(--hero-pw) * 0.52 - var(--sc-gutter) - 2.5rem)); }
.beat--lead { left: var(--sc-gutter); }
.beat--trail { right: var(--sc-gutter); }
.beat h2 { font-size: var(--title-l); }
.beat p { margin-top: 0.8rem; color: var(--sc-ink-soft); font-size: 1.0625rem; }

/* ------------------------------------------------------- 2. the threads (flow) */
.threads { padding-block: clamp(3rem, 8vh, 7rem); }
.row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2.5rem, 7vw, 7rem); max-width: 74rem; margin-inline: auto; padding-inline: var(--sc-gutter); min-height: 92vh; }
.row .phone { justify-self: end; }
.row .copy { max-width: 25rem; }
.row--flip .phone { justify-self: start; }
.row--flip .copy { justify-self: end; }
.copy p { margin-top: 1rem; color: var(--sc-ink-soft); font-size: 1.0625rem; }

/* ------------------------------------------------------- 3. bring these three (pinned) */
.bring [data-sc-stage] { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(2.5rem, 7vw, 7rem); max-width: 78rem; margin-inline: auto; padding-inline: var(--sc-gutter); }
.phone--bring { --pw: clamp(210px, 32vh, 310px); justify-self: end; }
/* a waypoint under the phone: the threads leave straight down, clear of the quotes beside it */
.under { position: absolute; left: 50%; top: 130%; width: 1px; height: 1px; }
.bring__copy p { margin-top: 1rem; color: var(--sc-ink-soft); font-size: 1.0625rem; max-width: 30rem; }
.quotes { list-style: none; margin: clamp(1.75rem, 5vh, 3rem) 0 0; padding: 0; display: grid; gap: clamp(1.1rem, 3.2vh, 1.9rem); }
/* the bar beside each line is drawn by its thread */
.quote { font: 400 clamp(1.35rem, 0.95rem + 1.3vw, 2rem)/1.2 var(--words); color: var(--sc-ink); letter-spacing: -0.015em; padding-left: 1.5rem; max-width: 22em; }

/* ------------------------------------------------------- 4. only you (flow, quiet) */
.quiet { min-height: 88vh; display: grid; place-items: center; text-align: center; }
.quiet__in { max-width: 35rem; padding-inline: var(--sc-gutter); }
.quiet__in .words { margin-top: 1.4rem; }
.quiet__in .soft { margin-top: 1rem; }

/* ------------------------------------------------------- 5. questions (flow) */
.faq { padding-block: clamp(3rem, 9vh, 7rem); }
.faq__in { max-width: 46rem; margin-inline: auto; padding-inline: var(--sc-gutter); }
.faq h2 { margin-bottom: 1.6rem; }
.faq details { border-top: 1px solid var(--sc-hairline); }
.faq details:last-child { border-bottom: 1px solid var(--sc-hairline); }
.faq summary { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: 1.15rem 0; cursor: pointer; list-style: none; font: 600 1.0625rem/1.35 var(--sc-font-text); color: var(--sc-ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-weight: 400; color: var(--sc-ink-soft); transition: rotate 0.2s cubic-bezier(0.23, 1, 0.32, 1); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding: 0 2.5rem 1.25rem 0; color: var(--sc-ink-soft); font-size: 1.0625rem; }

/* ------------------------------------------------------- 6. the close */
.close { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.close__in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 5rem var(--sc-gutter) 3rem; }
.close h2 { font-size: var(--title-hero); max-width: 11em; }
.close .store { margin-top: 2.2rem; }
.close .fine { margin-top: 1rem; color: var(--sc-ink-soft); font-size: 0.9375rem; }
footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; padding: 1.5rem var(--sc-gutter) 2.5rem; color: var(--sc-ink-soft); font-size: 0.9375rem; position: relative; z-index: 41; }
footer a { color: var(--sc-ink-soft); text-decoration: none; }
footer a:active { opacity: 0.6; }
footer .legal { flex-basis: 100%; margin-top: 0.25rem; text-align: center; text-wrap: balance; font-size: 0.8125rem; line-height: 1.45; opacity: 0.75; }
@media (hover: hover) and (pointer: fine) { footer a:hover { color: var(--sc-ink); text-decoration: underline; } }

/* ------------------------------------------------------------------ phone widths
   Composed again, not shrunk: copy above, the phone below it, the threads keep to the edges beside text.
   Up to 1000px, the same width threads.js calls `mobile`: narrower than that, text has no room beside the phone. */
@media (max-width: 1000px) {
  :root { --title-hero: clamp(2.1rem, 9.4vw, 2.75rem); }
  #moment { --hero-pw: min(60vw, 31svh); }
  .phone--hero { translate: calc(50vw - 50%) 71svh; rotate: 0deg; }
  .hero { align-items: flex-start; padding-top: clamp(4.5rem, 11svh, 6.5rem); }
  .hero__copy { max-width: none; }
  .hero__copy .words { margin-top: 1rem; }
  .hero__copy .store { margin-top: 1.3rem; }
  .beat { left: var(--sc-gutter); right: var(--sc-gutter); bottom: clamp(1.5rem, 5svh, 3rem); max-width: none; padding-right: 2.75rem; }

  .row { grid-template-columns: 1fr; gap: 2.25rem; min-height: 0; padding-block: 2.5rem; }
  .row .phone, .row--flip .phone { justify-self: center; order: 2; }
  .row .copy, .row--flip .copy { justify-self: start; max-width: 30rem; padding-right: 1.5rem; }
  .row--flip .copy { padding: 0 0 0 1.5rem; }

  .bring [data-sc-stage] { display: flex; flex-direction: column; justify-content: center; align-items: stretch; }
  .phone--bring { display: none; }
  .bring__copy { padding-left: 1.25rem; }
  .quote { padding-left: 1.1rem; margin-left: -1.1rem; }
  .quiet__in, .faq__in { padding-right: calc(var(--sc-gutter) + 1rem); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__copy > * { animation: none; }
  .faq summary::after { transition: none; }
}
