/* ============================================================
   BLOODYIHEB PORTFOLIO — CENTRAL THEME SYSTEM
   ------------------------------------------------------------
   Light palette:  :root  (default)
   Dark palette:   .dark  (matches the original index.html design)
   The toggle only flips the .dark class on <html> (Tailwind
   "darkMode: class"). Every color token below resolves live, so
   pages, shared components and JS-injected HTML all re-theme
   instantly without any duplicated classes.
============================================================ */

:root {
  color-scheme: light;

  /* PAGE / SURFACE BACKGROUNDS */
  --bg: #f6f8fc;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-strong: #e2e8f0;
  --surface-inverted: #0f172a;      /* "white" buttons in dark become dark in light */
  --surface-inverted-soft: #1e293b;

  /* GLASS */
  --glass: rgba(255, 255, 255, 0.8);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --header-bg: rgba(255, 255, 255, 0.88);

  /* TEXT */
  --text-strong: #0f172a;
  --text: #1e293b;
  --text-soft: #334155;
  --text-mild: #475569;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --faint: #b0bcc9;

  /* BORDERS */
  --border: #dfe6f0;
  --border-strong: #c9d3e0;
  --border-soft: #e9eef5;

  /* FORMS / INPUTS */
  --input: #ffffff;
  --input-hover: #f8fafc;

  /* DECORATIVE */
  --grid-line: rgba(15, 23, 42, 0.05);
  --hero-glow: rgba(99, 102, 241, 0.10);
  --shadow-card: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.10);

  /* SELECTION */
  --selection-bg: rgba(99, 102, 241, 0.25);
  --selection-text: #1e2233;

  /* DISCORD-STYLE MESSAGE (kept recognizably "Discord" in both themes) */
  --discord-bg: #dee1e7;
  --discord-bg-hover: #cfd2d9;
  --discord-text: #313338;
  --discord-text-soft: #5c5f66;
  --discord-time: #868a93;
}

/* ===== DARK MODE = the ORIGINAL index.html palette, unchanged ===== */
.dark {
  color-scheme: dark;

  --bg: #070b12;
  --bg-soft: #0a101b;
  --surface: #0d1420;
  --surface-soft: #111827;
  --surface-strong: #162033;
  --surface-inverted: #ffffff;
  --surface-inverted-soft: #f1f5f9;

  --glass: rgba(13, 20, 32, 0.78);
  --glass-strong: rgba(13, 20, 32, 0.92);
  --header-bg: rgba(13, 17, 28, 0.9);

  --text-strong: #ffffff;
  --text: #f1f5f9;
  --text-soft: #e2e8f0;
  --text-mild: #cbd5e1;
  --muted: #94a3b8;
  --muted-soft: #64748b;
  --faint: #475569;

  --border: #1b2638;
  --border-strong: #334155;
  --border-soft: #141d2e;

  --input: #060a12;
  --input-hover: #0b1220;

  --grid-line: rgba(148, 163, 184, 0.035);
  --hero-glow: rgba(99, 102, 241, 0.16);
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.12);

  --selection-bg: rgba(99, 102, 241, 0.35);
  --selection-text: #c7d2fe;

  --discord-bg: #2b2d31;
  --discord-bg-hover: #35373d;
  --discord-text: #dbdee1;
  --discord-text-soft: #b5bac1;
  --discord-time: #949ba4;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* ===== SHARED HELPERS (used by pages & components) ===== */
.bg-page-glow {
  background:
    radial-gradient(circle at 50% -20%, var(--hero-glow), transparent 38%),
    var(--bg);
}
.bg-page-glow-soft {
  background:
    radial-gradient(ellipse 80% 60% at 50% -15%, var(--hero-glow), transparent),
    var(--bg);
}
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}
.hero-glow {
  box-shadow:
    0 0 80px var(--shadow-glow),
    inset 0 1px rgba(255, 255, 255, 0.025);
}

/* Theme toggle icon visibility:
   .theme-icon-sun  = shown in LIGHT mode (click to switch to dark)
   .theme-icon-moon = shown in DARK mode (click to switch to light) */
.theme-icon-sun { display: inline-flex; }
.theme-icon-moon { display: none; }
html.dark .theme-icon-sun { display: none; }
html.dark .theme-icon-moon { display: inline-flex; }

/* Smooth theme transition for color-aware elements (opt-in via `.theme-fade`) */
.theme-fade {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}