/* ==========================================================================
   OTT CORE — the one shared stylesheet every OTT product imports.

   Source of truth: OTT-DESIGN-CONSTITUTION.md (v2) + OTT-SANS-TYPE-SYSTEM.md.
   Everything in this file is fixed ecosystem-wide. The ONLY thing a product
   defines for itself is --accent (and, if it uses the light-toggle shell,
   which of the two shell modes it picks — see the constitution §3.5).

   This supersedes vibe-system.css as the linked source: that file's heavy
   glassmorphism/glow treatment (backdrop-blur cards, large glow shadows on
   hover, pulse-heavy interactions) conflicts with the constitution's own
   anti-pattern list (§12 — "heavy drop shadows, saturated gradients
   everywhere... nothing screams"). It was never actually linked from a
   product's templates. Do not import both files in the same product.

   Usage: link this file FIRST, then the product's own stylesheet (which
   sets --accent and any product-specific components) after it.
   ========================================================================== */


:root {
  /* ---- Type (OTT-SANS-TYPE-SYSTEM.md §16 — real font files slot in ahead of these with zero other changes) ---- */
  --font-text:    "OTT Sans Text", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
                  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "OTT Sans Display", "Space Grotesk", "Plus Jakarta Sans", -apple-system,
                  "Segoe UI", sans-serif;
  --font-mono:    "OTT Mono", "IBM Plex Mono", "SF Mono", "Cascadia Code", ui-monospace,
                  Menlo, Consolas, monospace;

  /* ---- Motion (constitution §5) ---- */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-state: 170ms;   /* hover/focus state changes: 140-200ms */
  --dur-reveal: 220ms;  /* panel/page reveals: 180-250ms, fade + 6-10px rise */
  --dur-press: 60ms;    /* button pressed micro-feedback */

  /* ---- Radii (constitution §8) ---- */
  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 9999px;

  /* ---- Global brand (constitution §3.3, always present regardless of accent) ---- */
  --ott-signature: #D72638; /* "movie poster red" — one tiny live element in every product, §7 */
  --ott-warm: #F28C28;

  /* ---- Global status colors (constitution §3.4 — identical everywhere, never themed) ---- */
  --ok: #22C55E;
  --warn: #F59E0B;
  --bad: #DC2626;
  --info: #3B82F6;

  /* ---- Dark mode (constitution §3.1 — default for most OTT products) ---- */
  --bg: #0B0B0D;
  --surface: #141417;
  --elevated: #1D1D22;
  --text: #F5F5F4;
  --muted: #B8B8C0;
  --disabled: #73737D;
  --border: #2C2C33;
}

:root[data-theme="light"] {
  /* Light mode (constitution §3.2 — used where a product offers a light theme) */
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --sunk: #F1F1EE;
  --text: #111114;
  --muted: #555560;
  --border: #DDDDD7;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FAFAF8;
    --surface: #FFFFFF;
    --sunk: #F1F1EE;
    --text: #111114;
    --muted: #555560;
    --border: #DDDDD7;
  }
}

/* Derived accent tints — every product computes these from its own --accent,
   never hardcodes a second hue (constitution §6, §12). */
:root {
  --accent-tint-10: color-mix(in srgb, var(--accent, #2563EB) 10%, transparent);
  --accent-tint-20: color-mix(in srgb, var(--accent, #2563EB) 20%, transparent);
  --accent-border: color-mix(in srgb, var(--accent, #2563EB) 35%, var(--border));
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.mono, code, pre {
  font-family: var(--font-mono);
  letter-spacing: 0; /* zero kerning by design for hashes/IDs — OTT-SANS-TYPE-SYSTEM.md §7 */
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Shared primitives (constitution §8 — restrained, not glassy: a hairline
   border and a one-step surface change, never a heavy shadow or blur)
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 13.5px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter var(--dur-state) var(--ease), transform var(--dur-press) var(--ease),
              background var(--dur-state) var(--ease), border-color var(--dur-state) var(--ease);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent, #2563EB);
  color: #FFFFFF;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--elevated); }
.btn-secondary:active { transform: translateY(1px); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  background: var(--accent-tint-10);
  color: var(--accent, #2563EB);
  border: 1px solid var(--accent-border);
}
.pill-ok   { background: color-mix(in srgb, var(--ok) 14%, transparent);  color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.pill-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.pill-bad  { background: color-mix(in srgb, var(--bad) 14%, transparent);  color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }

.stat-tile .stat-figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.stat-tile .stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 18px;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* The signature red — a live/status touchpoint every product should have
   exactly one of (constitution §7). Not decorative: it means "live now." */
.signature-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ott-signature);
  display: inline-block;
}
.signature-dot.live {
  animation: signature-pulse 2s infinite var(--ease);
}
@keyframes signature-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; box-shadow: 0 0 6px var(--ott-signature); }
}

/* --------------------------------------------------------------------------
   Accessibility (constitution §10 — mandatory, no exceptions)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent, #2563EB);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
