/* LongPlank — "The Held Line" shared stylesheet.
 *
 * Single source of truth for the web surface (landing page + legal pages).
 * The --lp-* custom properties MIRROR the iOS tokens in
 * Sources/Shared/DesignSystem.swift (LP.Palette / LP.Space / LP.Radius) EXACTLY.
 * Do not hand-edit a value here without changing it there too — Scripts/check_design_tokens.py
 * exits non-zero if web and iOS tokens drift (run it manually / pre-commit). iOS is canonical; the web mirrors it.
 *
 * Brand: strictly neutral canvas, ONE ember accent reserved for the live/effort
 * state and small marks, a thin plank baseline as the structural spine,
 * monospaced (tabular) digits wherever a number is measured.
 */

/* ---- Tokens: light (mirror LP.Palette light, 0xRRGGBB) ---- */
:root {
  --lp-bg:         #F2F2F0; /* LP.Palette.bg       */
  --lp-surface:    #FFFFFF; /* LP.Palette.surface  */
  --lp-ink:        #1A1A17; /* LP.Palette.ink      */
  --lp-ink-muted:  #6E6E68; /* LP.Palette.inkMuted */
  --lp-hairline:   #DDDDD8; /* LP.Palette.hairline */
  --lp-ember:      #DE4B26; /* LP.Palette.ember    */
  --lp-ember-dim:  #DE4B2622; /* LP.Palette.emberDim: ember at 0x22 alpha (exact packed iOS value) */

  /* Spacing: the iOS 4-pt grid as px (LP.Space) */
  --lp-space-xs:   4px;
  --lp-space-s:    8px;
  --lp-space-m:    12px;
  --lp-space-l:    16px;
  --lp-space-xl:   24px;
  --lp-space-xxl:  32px;
  --lp-space-huge: 48px;

  /* Radius (LP.Radius) */
  --lp-radius-control: 16px;
  --lp-radius-card:    20px;

  /* Type. Rounded resolves to SF Rounded only on Apple browsers (matching the
   * iOS titles/timer); elsewhere it gracefully falls back to the system sans. */
  --lp-font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --lp-font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Tokens: dark (mirror LP.Palette dark) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --lp-bg:        #0E0E0C;
    --lp-surface:   #1A1A17;
    --lp-ink:       #F2F2EE;
    --lp-ink-muted: #9A9A92;
    --lp-hairline:  #2A2A26;
    --lp-ember:     #FF6A43;
    --lp-ember-dim: #FF6A4330; /* 0xFF6A4330 */
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: var(--lp-font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings use the rounded face to echo the iOS titles. */
h1, h2, h3 { font-family: var(--lp-font-rounded); }
h1 { font-size: 32px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: var(--lp-space-huge) 0 var(--lp-space-s); font-weight: 600; }
h3 { font-size: 16px; margin: var(--lp-space-xl) 0 var(--lp-space-xs); font-weight: 600; color: var(--lp-ink); }

p, li { font-size: 16px; color: var(--lp-ink); }
ul, ol { padding-left: 20px; }
li { margin: var(--lp-space-xs) 0; }

/* Links are ink + underlined: affordance without color. Ember is reserved for the
 * live/effort accent and never appears as small text, so light mode stays AA. */
a { color: var(--lp-ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

code {
  background: var(--lp-hairline);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

hr {
  border: 0;
  border-top: 1px solid var(--lp-hairline);
  margin: var(--lp-space-xxl) 0;
}

/* ---- Brand primitives (shared vocabulary across pages) ---- */

/* Tracked uppercase status line — iOS LP.Typo.eyebrow (default face, semibold). */
.eyebrow {
  letter-spacing: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--lp-ink-muted);
  text-transform: uppercase;
  margin: 0 0 var(--lp-space-xs);
}

/* The plank baseline: a thin hairline rule, the app's structural spine. */
.lp-baseline {
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: var(--lp-hairline);
  margin: var(--lp-space-xl) 0;
}
.lp-baseline--live { background: var(--lp-ember); box-shadow: 0 0 14px var(--lp-ember-dim); }

/* Monospaced (tabular) digits — the "precise instrument" signature on web. */
.lp-mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---- Layout ---- */
.wrap { max-width: 720px; margin: 0 auto; padding: var(--lp-space-huge) var(--lp-space-xl) 96px; }
.meta { color: var(--lp-ink-muted); font-size: 14px; margin: var(--lp-space-xs) 0 0; }
.todo { color: var(--lp-ember); font-weight: 600; }

/* Legal-page header: strong ink baseline under the title. */
.page-header { border-bottom: 2px solid var(--lp-ink); padding-bottom: var(--lp-space-l); margin-bottom: var(--lp-space-xxl); }

/* Cards: surface fill on the canvas (privacy summary / support callout). */
.summary {
  background: var(--lp-surface);
  border: 1px solid var(--lp-hairline);
  border-radius: 12px;
  padding: 20px var(--lp-space-xl);
  margin: var(--lp-space-xl) 0 var(--lp-space-s);
}
.summary h2 { margin-top: 0; }
.callout {
  background: var(--lp-surface);
  border: 1px solid var(--lp-hairline);
  border-left: 3px solid var(--lp-ember);
  border-radius: 8px;
  padding: var(--lp-space-l) var(--lp-space-xl);
  margin: var(--lp-space-l) 0;
}

footer {
  margin-top: 64px;
  padding-top: var(--lp-space-xl);
  border-top: 1px solid var(--lp-hairline);
  color: var(--lp-ink-muted);
  font-size: 13px;
}

/* ---- Landing-page components ---- */

.lp-nav {
  max-width: 980px;
  margin: 0 auto;
  padding: var(--lp-space-xl) var(--lp-space-xl) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lp-nav__brand { font-family: var(--lp-font-rounded); font-weight: 600; letter-spacing: 0.5px; text-decoration: none; color: var(--lp-ink); }
.lp-nav__links a { color: var(--lp-ink-muted); text-decoration: none; margin-left: var(--lp-space-l); font-size: 14px; }
.lp-nav__links a:hover { color: var(--lp-ink); }

.hero { max-width: 720px; margin: 0 auto; padding: 88px var(--lp-space-xl) var(--lp-space-huge); text-align: center; }
.hero h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.02em; margin: var(--lp-space-m) 0 var(--lp-space-l); }
.hero p.lead { font-size: 19px; color: var(--lp-ink-muted); max-width: 30em; margin: 0 auto var(--lp-space-xl); }

/* The hero timer mark: a big monospaced read echoing the iOS hero. */
.hero-timer {
  font-family: var(--lp-font-rounded);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 76px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--lp-ink);
  margin: 0;
}

/* Primary control — ink fill, mirroring the iOS idle PrimaryControl.
 * Ember stays reserved for the live state, so the CTA is disciplined ink. */
.lp-btn {
  display: inline-block;
  background: var(--lp-ink);
  color: var(--lp-bg);
  font-family: var(--lp-font-rounded);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  padding: 14px var(--lp-space-xl);
  border-radius: var(--lp-radius-control);
  border: 0;
}
.lp-btn:hover { opacity: 0.9; text-decoration: none; }
.lp-btn--ghost { background: transparent; color: var(--lp-ink); border: 1px solid var(--lp-hairline); }
/* Non-interactive status badge (e.g. "Coming soon"): looks like the control, isn't a button. */
.lp-btn--soon { cursor: default; }

.features { max-width: 980px; margin: 0 auto; padding: var(--lp-space-huge) var(--lp-space-xl); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--lp-space-xl); }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--lp-surface); border: 1px solid var(--lp-hairline); border-radius: var(--lp-radius-card); padding: var(--lp-space-xl); }
.feature h3 { margin: 0 0 var(--lp-space-s); color: var(--lp-ink); font-size: 17px; }
.feature p { margin: 0; color: var(--lp-ink-muted); font-size: 15px; }

.section { max-width: 720px; margin: 0 auto; padding: var(--lp-space-xxl) var(--lp-space-xl); text-align: center; }
.cta { text-align: center; padding: var(--lp-space-huge) var(--lp-space-xl) 96px; }

/* ---- Cookie consent banner (injected by analytics.js) ---- */
.lp-consent {
  position: fixed;
  left: 50%;
  bottom: var(--lp-space-l);
  transform: translateX(-50%);
  width: calc(100% - 2 * var(--lp-space-l));
  max-width: 680px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-hairline);
  border-radius: var(--lp-radius-card);
  padding: var(--lp-space-l) var(--lp-space-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lp-space-m) var(--lp-space-l);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  z-index: 50;
}
.lp-consent__text { margin: 0; flex: 1 1 260px; font-size: 14px; color: var(--lp-ink-muted); }
.lp-consent__actions { display: flex; gap: var(--lp-space-s); margin-left: auto; }
.lp-consent__btn { font-size: 14px; padding: 8px var(--lp-space-l); cursor: pointer; }
