/* ═══════════════════════════════════════════
   Mezzo Design Tokens — CSS Custom Properties
   Lantern visual system (docs/prd/range-ring-and-lantern-refresh.md §4):
   one dark theme for the website and the Companion, Geist type, a small
   palette with one job per color, 3px corners.
   ═══════════════════════════════════════════ */


/* ── Fonts ──
   Geist and Geist Mono, served from Mezzo's own site (/fonts, SIL Open
   Font License) rather than Google Fonts, so no font request leaves the
   site (2026-11-13). Latin subsets, the same files the extension bundles.
   The URLs are relative to this stylesheet, so they also work in the
   Companion, which loads it by absolute address. */
@font-face {
  font-family: 'Geist';
  src: url('../../fonts/geist-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../../fonts/geist-mono-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --font-display: 'Geist', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace; /* small uppercase labels only */

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --tracking-heading: -0.04em;
  --tracking-label: 0.12em;  /* Geist Mono uppercase labels */
}


/* ── Semantic color roles (PRD §4.2, §10). One job per token; pages and the
   Companion use these, never literal colors. Translucent uses mix a role
   with transparent rather than adding a token, e.g.
   color-mix(in srgb, var(--color-text) 30%, transparent).
   Chartreuse (--color-accent) is the website's brand color; inside the
   Companion it only ever means the over-range band. ── */
:root {
  /* PRD §4.2 roles */
  --color-bg: #2D2E31;               /* Page and Companion screen background */
  --color-bg-slate: #38393C;         /* Raised slate: decision states, hero tile, Get started band */
  --color-bg-decision: var(--color-bg-slate);
  --color-bg-menu: #3C3D40;          /* Menu panel (Ready's profile selector) */
  --color-accent: #DEDE65;           /* Chartreuse */
  --color-text: #F3EBDE;             /* Cream: headings, main text */
  --color-link: #CEE2C4;             /* Sage: text links, focus rings, bullets */
  --color-text-muted: #B0AB9E;       /* Body, captions, labels */
  --color-voice: #8E897B;            /* Range Ring voice circle */

  /* Supporting roles */
  --color-text-soft: var(--color-text);      /* Companion body text, controls */
  --color-label: var(--color-text-muted);    /* Small uppercase labels */
  --color-link-quiet: var(--color-link);     /* Low-emphasis text actions (Cancel, Back) */
  --color-notice: var(--color-link);         /* Calibration status, name-collision notice; never chartreuse */
  --color-on-accent: #2D2E31;                /* Charcoal text on chartreuse or cream fills */
  --color-bg-menu-hover: #46474A;            /* Selector trigger hover */
  --color-bg-raised: var(--color-bg-decision); /* Result card, toast, tooltip: the decision layer, not a darker card */
  --color-overlay: #FFFFFF;                  /* Translucent fills and hairlines on dark */
  --color-shadow: #000000;                   /* Shadows and scrims */

  /* Buttons (PRD §4.5). The website's primary is chartreuse; the Companion
     overrides --color-btn-primary-bg to cream in its own stylesheet. */
  --color-btn-primary-bg: var(--color-accent);
  --color-btn-primary-text: var(--color-on-accent);
  --color-btn-secondary-border: color-mix(in srgb, var(--color-text) 30%, transparent);
}


/* ── Surfaces. Lantern has one dark theme, so every data-surface value
   resolves to it; the attribute stays only so existing markup keeps
   working. Mid is the slate layer. ── */
:root,
[data-surface="dark"],
[data-surface="light"],
[data-surface="mid"],
.surface-dark,
.surface-light,
.surface-mid {
  --surface: var(--color-bg);
  --surface-nav: color-mix(in srgb, var(--color-bg) 92%, transparent);
  --surface-card: color-mix(in srgb, var(--color-text) 4%, transparent);

  --text-primary: var(--color-text);
  --text-default: var(--color-text);
  --text-body: var(--color-text-muted);
  --text-quiet: var(--color-text-muted);
  --text-subdued: var(--color-text-muted);
  --text-ghost: color-mix(in srgb, var(--color-text-muted) 55%, transparent);

  --border: color-mix(in srgb, var(--color-text) 12%, transparent);
  --border-outline: var(--color-btn-secondary-border);
  --border-pip: color-mix(in srgb, var(--color-text) 10%, transparent);
}

[data-surface="mid"],
.surface-mid {
  --surface: var(--color-bg-slate);
}

/* ── Shared (surface-independent) ── */
:root {
  /* Radius — 3px corners on buttons and inputs, no pills (PRD §4.4) */
  --radius-control: 3px;
  --radius-cta: var(--radius-control);
  --radius-pill: var(--radius-control);
  --radius-card: 10px;
  --radius-icon-btn: var(--radius-control);

  /* Spacing */
  --space-nav: 24px 32px;
  --space-page-gap: 48px;
  --space-section: 72px;
  --space-heading-to-content: 40px;
  --space-circle-to-button: 48px;
  --space-button-to-micro: 16px;
  --space-footer: 20px 32px;

  /* Shadows */
  --shadow-pip-window: 0 4px 24px color-mix(in srgb, var(--color-shadow) 25%, transparent);

  /* Transitions */
  --transition-hover: all 0.2s ease;
  --transition-nav: background 0.4s, box-shadow 0.4s;
  --transition-reveal: 0.7s ease;
  --reveal-offset: 16px;

  /* Feedback circle */
  --circle-container: 280px;
  --circle-silence: 45px;
  --circle-within: 90px;
  --circle-elevated: 160px;
  --circle-sustained: 240px;
}


/* ═══════════════════════════════════════════
   Global text and focus (PRD §9a)
   ═══════════════════════════════════════════ */

h1, h2, h3 { text-wrap: balance; }
p, li, figcaption, label { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════
   Typography Tokens — Geist
   ═══════════════════════════════════════════ */

.type-hero-heading {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: clamp(38px, 5vw, 61px);
  line-height: 1.05;
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

.type-section-heading {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

.type-step-heading {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.type-step-number {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
  font-size: 12px;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  color: var(--color-link);
}

.type-statement {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-primary);
}

.type-sub-hero {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-subdued);
}

/* Lowercase "mezzo" wordmark, text only (PRD §4.4) */
.type-nav-wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 22px;
  line-height: 1;
  letter-spacing: var(--tracking-heading);
  text-transform: lowercase;
  color: var(--color-text);
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   Global Navigation
   One canonical header, shared by every page (index.html, privacy.html,
   try-it.html, and any future page) — do not redefine .nav/.nav-link* in a
   page-specific stylesheet. The only thing that should ever differ between
   pages is which link carries .nav-link-active.
   ═══════════════════════════════════════════ */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  /* Lines up with the page content: a 1120px container with 24px gutters. */
  padding: 0 max(24px, calc((100% - 1120px) / 2));
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  padding-bottom: 3px;
  transition: color 0.2s ease;
}

.nav-link-quiet { color: var(--color-text-muted); }
.nav-link-quiet:hover { color: var(--color-text); }

.nav-link-active {
  color: var(--color-text);
  cursor: default;
  border-bottom: 2px solid var(--color-accent);
}

/* ═══════════════════════════════════════════
   Global Footer
   One canonical footer, shared by every page — do not redefine .site-footer
   in a page-specific stylesheet. Content is always "© Mezzo" + "Privacy".
   ═══════════════════════════════════════════ */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-footer);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 700px) {
  .site-footer { padding-left: 48px; padding-right: 48px; }
}

@media (min-width: 1100px) {
  .site-footer { padding-left: 120px; padding-right: 120px; }
}

.type-monitoring-within {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

.type-monitoring-outside {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: 41px;
  line-height: 1.15;
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

.type-privacy-h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

/* ── Body ── */

.type-hero-body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-body);
}

.type-body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
}

.type-situation {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-body);
}

.type-note {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-subdued);
}

.type-microcopy {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-subdued);
}


/* ── UI ── */

.type-cta-primary {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: 14px;
  color: var(--color-btn-primary-text);
}

.type-cta-outline {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: 14px;
  color: var(--color-text);
}

/* Geist Mono uppercase: small labels only */
.type-tag,
.type-pip-pill,
.type-state-label {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.type-tag { font-size: 12px; color: var(--color-text-muted); }
.type-pip-pill { font-size: 11px; color: var(--text-subdued); }
.type-state-label { font-size: 10px; color: var(--text-ghost); }

.type-footer-brand {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 12px;
  color: var(--color-text-muted);
}

.type-footer-link {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition-hover);
}

.type-footer-link:hover { color: var(--color-link); }


/* ═══════════════════════════════════════════
   Component Tokens — buttons (PRD §4.5)
   ═══════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: 15px;
  line-height: 1.2;
  color: var(--color-btn-primary-text);
  background: var(--color-btn-primary-bg);
  padding: 13px 24px;
  border-radius: var(--radius-control);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-hover);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--color-btn-primary-bg) 86%, var(--color-text));
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: 14px;
  color: var(--color-text);
  background: transparent;
  padding: 11px 20px;
  border-radius: var(--radius-control);
  border: 1px solid var(--color-btn-secondary-border);
  cursor: pointer;
  transition: var(--transition-hover);
}
.btn-outline:hover {
  border-color: color-mix(in srgb, var(--color-text) 55%, transparent);
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}

.btn-stop {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: 15px;
  color: var(--color-btn-primary-text);
  background: var(--color-btn-primary-bg);
  padding: 14px 40px;
  border-radius: var(--radius-control);
  border: none;
  cursor: pointer;
  transition: var(--transition-hover);
}

.pip-pill {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-subdued);
  background: var(--surface-card);
  padding: 6px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-pip);
  cursor: pointer;
  transition: var(--transition-hover);
}
.pip-pill:hover {
  color: var(--color-link);
  border-color: var(--border-outline);
}

/* ── Theme Toggle (Light / Dark / Auto) — not loaded by any page since the
   Lantern single dark theme; restyled only so nothing still references a
   retired token. ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.theme-toggle-btn {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-subdued);
  background: none;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: var(--transition-hover);
}

.theme-toggle-btn:hover {
  color: var(--text-default);
}

.theme-toggle-btn.active {
  color: var(--color-btn-primary-text);
  background: var(--color-btn-primary-bg);
}
