/* Reverie — static marketing site.
   Identity mirrors the app: warm paper (reading mode) with one deep "night"
   band (listening mode), brand gold as the single accent, real cover art as
   the hero. Apple-native system fonts (New York serif + San Francisco) keep it
   self-contained — fitting for an Apple-only app. No build step, no deps. */

:root {
  --paper:      #f5efe1;
  --paper-sink: #ece2cd;
  --ink:        #1d1a14;
  --ink-soft:   #6c6453;
  --line:       #ddd2b8;

  --gold:       #f5dd7e;
  --gold-deep:  #c79a2e;   /* readable gold on paper */

  --night:      #16120c;
  --night-2:    #221b12;
  --night-line: #3a3022;
  --night-soft: #b8ac93;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --band: clamp(72px, 11vw, 140px);   /* vertical rhythm between bands */

  --font-display: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --font-body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --shadow-device: 0 2px 6px rgba(29,26,20,.12), 0 40px 80px -34px rgba(29,26,20,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Stop intrinsic (1320px-wide) screenshots from blowing out grid/flex tracks */
.hero-grid > *, .band-grid > *, .stage .device, .band-media, .devices-stage .device,
.touch-grid > *, .feature-grid > *, .triptych > *, .touch-card .device, .feature-card .device { min-width: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.display { font-size: clamp(2.7rem, 6.6vw, 5.2rem); line-height: 1.0; }
.h2 { font-size: clamp(2rem, 4.2vw, 3.15rem); }
.h3 { font-size: clamp(1.35rem, 2.3vw, 1.7rem); }
p { margin: 0; }

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

.eyebrow {
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 0.6em; margin: 0 0 1.1rem;
}
.eyebrow::before {
  content: ""; width: 0.6em; height: 0.6em; background: var(--gold-deep);
  clip-path: polygon(0 0, 100% 50%, 0 100%);   /* play-triangle motif */
  flex: none;
}
.night .eyebrow { color: var(--night-soft); }
.night .eyebrow::before { background: var(--gold); }

.lede { font-size: clamp(1.05rem, 1.5vw, 1.27rem); color: var(--ink-soft); max-width: 46ch; }
.night .lede { color: var(--night-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 600; font-size: 1rem; padding: .85em 1.45em; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn-ghost:hover { border-color: currentColor; }
.night .btn-primary { background: var(--gold); color: #1c1606; }
.night .btn-primary:hover { background: #ffe790; }
.night .btn-ghost { border-color: var(--night-line); }

:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; border-radius: 6px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: .5em; }
.brand .mark { width: .7em; height: .7em; background: var(--gold-deep); clip-path: polygon(0 0,100% 50%,0 100%); }
.brand-icon { width: 1.5em; height: 1.5em; flex: none; }
.nav { display: flex; gap: 1.6rem; align-items: center; font-size: .95rem; font-weight: 500; }
.nav a.muted { color: var(--ink-soft); }
.nav a.muted:hover { color: var(--ink); }
@media (max-width: 720px) { .nav .muted { display: none; } }

/* Hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 var(--band); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 1.4rem; }
.hero .lede { max-width: 40ch; margin-bottom: 2rem; font-size: clamp(1.1rem, 1.7vw, 1.35rem); }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: .9rem; color: var(--ink-soft); margin-top: 1.1rem; }

/* Hero stage: three fanned phones — the "shelf that travels with you".
   Flex + negative margins (not absolute) so the tall shots can't overflow. */
.stage { display: flex; align-items: center; justify-content: center; }
.stage .device { width: 42%; flex: none; }
.stage .s1 { transform: rotate(-6deg); z-index: 1; margin-right: -10%; }
.stage .s2 { z-index: 3; transform: scale(1.06); box-shadow: 0 2px 8px rgba(29,26,20,.2), 0 50px 90px -34px rgba(29,26,20,.62); }
.stage .s3 { transform: rotate(6deg); z-index: 2; margin-left: -10%; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stage { max-width: 440px; margin-inline: auto; }
}

/* Device frames */
.device { background: #0c0a07; padding: 8px; border-radius: 40px; box-shadow: var(--shadow-device); }
.device.pad { border-radius: 26px; padding: 11px; }
.device > img, .device > video { border-radius: 32px; width: 100%; }
.device.pad > img, .device.pad > video { border-radius: 16px; }

/* Feature bands */
.band { padding-block: var(--band); }
.band.night { background: var(--night); color: var(--paper); }
.band.night h2 { color: #fff; }
.band-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.band.reverse .band-grid { direction: rtl; }
.band.reverse .band-grid > * { direction: ltr; }
.band h2 { margin-bottom: 1.2rem; }
.band .lede { margin-bottom: 1.6rem; }
.band-media { display: flex; justify-content: center; }
.band-media .device { width: min(310px, 78%); }
.band.night .band-media .device { background: #000; }

/* macOS window shot (already a window capture — just float it with a shadow) */
.band-media.mac { display: block; }
.mac-window { width: 100%; border-radius: 12px; box-shadow: var(--shadow-device); }

/* Feature list */
.flist { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.flist li { display: grid; grid-template-columns: auto 1fr; gap: .8em; align-items: start; font-size: 1rem; color: var(--ink-soft); }
.night .flist li { color: var(--night-soft); }
.flist li::before { content: ""; margin-top: .5em; width: .5em; height: .5em; background: var(--gold-deep); clip-path: polygon(0 0,100% 50%,0 100%); }
.night .flist li::before { background: var(--gold); }
.flist b { color: var(--ink); font-weight: 600; }
.night .flist b { color: #fff; }

@media (max-width: 860px) {
  .band-grid, .band.reverse .band-grid { grid-template-columns: 1fr; direction: ltr; }
  .band-media { order: -1; }
  .band-media .device { width: min(300px, 72%); }
}

/* A slimmer eyebrow + heading pair to title a grid section without a full band */
.section-head { text-align: center; max-width: 42ch; margin-inline: auto; margin-bottom: clamp(34px, 5vw, 60px); }
.section-head .eyebrow { justify-content: center; }
.section-head .lede { margin-inline: auto; }

/* System touches — small captioned cards (2×2 on desktop, stacks on phone).
   Used for widgets, Siri, Control Center: little proof points, not hero shots. */
.touch-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3.5vw, 44px); align-items: start;
  max-width: 880px; margin-inline: auto;
}
.touch-card { margin: 0; text-align: center; }
.touch-card .device { width: min(220px, 70%); margin-inline: auto; margin-bottom: 1.1rem; }
.night .touch-card .device { background: #000; }
.touch-card figcaption b { font-family: var(--font-display); font-weight: 500; font-size: 1.18rem; display: block; margin-bottom: .25rem; }
.touch-card figcaption span { color: var(--ink-soft); font-size: .96rem; }
.night .touch-card figcaption span { color: var(--night-soft); }
.night .touch-card figcaption b { color: #fff; }
/* Icon for the "System touches" cards (widget / goal / Siri / Control Center):
   a gold-tinted rounded tile carrying the play-triangle motif — used in place of
   screenshots for system surfaces XCUITest can't capture. */
.touch-glyph {
  width: 56px; height: 56px; margin: 0 auto 1.1rem; border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  display: grid; place-items: center;
}
.touch-glyph::before {
  content: ""; width: 20px; height: 20px; background: var(--gold);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
@media (max-width: 720px) {
  .touch-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .touch-card .device { width: min(180px, 78%); }
}
@media (max-width: 460px) { .touch-grid { grid-template-columns: 1fr; max-width: 320px; } }

/* Feature card grid — the "one tidy library" wall. Many small features, each a
   phone shot + bold title + one sentence. Auto-fit so it breathes on any width. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(22px, 3vw, 40px);
}
.feature-card {
  margin: 0; display: flex; flex-direction: column;
  background: var(--paper-sink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 2.6vw, 30px);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -30px rgba(29,26,20,.5); }
.feature-card .device { width: min(208px, 64%); margin-inline: auto; margin-bottom: clamp(16px, 2vw, 24px); }
.feature-card .feature-media { margin-bottom: clamp(16px, 2vw, 24px); }
.feature-card figcaption { margin-top: auto; }
.feature-card figcaption b {
  font-family: var(--font-display); font-weight: 500; font-size: 1.3rem;
  display: flex; align-items: baseline; gap: .55em; margin-bottom: .4rem; color: var(--ink);
}
.feature-card figcaption b::before {
  content: ""; flex: none; width: .5em; height: .5em; margin-top: .15em;
  background: var(--gold-deep); clip-path: polygon(0 0,100% 50%,0 100%);
}
.feature-card figcaption span { color: var(--ink-soft); font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .feature-card:hover { transform: none; } }

/* Three formats */
.formats { padding-block: var(--band); border-top: 1px solid var(--line); }
.formats-head { text-align: center; max-width: 40ch; margin-inline: auto; margin-bottom: clamp(36px, 6vw, 64px); }
.formats-head .lede { margin-inline: auto; }
.triptych { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 36px); align-items: start; }
.triptych figure { margin: 0; text-align: center; }
.triptych .device { margin-bottom: 1.1rem; }
.triptych figcaption b { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; display: block; margin-bottom: .25rem; }
.triptych figcaption span { color: var(--ink-soft); font-size: .98rem; }
@media (max-width: 760px) { .triptych { grid-template-columns: 1fr; max-width: 360px; margin-inline: auto; gap: 48px; } }

/* Every device */
.devices { padding-block: var(--band); background: var(--paper-sink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.devices-head { max-width: 44ch; margin-inline: auto; margin-bottom: clamp(32px, 5vw, 56px); }
.devices-head .lede { margin-inline: auto; }
.devices-stage { display: flex; align-items: flex-end; justify-content: center; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; }
.devices-stage .device { width: min(230px, 60vw); }
.devices-stage .device.pad { width: min(420px, 82vw); }

/* Footer */
.site-footer { padding-block: clamp(48px, 8vw, 88px) 40px; }
.footer-cta { text-align: center; max-width: 36ch; margin-inline: auto; margin-bottom: clamp(40px, 6vw, 64px); }
.footer-cta h2 { margin-bottom: 1.4rem; }
.footer-meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 28px; color: var(--ink-soft); font-size: .9rem; }
.footer-meta a:hover { color: var(--ink); }

.section-num { font-variant-numeric: tabular-nums; }
