/* ==========================================================================
   MTDS — shared design tokens and components (Apple-HIG-inspired pass)

   LOAD ORDER MATTERS. ds-base.js runs synchronously and appends the nocturne
   stylesheet to <head> before the parser reaches this file's <link>, so the
   cascade lands as:

       nocturne styles.css  <  mtds.css  <  each page's inline <style>

   which is what lets this file re-point the design system's tokens without
   touching its rules. Each page's inline <style> is now page-specific LAYOUT
   only — the token blocks that used to be duplicated in all three pages have
   been removed so these definitions actually win.
   ========================================================================== */

:root {
  /* — type ————————————————————————————————————————————————————————————— */
  --font-sys: -apple-system, system-ui, "SF Pro Text", "Segoe UI", Roboto,
              Helvetica, Arial, sans-serif;
  /* the wordmark keeps its own face and weight — it is the one element the
     brief holds exempt from both the system stack and the 800-weight ban */
  --font-wordmark: "Inter", var(--font-sys);

  /* — color ———————————————————————————————————————————————————————————— */
  --gold: #c9a44a;
  --bg: #0b0a09;
  --surface: #141210;
  --surface-2: #1b1815;
  --text: #EDEBE6;
  --text-muted: #B7B2A8;
  --hairline: rgba(201, 164, 74, 0.15);
  --focus: rgba(201, 164, 74, 0.35);

  /* — spacing, 8pt ————————————————————————————————————————————————————— */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 32px;  --s-12: 48px; --s-16: 64px; --s-20: 80px;
  --section-y: 80px;

  /* — radii: 12px for everything that is not the primary pill —————————— */
  --r-card: 12px;
  --r-pill: 9999px;

  /* — store badges —————————————————————————————————————————————————————
     VISIBLE badge height, matched across both stores. Fluid, because the pair
     now sits side by side at every width: laid out, the two boxes measure
       Apple  3.49H  (2.99H of artwork + H/4 clear space each side)
     + Google 3.85H  (its H/4 clear space is baked into the PNG)
       = 7.34H, plus the row gap.
     At 375px the content box is 335px, so H has to stay under ~45px to keep the
     pair inside the gutter; 11vw lands at 41px there and reaches the 48px
     ceiling at ~436px and above. */
  --badge-h: clamp(40px, 11vw, 48px);

  /* — bridge —————————————————————————————————————————————————————————————
     The nocturne DS and the pages' existing rules read these names. Pointing
     them at the tokens above retints the whole site from one place instead of
     rewriting several hundred declarations. */
  --color-bg: var(--bg);
  --color-surface: var(--surface);
  --color-text: var(--text);
  --color-accent: var(--gold);
  --color-accent-200: #e3c88a;
  --color-accent-300: #d8b96e;
  --color-accent-400: #d0ad57;
  --color-accent-500: var(--gold);
  --color-accent-600: #b08d3c;
  --color-accent-700: #86692c;
  --color-divider: var(--hairline);
  --color-neutral-700: var(--hairline);
  --radius-sm: var(--r-card);
  --radius-md: var(--r-card);
  --radius-lg: var(--r-card);
  --font-heading: var(--font-sys);
  --font-heading-weight: 600;
  /* the hero figure carries the only shadow on the site; kill the DS's */
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  /* legacy rhythm tokens some page rules still multiply against */
  --leading: 28px;
  --half: 14px;
  --edge: clamp(20px, 5vw, 72px);
  --measure: 68ch;
}

@media (max-width: 480px) {
  :root { --section-y: 48px; }
}

/* — global reduce-motion kill switch ——————————————————————————————————— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* — base ——————————————————————————————————————————————————————————————— */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sys);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  /* flat ground — the previous radial "lit ground" bloom was a decorative
     background gradient, which this pass rules out */
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-wrap: pretty;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--edge); }

/* — type ramp —————————————————————————————————————————————————————————— */
h1, h2, h3, h4 {
  font-family: var(--font-sys);
  color: var(--text);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600; line-height: 1.15; letter-spacing: -0.01em;
  margin: 0 0 var(--s-4);
}
h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600; line-height: 1.25; letter-spacing: -0.01em;
  margin: 0 0 var(--s-3);
}
p { margin: 0 0 var(--s-4); font-size: 17px; line-height: 1.5; }
p:last-child { margin-bottom: 0; }

/* Caps are for SHORT labels only — eyebrows, stat labels, tags, the badge
   note. Never for multi-word headings or body copy. (The hero headline is the
   one exception the brief carves out, and it keeps its own rule.) */
.eyebrow, .kicker, .stat-label, .badges-note, .res-tag, .field-label {
  display: block;
  font-size: 13px; line-height: 1.3;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 var(--s-3);
}

/* — links ——————————————————————————————————————————————————————————————
   Gold, underline on hover/focus. Gold is reserved for the wordmark,
   headings, links, stat numbers and primary actions — there is no second
   accent anywhere in this file. */
a { color: var(--gold); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* — hairline rule ——————————————————————————————————————————————————————
   Replaces the gold-gradient dividers everywhere outside the header lockup. */
.rule, hr.rule {
  height: 1px; border: 0; margin: 0;
  background: var(--hairline);
}

/* ==========================================================================
   Masthead — one compact row, identical at every width.
   Structure is unchanged from the approved pass; only the palette and the
   token plumbing move. The header's gold gradient underscore is the one
   gradient divider the brief keeps.
   ========================================================================== */
.nav {
  position: relative;
  display: flex; align-items: center; flex-wrap: nowrap;
  gap: var(--s-3);
  padding: var(--s-2) clamp(16px, 2vw, 32px);
  border-bottom: none;
}
.nav .nav-brand {
  font-family: var(--font-wordmark);
  font-style: italic; font-weight: 800; letter-spacing: -0.02em;
  font-size: 26px; line-height: 1;
  color: var(--gold);
  margin-right: auto; padding-bottom: 0;
  background: none; -webkit-background-clip: initial; background-clip: initial;
}
.nav a { white-space: nowrap; }
.nav a:not(.btn) {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; box-sizing: border-box;
  padding-inline: 6px;
  /* the nav keeps its approved 0.14em tracking rather than the 0.08em label
     default — the brief asks for this masthead to be preserved as-is */
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); border: 0; background: none; text-decoration: none;
}
.nav a:not(.btn):hover,
.nav a:not(.btn):focus-visible {
  color: var(--gold);
  text-decoration: underline; text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}
.nav a:not(.btn):last-child { margin-right: -6px; }
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(to right, transparent,
    color-mix(in srgb, var(--gold) 45%, transparent) 48px calc(100% - 48px), transparent);
}

/* ==========================================================================
   Buttons — one filled gold pill per section at most, ghosts stay outlined.
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  box-sizing: border-box;
  min-height: 44px; padding: var(--s-3) var(--s-6);
  font-family: var(--font-sys); font-size: 17px; font-weight: 600; line-height: 1.2;
  border-radius: var(--r-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus-visible { text-decoration: none; }
.btn-primary { background: var(--gold); color: #0b0a09; border-color: var(--gold); }
.btn-primary:hover { background: #d8b45c; border-color: #d8b45c; }
.btn-secondary, .btn-ghost {
  background: transparent; color: var(--gold); border-color: var(--hairline);
}
.btn-secondary:hover, .btn-ghost:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .badge, .nav a, .res-row {
    transition: background-color 0.2s ease-out, border-color 0.2s ease-out,
                color 0.2s ease-out, opacity 0.2s ease-out, transform 0.2s ease-out;
  }
  .btn:active { transform: scale(0.97); }
}

/* ==========================================================================
   Forms — iOS-style fields, at every width (not just phone).
   ========================================================================== */
.input {
  width: 100%; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 164, 74, 0.25);
  border-radius: var(--r-card);
  min-height: 44px; padding: 12px 16px;
  font-family: var(--font-sys); font-size: 16px; line-height: 1.4;
  color: var(--text);
}
.input::placeholder { color: var(--text-muted); }
.input:hover { border-color: rgba(201, 164, 74, 0.4); }
.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--focus);
}
textarea.input { min-height: 140px; resize: vertical; }
.field { margin: 0 0 var(--s-6); }
.field-label { color: var(--text-muted); margin-bottom: var(--s-2); }

/* segmented control — de-boxed to a hairline group, 44px tall */
.seg {
  display: inline-flex; flex-wrap: wrap; overflow: hidden;
  border: 1px solid var(--hairline); border-radius: var(--r-card);
}
.seg-opt {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; box-sizing: border-box;
  padding: var(--s-2) var(--s-4);
  font-size: 16px; color: var(--text); cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--hairline); }
.seg-opt:has(input:checked) { color: #0b0a09; background: var(--gold); font-weight: 600; }
.seg-opt:not(:has(input:checked)):hover {
  background: color-mix(in srgb, var(--gold) 10%, transparent);
}
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: -2px; }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

/* ==========================================================================
   Store badges — official artwork, unmodified.

   Apple's SVG box IS the badge (119.66 x 40, its grey border included), so its
   clear space has to be added around it here.
   Google's PNG (646 x 250) already carries 41px of transparent padding a side:
   the visible mark is 564 x 168, i.e. 67.2% of the file's height, and that
   padding is 24.4% of the mark's height — Google's own quarter-height rule.
   So both are driven off one --badge-h (the VISIBLE height) and Google's image
   is scaled up by 1/0.672 to compensate for the padding baked into the file.
   ========================================================================== */
/* One row at every width, App Store first. nowrap is deliberate: the --badge-h
   clamp above is what keeps the pair inside the gutter, so the row must not
   silently reflow into a column instead. The gap is small because the required
   clear space already lives inside the two boxes — between the visible marks
   there is Apple's H/4 plus Google's baked-in H/4, about half a badge height. */
.badges {
  display: flex; align-items: center; flex-wrap: nowrap;
  gap: var(--s-2);
  margin: 0; padding: 0; list-style: none;
}
.badge { display: inline-flex; align-items: center; flex: none; }
.badge img { display: block; width: auto; }
.badge-apple { padding: calc(var(--badge-h) / 4); }
.badge-apple img { height: var(--badge-h); }
.badge-google img { height: calc(var(--badge-h) / 0.672); }

/* not live yet: href-less anchors are non-clickable and non-focusable, so
   adding a single href to each turns it into a live link with no other edit */
.badges[data-state="coming-soon"] .badge { opacity: 0.6; }
.badge:not([href]) { cursor: default; }
.badges-note { margin: var(--s-3) 0 0; }

/* on a phone the pair centres in the column, with COMING SOON centred under
   both; at desktop widths they stay left-aligned with the hero copy above them */
@media (max-width: 640px) {
  .badges { justify-content: center; }
  .badges-note { text-align: center; }
}

/* ==========================================================================
   Shared footer — every page.
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: var(--s-16);
  padding: var(--s-8) 0 var(--s-12);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0 var(--s-3);
  font-size: 13px; line-height: 1.6; color: var(--text-muted);
}
.site-footer a {
  color: var(--text-muted); text-decoration: none;
  display: inline-flex; align-items: center;
  min-height: 44px; padding-inline: 2px;
}
.site-footer a:hover, .site-footer a:focus-visible {
  color: var(--gold); text-decoration: underline; text-underline-offset: 3px;
}
.site-footer .sep { opacity: 0.45; }
.site-footer .legal { width: 100%; margin: 0; font-size: 13px; color: var(--text-muted); }

/* ==========================================================================
   Prose — privacy policy and any long-form page.
   ========================================================================== */
.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-12); }
.prose h2:first-of-type { margin-top: var(--s-8); }
.prose p, .prose li { font-size: 17px; line-height: 1.6; color: var(--text); }
.prose ul { padding-left: var(--s-6); margin: 0 0 var(--s-4); }
.prose li { margin-bottom: var(--s-2); }
.prose .lede { color: var(--text-muted); }
/* a link that is the whole point of its list item is a target, not a word in a
   sentence — give it the 44px touch height */
.prose li a { display: inline-flex; align-items: center; min-height: 44px; }
