/* ==========================================================================
   lways.works / lways.work — Silly Email Vending Machine Themes
   4 switchable high-contrast themes via html[data-theme="..."]
   Optional domain-conjugation accent shift via html[data-domain="lways.work"]
   Zero external imports, zero external URLs, strict CSP (style-src 'self').
   ========================================================================== */

:root,
html[data-theme="arcade"] {
  color-scheme: dark;

  /* Core Surfaces */
  --bg: #09090b;
  --bg-elevated: #121318;
  --surface: #161820;
  --surface-alt: #1e212b;
  --glass: rgba(22, 24, 32, 0.86);

  /* Typography */
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font-display: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Accents (lways.works default: emerald LED) */
  --accent: #10b981;
  --accent-contrast: #031911;
  --accent-2: #f59e0b;

  /* Borders, Radii & Shadows */
  --border: #27272a;
  --border-strong: #10b981;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(16, 185, 129, 0.16);
  --radius: 8px;
  --focus-ring: #34d399;

  /* Vending LED Readout */
  --led-bg: #04110c;
  --led-text: #34d399;
  --led-border: #065f46;

  /* Status Badges */
  --badge-ok-bg: #052e16;
  --badge-ok-text: #6ee7b7;
  --badge-warn-bg: #3b2306;
  --badge-warn-text: #fcd34d;
  --badge-err-bg: #3f0d12;
  --badge-err-text: #fda4af;

  /* Physical Vending Receipt Ticket */
  --ticket-bg: #f8fafc;
  --ticket-text: #09090b;
}

html[data-theme="arcade"][data-domain="lways.work"],
:root[data-domain="lways.work"]:not([data-theme]) {
  --accent: #38bdf8;
  --accent-contrast: #04131c;
  --accent-2: #c084fc;
  --border-strong: #38bdf8;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(56, 189, 248, 0.22);
  --focus-ring: #7dd3fc;
  --led-bg: #05111a;
  --led-text: #7dd3fc;
  --led-border: #075985;
}

html[data-theme="arcade"] body,
:root:not([data-theme]) body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(16, 185, 129, 0.11), transparent 42%),
    radial-gradient(circle at 85% 12%, rgba(245, 158, 11, 0.08), transparent 36%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 3px
    );
}

html[data-theme="arcade"][data-domain="lways.work"] body,
:root[data-domain="lways.work"]:not([data-theme]) body {
  background-image:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.13), transparent 42%),
    radial-gradient(circle at 85% 12%, rgba(192, 132, 252, 0.09), transparent 36%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 3px
    );
}

/* ==========================================================================
   Theme 2: breakroom — 90s Breakroom Snack Machine
   Tactile retro charcoal-and-warm-putty cabinet, seven-segment ruby/amber
   readout, physical beveled push-buttons, spiral coil slot badges.
   ========================================================================== */

html[data-theme="breakroom"] {
  color-scheme: light;

  /* Core Surfaces (Warm Industrial Putty & Steel) */
  --bg: #d9d2c5;
  --bg-elevated: #ebe6dc;
  --surface: #f3efe7;
  --surface-alt: #e3dcd0;
  --glass: rgba(243, 239, 231, 0.92);

  /* Typography */
  --text: #1c1917;
  --text-muted: #4b453e;
  --font-sans: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Courier New", Courier, monospace;
  --font-display: Impact, "Arial Black", "Trebuchet MS", sans-serif;

  /* Accents (Tactile Ruby Push-Button & Amber) */
  --accent: #b91c1c;
  --accent-contrast: #ffffff;
  --accent-2: #92400e;

  /* Borders, Radii & Beveled Tactile Shadows */
  --border: #8c8376;
  --border-strong: #292524;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 4px 0 #57534e, 0 8px 18px rgba(28, 25, 23, 0.18);
  --radius: 4px;
  --focus-ring: #b91c1c;

  /* Seven-Segment Ruby/Amber Digital Price Readout */
  --led-bg: #180909;
  --led-text: #ff9e44;
  --led-border: #5c1919;

  /* Status Badges */
  --badge-ok-bg: #dcfce7;
  --badge-ok-text: #14532d;
  --badge-warn-bg: #fef3c7;
  --badge-warn-text: #78350f;
  --badge-err-bg: #fee2e2;
  --badge-err-text: #7f1d1d;

  /* Thermal Paper Receipt */
  --ticket-bg: #fffdf7;
  --ticket-text: #1c1917;
}

html[data-theme="breakroom"][data-domain="lways.work"] {
  --accent: #0f766e;
  --accent-contrast: #ffffff;
  --accent-2: #b91c1c;
  --focus-ring: #0f766e;
  --led-text: #fbbf24;
}

html[data-theme="breakroom"] body {
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(28, 25, 23, 0.08) 0%, transparent 180px),
    repeating-linear-gradient(
      90deg,
      rgba(28, 25, 23, 0.025) 0px,
      rgba(28, 25, 23, 0.025) 2px,
      transparent 2px,
      transparent 24px
    );
}

html[data-theme="breakroom"] button,
html[data-theme="breakroom"] .btn {
  border-bottom-width: 3px;
}

/* ==========================================================================
   Theme 3: schematic — Tektronix Oscilloscope & Blueprint
   Hardware lab dark navy grid (#07131d), phosphor graticule cyan (#00f0ff)
   & signal yellow (#ffd166).
   ========================================================================== */

html[data-theme="schematic"] {
  color-scheme: dark;

  /* Core Surfaces */
  --bg: #07131d;
  --bg-elevated: #0b1c2a;
  --surface: #0e2233;
  --surface-alt: #132c42;
  --glass: rgba(11, 28, 42, 0.88);

  /* Typography */
  --text: #e6f6ff;
  --text-muted: #93b8cf;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --font-display: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Accents (CH1 Phosphor Cyan & CH2 Signal Yellow) */
  --accent: #00f0ff;
  --accent-contrast: #03151d;
  --accent-2: #ffd166;

  /* Borders, Radii & Shadows */
  --border: #1d4260;
  --border-strong: #00f0ff;
  --shadow: 0 0 0 1px rgba(0, 240, 255, 0.16), 0 12px 28px rgba(2, 10, 18, 0.72);
  --radius: 2px;
  --focus-ring: #00f0ff;

  /* Scope Phosphor Readout */
  --led-bg: #030b12;
  --led-text: #00f0ff;
  --led-border: #155e75;

  /* Status Badges */
  --badge-ok-bg: #052936;
  --badge-ok-text: #67e8f9;
  --badge-warn-bg: #362804;
  --badge-warn-text: #ffd166;
  --badge-err-bg: #3b0d16;
  --badge-err-text: #fda4af;

  /* Lab Spec Sheet Receipt */
  --ticket-bg: #f0f9ff;
  --ticket-text: #07131d;
}

html[data-theme="schematic"][data-domain="lways.work"] {
  --accent: #ffd166;
  --accent-contrast: #141002;
  --accent-2: #00f0ff;
  --border-strong: #ffd166;
  --shadow: 0 0 0 1px rgba(255, 209, 102, 0.2), 0 12px 28px rgba(2, 10, 18, 0.72);
  --focus-ring: #ffd166;
  --led-text: #ffd166;
  --led-border: #854d0e;
}

html[data-theme="schematic"] body {
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(0, 240, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
}

/* ==========================================================================
   Theme 4: swiss-post — Brutalist Postal Telegram & Stamp Dispenser
   Warm archival paper (#f6f3eb), ink black (#111111), postal cancellation
   red (#b91c1c / #d92b2b), stamp yellow (#ffde00 ONLY as fill with #111111
   ink text — NEVER yellow text on light backgrounds!).
   ========================================================================== */

html[data-theme="swiss-post"] {
  color-scheme: light;

  /* Core Surfaces */
  --bg: #f6f3eb;
  --bg-elevated: #fffdf7;
  --surface: #fffdf7;
  --surface-alt: #ffde00;
  --glass: rgba(255, 253, 247, 0.96);

  /* Typography */
  --text: #111111;
  --text-muted: #3f3c36;
  --font-sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Accents (Postal Cancellation Red; Stamp Yellow reserved for fills) */
  --accent: #c81e1e;
  --accent-contrast: #ffffff;
  --accent-2: #111111;

  /* Brutalist 3px Ink Borders & Hard 5px Offset Shadows */
  --border: #111111;
  --border-strong: #111111;
  --shadow: 5px 5px 0 #111111;
  --radius: 0px;
  --focus-ring: #111111;

  /* Telegram Ink Readout */
  --led-bg: #111111;
  --led-text: #ffde00;
  --led-border: #111111;

  /* Status Badges (High-contrast ink on archival/stamp fills) */
  --badge-ok-bg: #ffde00;
  --badge-ok-text: #111111;
  --badge-warn-bg: #fde68a;
  --badge-warn-text: #111111;
  --badge-err-bg: #c81e1e;
  --badge-err-text: #ffffff;

  /* Telegram Slip Receipt */
  --ticket-bg: #fffdf7;
  --ticket-text: #111111;
}

html[data-theme="swiss-post"][data-domain="lways.work"] {
  --accent: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-2: #c81e1e;
  --focus-ring: #1d4ed8;
}

html[data-theme="swiss-post"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(17, 17, 17, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
}
