/* ══════════════════════════════════════════════════════════════════
   blueprint.css — engineering spec sheet aesthetic
   Inspired by Blueprinter (yofine/skills)

   Identity: flat engineering spec sheet — NO shadows, NO gradients,
   NO rounded corners. Clean, clinical, high-contrast.
   ══════════════════════════════════════════════════════════════════ */

/* ── Fonts ──
   Add to <head>:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
*/

/* ── Root Tokens (Light Default) ── */
:root {
  color-scheme: light dark;

  /* Surface system — light layers */
  --bg:           #f8fafc;     /* slate-50 — base background */
  --surface:      #ffffff;     /* white — canvas / cards */
  --surface2:     #f1f5f9;     /* slate-100 */
  --border:       #cbd5e1;     /* slate-300 — borders */
  --border-bright: #94a3b8;   /* slate-400 */

  /* Text hierarchy — high contrast */
  --text:         #0f172a;     /* slate-900 — headings, primary */
  --text-muted:   #334155;     /* slate-700 — body text */
  --text-dim:     #64748b;     /* slate-500 — metadata, labels */

  /* Accent — minimal, errors/warnings only */
  --accent:       #dc2626;     /* red-600 — warning/error accent */
  --accent-dim:   #fef2f2;     /* red-50 — dim surface */
  --accent-glow:  rgba(220,38,38,0.15);

  /* Shape — flat, no rounding, no shadows */
  --radius:     0;
  --radius-sm:  0;
  --shadow:     none;
}

/* ── Light Mode Override (explicit — symmetric with dark override below) ── */
[data-theme="light"] {
  color-scheme: light;

  /* Surface system — light layers (same as :root default) */
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --surface2:     #f1f5f9;
  --border:       #cbd5e1;
  --border-bright: #94a3b8;

  --text:         #0f172a;
  --text-muted:   #334155;
  --text-dim:     #64748b;

  --accent:       #dc2626;
  --accent-dim:   #fef2f2;
  --accent-glow:  rgba(220,38,38,0.15);

  --success:     #047857;
  --success-dim: rgba(4,120,87,0.1);
  --warning:     #d97706;
  --warning-dim: rgba(217,119,6,0.1);
  --error:       #dc2626;
  --error-dim:   rgba(220,38,38,0.1);
  --info:        #2563eb;
  --info-dim:    rgba(37,99,235,0.1);
}

/* ── Dark Mode Override ── */
[data-theme="dark"] {
  color-scheme: dark;

  /* Surface system — inverted */
  --bg:           #0f172a;     /* slate-900 */
  --surface:      #1e293b;     /* slate-800 */
  --surface2:     #283548;     /* between slate-800/700 */
  --border:       #334155;     /* slate-700 */
  --border-bright: #475569;   /* slate-600 */

  /* Text hierarchy */
  --text:         #f8fafc;     /* slate-50 */
  --text-muted:   #cbd5e1;     /* slate-300 */
  --text-dim:     #64748b;     /* slate-500 */

  /* Accent */
  --accent:       #f87171;     /* red-400 */
  --accent-dim:   rgba(248,113,113,0.12);
  --accent-glow:  rgba(248,113,113,0.2);
}

/* ── Semantic Color Tokens — Light ── */
:root {
  --success:     #047857;     /* emerald-700 */
  --success-dim: rgba(4,120,87,0.1);
  --warning:     #d97706;     /* amber-600 */
  --warning-dim: rgba(217,119,6,0.1);
  --error:       #dc2626;     /* red-600 */
  --error-dim:   rgba(220,38,38,0.1);
  --info:        #2563eb;     /* blue-600 */
  --info-dim:    rgba(37,99,235,0.1);
}

/* ── Semantic Color Tokens — Dark ── */
[data-theme="dark"] {
  --success:     #34d399;     /* emerald-400 */
  --success-dim: rgba(52,211,153,0.12);
  --warning:     #fbbf24;     /* amber-400 */
  --warning-dim: rgba(251,191,36,0.12);
  --error:       #f87171;     /* red-400 */
  --error-dim:   rgba(248,113,113,0.12);
  --info:        #60a5fa;     /* blue-400 */
  --info-dim:    rgba(96,165,250,0.12);
}

/* ── Blueprint Dark — OS preference (unless manually light).
   Blueprint is LIGHT-default; this inverts the usual pattern. ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0f172a;
    --surface:      #1e293b;
    --surface2:     #283548;
    --border:       #334155;
    --border-bright: #475569;

    --text:         #f8fafc;
    --text-muted:   #cbd5e1;
    --text-dim:     #64748b;

    --accent:       #f87171;
    --accent-dim:   rgba(248,113,113,0.12);
    --accent-glow:  rgba(248,113,113,0.2);

    --success:     #34d399;
    --success-dim: rgba(52,211,153,0.12);
    --warning:     #fbbf24;
    --warning-dim: rgba(251,191,36,0.12);
    --error:       #f87171;
    --error-dim:   rgba(248,113,113,0.12);
    --info:        #60a5fa;
    --info-dim:    rgba(96,165,250,0.12);
  }
}

/* ══════════════════════════════════════════════════════════════════
   OVERRIDES — flat spec sheet aesthetic
   ══════════════════════════════════════════════════════════════════ */

/* ── Typography Override ── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3, h4 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Cards and tables use --radius/--radius-sm/--shadow tokens from :root above */

thead th {
  background: var(--bg);      /* lighter header bg */
  border-bottom: 2px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;        /* 10px — smaller, more clinical */
}

/* ── Code Blocks — Flat, Monospace ── */
code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.15em 0.4em;
  font-size: 0.8125em;
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem;
  box-shadow: none;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ── Buttons & Controls — Flat ── */
.theme-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  box-shadow: none;
}

.theme-btn:hover {
  background: var(--bg);
  border-color: var(--text-dim);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-dim);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

.tab-btn[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── Navigation — Flat ── */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.nav-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Accent Utilities (minimal red usage) ── */
.accent-only {
  /* For error/warning emphasis only */
  color: var(--accent);
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
}

/* ══════════════════════════════════════════════════════════════════
   Slide mode — blueprint aesthetic (used by forge-slides)
   Engineering/technical diagram look: grid bg, cyan accent, mono-heavy.
   ══════════════════════════════════════════════════════════════════ */

.deck .slide--title {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 30%, var(--accent-dim) 0%, transparent 55%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}
.deck .slide--title .slide__display {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: -1.5px;
  text-transform: uppercase;
}
.deck .slide--title .slide__subtitle {
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.deck .slide--content .slide__label,
.deck .slide--section .slide__number {
  color: var(--accent);
}
.deck .slide--content .slide__heading {
  font-weight: 500;
  letter-spacing: -0.5px;
}
.deck .slide--closing {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 70%, var(--accent-dim) 0%, transparent 60%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}
.deck .slide--closing .slide__heading {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: -0.5px;
}
.deck .slide--quote blockquote {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 400;
}

.deck .slide--closing .cta {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  border-color: var(--accent);
  color: var(--accent);
}
