/* ============================================================
   MixNight — design tokens & themes (single source of truth)
   Used by: index.html (Pour), bar/index.html (The Bar), and every module.

   Type
     --sans     UI face            Geist (fallback: Inter, system)
     --display  titles / big numbers (per theme)
     --serif    legacy alias of --display, kept for Pour's stylesheet
     --mono     eyebrows, metadata, scores  Geist Mono

   Colour  (surfaces go bg → bg2 → card → card2, dark to less dark)
     --txt / --dim / --dim2        text, secondary, tertiary
     --line / --line2              hairlines, stronger hairlines
     --accent / --accent-ink       the one brand colour and the text that sits on it
     --accent2                     a second colour for highlights, never for buttons
     --gold / --gold2              legacy aliases of --accent / --accent2 (Pour)
     --green / --red               semantic
   ============================================================ */

:root{
  /* ---------- NOIR (default) — black, white-on-black actions, one warm neutral ---------- */
  --bg:#0a0a0a; --bg2:#0f0f0f; --card:#151515; --card2:#1d1d1d;
  --line:rgba(255,255,255,.07); --line2:rgba(255,255,255,.14);
  --txt:#f5f5f3; --dim:#9c9c98; --dim2:#5f5f5b;
  --accent:#f5f5f3; --accent-ink:#0a0a0a; --accent2:#c8c8c4;
  --pink:#ff5c8a; --green:#3ecf8e; --red:#ff5d5d;
  --grad:linear-gradient(135deg,#ffffff 0%,#d9d9d5 100%);
  --rad:0; --rad-lg:0;   /* MixNight is square-edged: only buttons, tabs, chips and switches stay rounded */
  --sans:"Geist",Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --display:"Geist",Inter,-apple-system,sans-serif;
  --mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --display-weight:700; --display-track:-0.03em;
  --bg-ambient:none;
  --shadow:0 20px 60px rgba(0,0,0,.5);
  --img-grade:none;
  /* legacy aliases for Pour */
  --gold:var(--accent); --gold2:var(--accent2); --serif:var(--display);
  color-scheme:dark;
}

/* ---------- SPEAKEASY — espresso and brass, editorial serif for titles ---------- */
html[data-theme="speakeasy"]{
  --bg:#0d0b09; --bg2:#12100c; --card:#181410; --card2:#211c16;
  --line:rgba(220,196,150,.09); --line2:rgba(220,196,150,.2);
  --txt:#efe9dd; --dim:#a69d8c; --dim2:#655d50;
  --accent:#d6b56e; --accent-ink:#1a1408; --accent2:#8c7448;
  --grad:linear-gradient(135deg,#e2c27c 0%,#b8944e 100%);
  --display:"Instrument Serif",Georgia,"Times New Roman",serif;
  --display-weight:400; --display-track:-0.01em;
  --rad:0; --rad-lg:0;   /* MixNight is square-edged: only buttons, tabs, chips and switches stay rounded */
  --bg-ambient:radial-gradient(900px 500px at 50% -10%,rgba(214,181,110,.08),transparent 60%);
  --img-grade:sepia(.18) saturate(.85) contrast(1.04);
}

/* ---------- NEON — after-hours: near-black violet, hot pink + cyan ---------- */
html[data-theme="neon"]{
  --bg:#07060c; --bg2:#0c0a14; --card:#120f1e; --card2:#1a162b;
  --line:rgba(255,255,255,.07); --line2:rgba(255,255,255,.16);
  --txt:#f6f3ff; --dim:#a39bc4; --dim2:#625b82;
  --accent:#ff3ea5; --accent-ink:#14061a; --accent2:#38e8ff;
  --pink:#ff3ea5;
  --grad:linear-gradient(135deg,#ff3ea5 0%,#38e8ff 100%);
  --display:"Geist",Inter,sans-serif; --display-weight:800; --display-track:-0.04em;
  --rad:0; --rad-lg:0;   /* MixNight is square-edged: only buttons, tabs, chips and switches stay rounded */
  --bg-ambient:radial-gradient(800px 420px at 20% -10%,rgba(255,62,165,.14),transparent 60%),radial-gradient(800px 420px at 90% 110%,rgba(56,232,255,.10),transparent 60%);
  --img-grade:saturate(1.25) contrast(1.05) hue-rotate(-6deg);
}

/* ---------- PUB — bottle green, oak, a little brass; cosy radii ---------- */
html[data-theme="pub"], html[data-theme="irish"]{
  --bg:#0a120d; --bg2:#0f1811; --card:#152018; --card2:#1c2a20;
  --line:rgba(180,220,170,.09); --line2:rgba(180,220,170,.2);
  --txt:#eef2e6; --dim:#9fb39a; --dim2:#5f735c;
  --accent:#7cc76f; --accent-ink:#07130a; --accent2:#d6b56e;
  --green:#7cc76f;
  --grad:linear-gradient(135deg,#8fd482 0%,#4f9a45 100%);
  --rad:0; --rad-lg:0;   /* MixNight is square-edged: only buttons, tabs, chips and switches stay rounded */
  --display:"Instrument Serif",Georgia,serif; --display-weight:400; --display-track:-0.005em;
  --bg-ambient:radial-gradient(900px 500px at 50% -10%,rgba(124,199,111,.08),transparent 60%),radial-gradient(700px 400px at 90% 100%,rgba(214,181,110,.06),transparent 60%);
  --img-grade:saturate(.85) contrast(1.02);
}

/* ---------- DIVE — retired 15 Sep; maps to Neon (kept so saved settings don't break) ---------- */
html[data-theme="dive-retired"]{
  --bg:#0a0909; --bg2:#100e0e; --card:#171313; --card2:#1f1a1a;
  --line:rgba(255,255,255,.07); --line2:rgba(255,255,255,.15);
  --txt:#f3ede7; --dim:#a59c96; --dim2:#66605c;
  --accent:#ff4d3d; --accent-ink:#160707; --accent2:#3fa9d6;
  --red:#ff4d3d;
  --grad:linear-gradient(135deg,#ff5a3d 0%,#ff8a3d 100%);
  --display:"Geist",Inter,sans-serif; --display-weight:800; --display-track:-0.04em;
  --bg-ambient:radial-gradient(700px 400px at 80% -10%,rgba(255,77,61,.12),transparent 60%);
}

/* ---------- theme swatches (settings pickers in every app) ---------- */
.sw-noir{--p-bg:#0a0a0a;--p-card:#1d1d1d;--p-acc:#f5f5f3;--p-txt:#9c9c98}
.sw-speakeasy{--p-bg:#0d0b09;--p-card:#211c16;--p-acc:#d6b56e;--p-txt:#a69d8c}
.sw-neon{--p-bg:#07060c;--p-card:#1a162b;--p-acc:#ff3ea5;--p-txt:#38e8ff}
.sw-pub{--p-bg:#0a120d;--p-card:#1c2a20;--p-acc:#7cc76f;--p-txt:#d6b56e}
.sw-irish{--p-bg:#0a120d;--p-card:#1c2a20;--p-acc:#7cc76f;--p-txt:#d6b56e}
/* theme switch cross-fades the surfaces */
html.theming, html.theming body, html.theming *{transition:background-color .4s ease,border-color .4s ease,color .4s ease!important}
.themecard .swatch{position:relative;height:56px;border-radius:10px;background:var(--p-bg);border:1px solid rgba(255,255,255,.06);overflow:hidden}
.themecard .swatch::before{content:"";position:absolute;left:10px;top:10px;width:46%;height:10px;border-radius:5px;background:var(--p-card)}
.themecard .swatch::after{content:"";position:absolute;left:10px;bottom:10px;width:28px;height:14px;border-radius:7px;background:var(--p-acc);box-shadow:40px 0 0 -3px var(--p-txt)}
