/*
 * HyperMongoose design tokens (A9) — "show night" on the HyperMongoose brand palette.
 *
 * Owner brand system (binding): Midnight #101010, Vintage Cream #FFF0C9,
 * Atomic Teal #087F87, Cherry Red #E83D32, Rocket Gold #F7B83E.
 *
 * Roles: Midnight is the canvas so the stream is the brightest thing on screen; Cream
 * is the warm foreground (not cold white); Teal is the brand/action accent; Cherry Red
 * is reserved for LIVE/on-air and danger; Gold carries value — prices, winning bids,
 * highlights. Dark is the default; a cream "daylight" mood is the opt-in for long
 * operator sessions. Every value is a CSS variable, so a seller's brand is a change of
 * variables, not of components.
 */

:root {
  /* ── Brand seeds ──────────────────────────────────────────────────────────── */
  --brand-midnight: #101010;
  --brand-cream:    #fff0c9;
  --brand-teal:     #087f87;
  --brand-cherry:   #e83d32;
  --brand-gold:     #f7b83e;

  /* ── Dark "show night" (default) ──────────────────────────────────────────── */
  /* Warm near-black canvas with two elevations tinted toward the cream/gold warmth. */
  --bg:                 #101010;
  --background:         var(--bg);
  --surface:            #19170f;  /* cards, panels */
  --surface-2:          #23201a;  /* raised: popovers, sticky bars, hovers */
  --surface-3:          #3a352c66; /* translucent hover/ghost fill */

  --foreground:         #fff0c9;  /* Vintage Cream — warm, not cold white */
  --card:               var(--surface);
  --card-foreground:    var(--foreground);
  --popover:            var(--surface-2);
  --popover-foreground: var(--foreground);
  --muted:              var(--surface-2);
  --muted-foreground:   #bcae8d;  /* dimmed cream, never flat gray */
  --subtle-foreground:  #8b8169;  /* timestamps, captions */
  --border:             #2b2820;
  --border-strong:      #3d3828;
  --input:              #231f18;

  /* Atomic Teal is the action/brand accent. A brighter cut for accent text/icons on
     the dark canvas where the deep teal would be too low-contrast. */
  --primary:            #087f87;  /* brand anchor: borders, accents, selection */
  --primary-strong:     #0a6b70;  /* deeper teal for filled controls — AA (5.3:1) with cream ink */
  --primary-hover:      #0aa0a9;
  --primary-bright:     #35c6ce;  /* links, accent text/icons on dark */
  --primary-foreground: #fff0c9;  /* cream ink on a teal fill (mid-teal fails AA with dark ink) */
  --ring:               #35c6ce;
  --accent:             var(--surface-2);
  --accent-foreground:  var(--foreground);

  /* Cherry Red — LIVE/on-air and hype. Used sparingly. */
  --live:               #e83d32;
  --live-foreground:    #fff0c9;

  /* Rocket Gold — value: prices, winning bids, highlights. */
  --gold:               #f7b83e;
  --gold-foreground:    #241a05;

  /* Status — drawn from the brand palette. */
  --success:            #15b0a0; /* confirmed / winning-state (teal family, lifted) */
  --success-foreground: #04140f;
  --warning:            #f7b83e; /* needs attention (gold) */
  --warning-foreground: #241a05;
  --danger:             #e83d32; /* failed, dispute, cancel (cherry) */
  --danger-bright:      #f26a5f; /* cherry as text on dark — AA (5:1) where mid-cherry falls short */
  --danger-foreground:  #fff0c9;
  --info:               #35c6ce; /* informational (bright teal) */
  --info-foreground:    #04201f;

  /* Radius. */
  --radius:    0.75rem;  --radius-sm: 0.5rem;  --radius-lg: 1.25rem;  --radius-full: 9999px;

  /* 8px spacing grid. */
  --space-0: 0;    --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.5rem;  --space-6: 2rem;    --space-8: 3rem;
  --space-10: 4rem; --space-12: 6rem;

  /* Type. Space Grotesk is the display voice (show titles, prices, bids, big numbers);
     Inter carries UI and body; a tabular variant keeps prices/timers from jittering. */
  --font-sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "Space Grotesk", ui-monospace, "SF Mono", monospace;
  --font-tabular: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;

  --text-xs:   0.75rem;   --text-sm:   0.8125rem; --text-base: 0.9375rem;
  --text-lg:   1.0625rem; --text-xl:   1.25rem;   --text-2xl:  1.5rem;
  --text-3xl:  1.9375rem; --text-4xl:  2.5rem;    --text-5xl:  3.25rem;
  --text-6xl:  4.25rem;

  --leading-tight:  1.08;  --leading-snug: 1.3;   --leading-normal: 1.55;
  --tracking-display: -0.035em; --tracking-tight: -0.015em; --tracking-wide: 0.04em;

  /* Depth: real offset + soft blur. Brand-tinted glows for on-air / winning emphasis. */
  --border-width: 1px;
  --shadow-sm:  0 1px 2px rgb(0 0 0 / 0.55);
  --shadow-md:  0 10px 30px -12px rgb(0 0 0 / 0.7);
  --shadow-lg:  0 30px 70px -20px rgb(0 0 0 / 0.78);
  --shadow-pop: var(--shadow-md);
  --glow-primary: 0 0 0 1px rgb(8 127 135 / 0.5),  0 12px 40px -12px rgb(8 127 135 / 0.5);
  --glow-live:    0 0 0 1px rgb(232 61 50 / 0.45), 0 12px 40px -10px rgb(232 61 50 / 0.5);
  --glow-gold:    0 0 0 1px rgb(247 184 62 / 0.45),0 12px 40px -12px rgb(247 184 62 / 0.45);

  /* Motion — exponential ease-out from an already-visible default. */
  --duration-fast: 120ms; --duration-base: 220ms; --duration-slow: 420ms;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── "Daylight" cream mood (opt-in) for long operator sessions ─────────────── */
:root[data-theme="light"] {
  --bg:                 #fbf4df;  /* warm cream paper */
  --background:         var(--bg);
  --surface:            #fffaec;
  --surface-2:          #ffffff;
  --surface-3:          #10101008;
  --foreground:         #16130c;
  --card:               #fffaec;
  --card-foreground:    #16130c;
  --popover:            #ffffff;
  --popover-foreground: #16130c;
  --muted:              #f1e6c8;
  --muted-foreground:   #6c6350;
  --subtle-foreground:  #938866;
  --border:             #e7d9b4;
  --border-strong:      #d7c79d;
  --input:              #e7d9b4;
  --primary:            #087f87;
  --primary-strong:     #066b72;
  --primary-hover:      #066b72;
  --primary-bright:     #066b72;
  --primary-foreground: #fff0c9;
  --accent:             #f1e6c8;
  --accent-foreground:  #16130c;
  --live:               #e83d32;
  --gold:               #b67d12;
  --gold-foreground:    #ffffff;
  --success:            #0e7a72;
  --success-foreground: #ffffff;
  --warning:            #a86a00;
  --warning-foreground: #ffffff;
  --danger:             #c6301f;
  --danger-bright:      #a8291a;
  --danger-foreground:  #ffffff;
  --info:               #0e7a72;
  --shadow-sm:  0 1px 2px rgb(16 16 16 / 0.08);
  --shadow-md:  0 10px 30px -12px rgb(16 16 16 / 0.16);
  --shadow-lg:  0 30px 70px -20px rgb(16 16 16 / 0.2);
}

/* ── Base element wiring ──────────────────────────────────────────────────── */
html {
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  accent-color: var(--primary);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings speak in the display voice by default. */
h1, h2, h3, .hm-display {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  font-weight: 600;
}

/* Tabular figures for prices, bids and timers (display face, tnum). */
.hm-tabular { font-family: var(--font-tabular); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
/* Money is the brand's tell: prices, bids, payouts, earnings render in gold, tabular. */
.hm-price { font-family: var(--font-tabular); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; color: var(--gold); }

/* Overline / label voice. */
.hm-overline { font-size: var(--text-xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted-foreground); font-weight: 600; }

/* ── Browser surfaces carry the design, not the UA defaults ───────────────── */
::selection { background: color-mix(in oklab, var(--primary) 45%, transparent); color: var(--foreground); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); border: 2px solid var(--background); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }

input, textarea, select { caret-color: var(--primary-bright); }
input::placeholder, textarea::placeholder { color: var(--subtle-foreground); }

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