/* ============================================================================
   Phonecast - Design Tokens (web)
   The site is permanently DARK - no prefers-color-scheme switching. Values are
   the brand's dark palette (see brand/BRAND.md), with secondary text lifted to
   #A1A1A6 for comfortable contrast on black (~8:1, WCAG AA+).
   ========================================================================== */

:root {
  color-scheme: dark; /* dark form controls + scrollbars */

  --bg-primary: #000000;
  --bg-secondary: #1C1C1E;       /* deep charcoal layer */

  --text-primary: #F5F5F7;       /* off-white to prevent eye strain */
  --text-secondary: #A1A1A6;     /* lifted gray - readable on pure black */

  --accent-color: #0A84FF;       /* blue optimized for dark backgrounds */
  --border-color: rgba(255, 255, 255, 0.14);

  /* Functional status colors (dark-optimized) */
  --status-streaming: #30D158;
  --status-searching: #FF9F0A;
  --status-idle: var(--text-secondary);
  --status-stop: #FF453A;

  /* ---- Spacing: 8px grid ---- */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;

  /* ---- Radii hierarchy ---- */
  --radius-lg: 20px;   /* cards, modals (parent) */
  --radius-md: 12px;   /* buttons, inputs (child) */
  --radius-sm: 6px;    /* tags, badges */
  --radius-pill: 9999px;

  /* ---- Typography ---- */
  /* Web uses Inter (open-source). system-ui is a generic fallback - we do NOT
     ship Apple's San Francisco font, which isn't licensed for the web. */
  --font-sans: "Inter", system-ui, "Helvetica Neue", Arial, sans-serif;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* ---- Elevation (tuned for black) ---- */
  --shadow-card:
    0px 1px 2px rgba(0, 0, 0, 0.35),
    0px 10px 30px rgba(0, 0, 0, 0.40),
    0px 20px 60px rgba(0, 0, 0, 0.40);
}

/* ============================================================================
   Base
   ========================================================================== */
html {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { margin: 0; }

/* Keyboard focus - brand-blue ring, only for keyboard navigation (a11y) */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ============================================================================
   Typographic scale (see BRAND.md §3)
   ========================================================================== */
.t-hero {
  font-size: clamp(56px, 8vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: var(--fw-extrabold);
}
.t-h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: var(--fw-bold);
}
.t-h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: var(--fw-semibold);
}
.t-body {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  font-weight: var(--fw-regular);
  color: var(--text-secondary);
}
.t-caption {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

/* ============================================================================
   Components (dark)
   ========================================================================== */

/* Translucent header (glassmorphism) */
.native-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 52px;
  z-index: 1000;

  background-color: rgba(18, 18, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ---- Fluid pass (2026-08-25) — motion + materials. Spec: BRAND.md §7 ----
   Two named springs, sampled into linear() from the real physics
   (damping/response, Apple's parameters). Settle = critically damped 0.35s
   response: every state change. Flick = damping 0.8: ONLY for a live (blue)
   element the user just threw; bounce must be earned by momentum. */
:root {
  --spring-settle: linear(0, .1092, .309, .5015, .656, .7698, .8493, .9029,
                          .9383, .9612, .9758, .985, .9908, .9944, .9966, .9979, 1);
  --spring-flick: linear(0, .1576, .4364, .6821, .8507, .9481, .9951, 1.0124,
                         1.015, 1.0119, 1.0076, 1.0041, 1.0019, 1.0006, 1, .9998, 1);
  --dur-settle: .5s;
  --dur-flick: .6s;
}

/* Materials. glass-s (structural) organizes: heavier, darker; content scrolls
   beneath it. glass-r (raised) floats interactive surfaces. Never stack two
   glass-r layers. Accent color lives on solid layers, not on glass. */
.glass-s { background: rgba(10, 10, 12, .55);
           backdrop-filter: blur(20px) saturate(160%);
           -webkit-backdrop-filter: blur(20px) saturate(160%); }
.glass-r { background: rgba(28, 28, 30, .72);
           backdrop-filter: blur(22px) saturate(160%);
           -webkit-backdrop-filter: blur(22px) saturate(160%);
           border: 1px solid rgba(255, 255, 255, .12); }
@media (prefers-reduced-transparency: reduce) {
  .native-header, .glass-s, .glass-r {
    background: #0A0A0C; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Diffuse card */
.premium-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
}

/* Buttons */
.btn-small { height: 36px; font-size: 14px; }

/* Inputs */
.field {
  height: 48px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
}

/* Badge / tag */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: var(--fw-medium);
}

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
}
.status-dot.is-streaming { background: var(--status-streaming); }
.status-dot.is-searching { background: var(--status-searching); }
.status-dot.is-idle { background: var(--status-idle); }

/* ============================================================================
   Utility-page components - SINGLE SOURCE
   (BRAND-CLAUDE.md § Utility-page canon + § Anti-drift.)
   start / account / reset / confirmed / contact consume these; they must NOT
   re-declare-and-tweak them. Copy-pasted per-page copies are exactly how the
   .check tracking, .msg margins and footer-link drift got in.
   Only components no marketing page uses live here unscoped: .btn, .foot and
   .brand legitimately differ on index.html, so those stay per-page until the
   marketing pages are migrated too.
   ========================================================================== */

/* Inline status message under a form or action */
.msg { font-size: 13px; line-height: 1.5; margin: 12px 0 0; min-height: 18px; }
.msg.err { color: var(--status-stop); }
.msg.ok { color: var(--status-streaming); }
.msg.info { color: var(--status-searching); }

/* Micro-label above an h1. 11px mono, +.12em is the spec CEILING, not a default */
.step { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .12em;
        text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px; }

/* Confirmed-working label. Green = done. Tracking is +.1em (.12em is .step's) */
.check { display: inline-flex; align-items: center; gap: 8px;
         font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .1em;
         text-transform: uppercase; color: var(--status-streaming); margin-bottom: 14px; }
.check .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-streaming); }

/* Amber = waiting/in-progress (green is reserved for confirmed-working) */
.waitdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
           background: var(--status-searching); margin-right: 8px; vertical-align: 1px; }

/* Loading state */
.loaddots { display: flex; justify-content: center; gap: 8px; padding: 24px 0; }
.loaddots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-color);
              animation: loadpulse 1.1s ease-in-out infinite; }
.loaddots i:nth-child(2) { animation-delay: .18s; }
.loaddots i:nth-child(3) { animation-delay: .36s; }
@keyframes loadpulse { 0%, 100% { opacity: .25; transform: scale(.85); } 45% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .loaddots i { animation: none; opacity: .7; } }

/* NOT here: `.hide{display:none}`. It has to stay the LAST rule of each page's
   own <style>, because a page-local display rule of equal specificity on the
   same element (start.html's .phonerow / .consent) would out-cascade a copy
   living in this earlier stylesheet and the element would never hide. */

/* ============================================================================
   Editorial article components - SINGLE SOURCE (added 2026-08-16)
   Long-form marketing/editorial pages (the guides, about, changelog) consume
   these; per the anti-drift rule they must NOT re-declare-and-tweak. index.html
   keeps its own frame styles for now ("until the marketing pages are migrated",
   see the note above); THIS section is the canon for every long-form page that
   comes after it. Same editorial frame idea: hairlines, mono annotations,
   1120px frame, prose column ~76ch.
   ========================================================================== */

.art-frame { max-width: 1120px; margin: 0 auto; border-inline: 1px solid var(--border-color); }
.art-pad { padding-inline: clamp(20px, 4vw, 56px); }
.art { max-width: 780px; padding-block: clamp(40px, 7vw, 88px); }
.art > * + * { margin-top: var(--space-md); }

/* Headings: article h1 sits under the site hero scale; h2s are the section
   voice. Accent highlights stay EARNED (BRAND rule) - most headings plain. */
.art h1 { font-size: clamp(32px, 5.4vw, 54px); line-height: 1.08; letter-spacing: -.03em;
          font-weight: var(--fw-extrabold); margin: 0; }
.art h1 em, .art h2 em { font-style: normal; color: var(--accent-color); }
.art h2 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; letter-spacing: -.02em;
          font-weight: var(--fw-bold); margin-top: var(--space-xl); }
.art h3 { font-size: 20px; line-height: 1.3; letter-spacing: -.01em;
          font-weight: var(--fw-semibold); margin-top: var(--space-lg); }
.art p, .art li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
.art li { margin-top: 8px; }
.art b, .art strong { color: var(--text-primary); font-weight: var(--fw-semibold); }
.art a { color: var(--text-primary); text-underline-offset: 3px; }
.art a:hover { color: var(--accent-color); }

/* Byline + updated date: the page's provenance, mono-annotated. */
.art-meta { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
            font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .08em;
            text-transform: uppercase; color: var(--text-secondary); }
.art-meta .rule { flex: 1; height: 1px; background: var(--border-color); min-width: 40px; }

/* TL;DR / direct-answer box: the extractable summary up top. */
.tldr { border: 1px solid var(--border-color); border-left: 3px solid var(--accent-color);
        border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md);
        background: rgba(255,255,255,.02); }
.tldr .lbl { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .12em;
             text-transform: uppercase; color: var(--accent-color); display: block; margin-bottom: 8px; }
.tldr p { margin: 0; color: var(--text-primary); }

/* Data table: hairline grid, mono headers, horizontal scroll on phones. */
.art-tablewrap { overflow-x: auto; margin-top: var(--space-md); }
.art table { border-collapse: collapse; width: 100%; min-width: 560px; }
.art th { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .08em;
          text-transform: uppercase; color: var(--text-secondary); font-weight: var(--fw-medium);
          text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--border-color); }
.art td { font-size: 15px; line-height: 1.5; color: var(--text-secondary);
          padding: 12px 14px 12px 0; border-bottom: 1px solid var(--border-color);
          vertical-align: top; }
.art td:first-child { color: var(--text-primary); font-weight: var(--fw-medium); white-space: nowrap; }
.art .yes { color: var(--status-streaming); }
.art .no { color: var(--status-stop); }
.art .part { color: var(--status-searching); }

/* Checklist rows: the .loss pattern generalized. */
.art-list { border-top: 1px solid var(--border-color); margin-top: var(--space-md); }
.art-list > div { display: flex; justify-content: space-between; gap: var(--space-sm);
                  padding: 12px 0; border-bottom: 1px solid var(--border-color); font-size: 15px; }
.art-list .what { color: var(--text-primary); font-weight: var(--fw-medium); }
.art-list .fate { font-family: "IBM Plex Mono", monospace; font-size: 12px;
                  color: var(--text-secondary); text-align: right; }

/* Inline terminal command (wraps: phones must not sidescroll). */
.art code { font-family: "IBM Plex Mono", monospace; font-size: 13.5px; color: var(--text-primary);
            background: var(--bg-secondary); border: 1px solid var(--border-color);
            border-radius: var(--radius-sm); padding: 2px 6px; }

/* CTA button for editorial pages: same system as index (one accent primary
   per view). Unscoped so the header can reuse it at .art-navlinks' size. */
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
        height: 52px; padding: 0 24px; border-radius: var(--radius-md); border: none;
        font-size: 16px; font-weight: var(--fw-semibold); text-decoration: none;
        cursor: pointer; white-space: nowrap; }
.abtn.primary { background: var(--accent-color); color: #fff; }
.abtn.ghost { background: transparent; color: var(--text-primary);
              border: 1px solid var(--border-color); }
.abtn .tag { font-family: "IBM Plex Mono", monospace; font-size: 12px; opacity: .8;
             font-weight: var(--fw-medium); }
.art-cta { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
           margin-top: var(--space-lg); }
@media (max-width: 640px) { .art-cta .abtn { width: 100%; } }

/* Section number device (secnum), shared with the editorial pages. */
.art-secnum { display: flex; align-items: baseline; gap: var(--space-sm);
              margin-top: var(--space-xl); margin-bottom: var(--space-md); }
.art-secnum .n { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--accent-color); }
.art-secnum .rule { flex: 1; height: 1px; background: var(--border-color); align-self: center; }
.art-secnum .lbl { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
                   letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }

/* Header for editorial pages: same 52px glass bar as index (base .native-header
   above), brand home link left, actions right. */
.art-nav { max-width: 1120px; margin: 0 auto; height: 52px; display: flex; align-items: center;
           justify-content: space-between; padding-inline: clamp(20px, 4vw, 56px); }
.art-brand { display: flex; align-items: center; gap: 10px; font-weight: var(--fw-semibold);
             letter-spacing: -.02em; font-size: 15px; color: var(--text-primary); text-decoration: none; }
.art-brand svg { width: 24px; height: 24px; }
.art-brand .c { color: var(--accent-color); }
.art-navlinks { display: flex; align-items: center; gap: var(--space-md); }
.art-navlinks a:not(.abtn) { font-family: "IBM Plex Mono", monospace; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary);
  text-decoration: none; }
.art-navlinks a:not(.abtn):hover { color: var(--text-primary); }
.art-navlinks .abtn { height: 36px; padding: 0 16px; font-size: 13px; border-radius: 10px; }
@media (max-width: 640px) { .art-navlinks a:not(.abtn) { display: none; }
  .art-navlinks .abtn { width: auto; } }
/* The bar is fixed (base .native-header): editorial pages offset their content. */
.art-offset { padding-top: 52px; }

/* FAQ accordion for editorial pages (index keeps its own numbered variant). */
.art-faq { border-top: 1px solid var(--border-color); margin-top: var(--space-md); }
.art-faq details { border-bottom: 1px solid var(--border-color); }
.art-faq summary { list-style: none; cursor: pointer; display: flex; align-items: baseline;
  gap: var(--space-sm); padding: 16px 0; font-size: 16px; font-weight: var(--fw-semibold);
  letter-spacing: -.01em; color: var(--text-primary); }
.art-faq summary::-webkit-details-marker { display: none; }
.art-faq summary .x { margin-left: auto; font-family: "IBM Plex Mono", monospace;
  color: var(--text-secondary); transition: transform var(--dur-settle) var(--spring-settle); }
.art-faq details[open] summary .x { transform: rotate(45deg); }
.art-faq .answer { padding: 0 0 16px; font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
@media (prefers-reduced-motion: reduce) { .art-faq summary .x { transition: none; } }

/* Footer for editorial pages: long-form (marketing) register. */
.art-foot { border-top: 1px solid var(--border-color); }
.art-foot-inner { max-width: 1120px; margin: 0 auto; padding: var(--space-lg) clamp(20px, 4vw, 56px);
                  border-inline: 1px solid var(--border-color); }
.art-foot-row { display: flex; align-items: center; justify-content: space-between;
                gap: var(--space-sm); flex-wrap: wrap; }
.art-foot .links { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .06em;
                   color: var(--text-secondary); }
.art-foot .links a { color: var(--text-secondary); text-decoration: none; }
.art-foot .links a:hover { color: var(--text-primary); }
.art-foot .legal { margin-top: var(--space-sm); font-family: "IBM Plex Mono", monospace;
                   font-size: 10.5px; line-height: 1.7; color: var(--text-secondary); max-width: 70ch; }
