/* ==========================================================================
   MacTrak launch site — tokens mirrored from mactrak-app/src/theme/tokens.ts
   Depth via hairline borders, never shadows (app convention).

   The page is DARK-FIRST: it is pinned to the app's dark palette in every
   environment, matching the icon, the splash and the store screenshots.
   There is deliberately no light mode — do not reintroduce a
   prefers-color-scheme block without also re-checking the phone mockup,
   which hardcodes the dark theme.
   ========================================================================== */

:root {
  /* Macro / brand palette — identical in both app themes */
  --teal:   #14B8A6;
  --violet: #8B5CF6;
  --amber:  #F59E0B;
  --rose:   #F43F5E;
  --navy:   #0B1120;

  /* Dark theme (tokens.ts darkColors) */
  --bg:               #0B1120;
  --surface:          #1E293B;
  --surface-elevated: #27344D;
  --text-primary:     #F1F5F9;
  --text-secondary:   #94A3B8;
  --border:           #334155;
  --accent:           var(--teal);
  --on-accent:        var(--navy); /* white-on-teal fails WCAG; app uses navy */

  /* Radius scale */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Spacing scale */
  --s-xs: 4px;  --s-sm: 8px;  --s-md: 16px;
  --s-lg: 24px; --s-xl: 32px; --s-xxl: 48px;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;

  color-scheme: dark;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark, .price-num, .ring-value {
  font-family: var(--font-display);
  line-height: 1.15;
}

h1 { font-size: clamp(32px, 6vw, 52px); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 20px; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--s-lg);
}
.container.narrow { max-width: 560px; text-align: center; } /* app maxContentWidth */

.section { padding: var(--s-xxl) 0; }
.section h2 { margin-bottom: var(--s-sm); }
.section-lede { color: var(--text-secondary); font-size: 18px; margin-bottom: var(--s-xl); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---------- Logo lockup (mark + wordmark) ---------- */

.lockup { display: inline-flex; align-items: center; gap: 10px; }
.lockup:hover { text-decoration: none; }
.logo-mark { display: block; flex: none; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.wordmark span { color: var(--teal); }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: var(--s-lg);
  height: 64px;
}
.nav-links { display: flex; gap: var(--s-lg); margin-left: auto; }
.nav-links a { color: var(--text-secondary); font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  padding: 12px 24px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- Hero ---------- */

.hero { padding: var(--s-xxl) 0; overflow: hidden; position: relative; }

/* Brand glow — the teal→violet gradient tokens.ts reserves for hero elements,
   used here as atmosphere rather than a hard shape. */
.hero::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 620px;
  background:
    radial-gradient(48% 60% at 22% 32%, color-mix(in srgb, var(--teal) 26%, transparent), transparent 70%),
    radial-gradient(42% 55% at 78% 18%, color-mix(in srgb, var(--violet) 24%, transparent), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-xxl);
  align-items: center;
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: var(--s-md);
}

.hero h1 { margin-bottom: var(--s-md); }

/* Brand gradient (teal → violet) — reserved for hero elements, per tokens.ts */
.grad {
  background: linear-gradient(90deg, var(--teal), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 46ch;
  margin-bottom: var(--s-lg);
}

/* ---------- Waitlist form ---------- */

.waitlist {
  display: flex; flex-wrap: wrap; gap: var(--s-sm);
  max-width: 440px;
}
.waitlist-secondary { margin: 0 auto; justify-content: center; }

.waitlist input {
  flex: 1 1 220px;
  font: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 12px 20px;
}
.waitlist input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
.waitlist input::placeholder { color: var(--text-secondary); }

.form-status {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--text-secondary);
  min-height: 1.4em;
}
.form-status.ok { color: var(--teal); }
.form-status.err { color: var(--rose); }

.store-badges { display: flex; gap: var(--s-sm); margin-top: var(--s-lg); flex-wrap: wrap; }
.badge-soon {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 6px 14px;
}

/* ---------- Phone mockup ---------- */

.hero-visual { display: flex; justify-content: center; }

.phone {
  width: 300px;
  border-radius: 44px;
  padding: 10px;
  background: var(--navy);
  border: 1px solid var(--border);
}

.phone-screen {
  border-radius: 36px;
  background: #0B1120;               /* app dark background — mockup is always dark */
  border: 1px solid #334155;
  padding: var(--s-lg) var(--s-md);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-md);
}

.screen-header {
  width: 100%;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 var(--s-sm);
}
.screen-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; color: #F1F5F9;
}
.screen-date { font-size: 12px; color: #94A3B8; }

/* ---------- Rings ---------- */

.ring { position: relative; display: grid; place-items: center; }
.ring svg { display: block; transform: none; }

.ring-track { fill: none; stroke: #334155; }           /* track = border color (dark) */
.ring-arc {
  fill: none;
  stroke-linecap: round;                                /* app: round linecap, fills from 12 o'clock */
  transition: stroke-dashoffset 800ms ease;             /* app animates over 800ms */
}
.arc-teal   { stroke: var(--teal); }
.arc-violet { stroke: var(--violet); }
.arc-amber  { stroke: var(--amber); }
.arc-rose   { stroke: var(--rose); }

.ring-center {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.ring-value {
  font-weight: 700; color: #F1F5F9; display: block;
}
.ring-lg .ring-value { font-size: 34px; }
.ring-sm .ring-value { font-size: 15px; }
.ring-label { font-size: 12px; color: #94A3B8; display: block; }
.ring-sm .ring-label { font-size: 10px; }

.ring-row { display: flex; gap: var(--s-sm); }

.screen-entries {
  width: 100%;
  display: flex; flex-direction: column; gap: var(--s-sm);
}
.entry {
  display: flex; justify-content: space-between; align-items: center;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: var(--r-md);
  padding: 10px var(--s-md);
  font-size: 13px;
  color: #F1F5F9;
}
.entry-cal { color: #94A3B8; }

/* ---------- Rings out in the page (feature + pricing tier marks) ---------- */

.ring-icon, .tier-ring { margin-bottom: var(--s-md); }
.ring-icon .ring-track, .tier-ring .ring-track { stroke: var(--border); }

.ring-icon .glyph, .tier-ring .glyph {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  pointer-events: none;
}
.ring-icon .glyph svg { width: 22px; height: 22px; }
.tier-ring .glyph svg { width: 18px; height: 18px; }

/* ---------- Cards (app Card: hairline border, radius.lg, left accent bar) ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
}
.accent-teal   { border-left: 3px solid var(--teal); }
.accent-violet { border-left: 3px solid var(--violet); }
.accent-amber  { border-left: 3px solid var(--amber); }
.accent-rose   { border-left: 3px solid var(--rose); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-md);
}
.feature-grid h3 { margin-bottom: var(--s-sm); }
.feature-grid p { color: var(--text-secondary); font-size: 15px; }

/* ---------- Simplicity band ---------- */

.band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.band .section-lede { margin-bottom: 0; }
.band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xl);
  align-items: center;
}
.band-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-lg); }
.band-col h4 {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: var(--s-md);
}
.band-col .in  { color: var(--teal); }
.band-col .out { color: var(--rose); }

ul.list-check, ul.list-cross { list-style: none; }
.list-check li, .list-cross li {
  padding-left: 26px;
  position: relative;
  margin-bottom: var(--s-sm);
  color: var(--text-secondary);
  font-size: 15px;
}
.list-check li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--teal); font-weight: 700;
}
.list-cross li::before {
  content: "✕";
  position: absolute; left: 0;
  color: var(--rose); font-weight: 700;
}

/* ---------- Pricing ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-md);
  align-items: start;
  max-width: 760px;
}

.price-card h3 { margin-bottom: var(--s-sm); }
.price { display: flex; align-items: baseline; gap: var(--s-sm); margin-bottom: var(--s-xs); }
.price-num { font-size: 40px; font-weight: 700; }
.price-per { color: var(--text-secondary); }
.price-alt { color: var(--text-secondary); font-size: 14px; margin-bottom: var(--s-md); }
.price-card ul { margin: var(--s-md) 0; }
.price-card .btn { width: 100%; text-align: center; }

.price-featured { border-color: var(--teal); border-left: 3px solid var(--teal); }
.plan-flag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--on-accent);
  background: var(--teal);
  border-radius: var(--r-full);
  padding: 3px 12px;
  margin-bottom: var(--s-md);
}

.founding {
  max-width: 760px;
  margin-top: var(--s-md);
  color: var(--text-secondary);
}
.founding strong { color: var(--text-primary); }

/* ---------- Final CTA ---------- */

.cta-final { text-align: center; }
.cta-final .cta-mark { margin: 0 auto var(--s-lg); }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: var(--s-xl) 0;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: var(--s-xl);
  flex-wrap: wrap;
}
.footer-brand p { color: var(--text-secondary); font-size: 14px; margin-top: var(--s-xs); }
.footer-meta { text-align: right; }
.footer-meta p { color: var(--text-secondary); font-size: 13px; margin-bottom: var(--s-xs); }
.footer-links .dot { margin: 0 var(--s-sm); color: var(--border); }
.footer-links .soon { color: var(--text-secondary); opacity: 0.7; cursor: default; }

/* ---------- Legal pages (privacy, terms) ---------- */

.legal { padding: var(--s-xxl) 0; }
.legal-head { max-width: 720px; margin: 0 auto var(--s-xl); }
.legal-head h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: var(--s-md); }

/* Version + effective-date chips */
.legal-meta { display: flex; flex-wrap: wrap; gap: var(--s-sm); margin-bottom: var(--s-md); }
.legal-chip {
  font-family: var(--font-display);
  font-weight: 500; font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 5px 14px;
}
.legal-chip.accent { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, var(--border)); }
.legal-note { color: var(--text-secondary); font-size: 15px; }

.legal-body { max-width: 720px; margin: 0 auto; }
.legal-body section { margin-bottom: var(--s-xl); }
.legal-body h2 {
  font-size: 20px; font-weight: 600;
  margin-bottom: var(--s-md);
  padding-bottom: var(--s-sm);
  border-bottom: 1px solid var(--border);
}
.legal-body h3 { font-size: 16px; margin: var(--s-md) 0 var(--s-xs); color: var(--text-primary); }
.legal-body p { color: var(--text-secondary); margin-bottom: var(--s-md); }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body strong { color: var(--text-primary); font-weight: 600; }
.legal-body ul { list-style: none; margin: 0 0 var(--s-md); }
.legal-body ul li {
  position: relative; padding-left: 22px;
  color: var(--text-secondary); margin-bottom: var(--s-sm);
}
.legal-body ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
}
.legal-toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-lg); margin-bottom: var(--s-xl);
}
.legal-toc h2 {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary);
  border: 0; padding: 0; margin-bottom: var(--s-md);
}
.legal-toc ol { list-style: none; counter-reset: toc; columns: 2; column-gap: var(--s-xl); }
.legal-toc li { counter-increment: toc; margin-bottom: var(--s-xs); break-inside: avoid; }
.legal-toc a { color: var(--text-secondary); font-size: 14px; }
.legal-toc a:hover { color: var(--teal); }
.legal-toc li::before { content: counter(toc) ". "; color: var(--text-secondary); opacity: 0.6; }

.footer-links a.soon-live { color: var(--text-secondary); opacity: 1; }
.footer-links a.soon-live:hover { color: var(--text-primary); }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .hero-grid, .band-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .phone { width: 260px; }
  .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
  .legal-toc ol { columns: 1; }
}

/* ---------- Reduced motion (app parity: numbers jump when the OS asks) ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring-arc { transition: none; }
  .btn { transition: none; }
}
