/* Shared dark theme.
   Loaded first on every page so page-specific CSS still cascades over it.
   Page styles reference these tokens instead of hardcoded light colours. */

:root {
  /* Matrix egg palette: near-black surfaces with a faint green cast, so the
     banner's glow reads as the same world as the rest of the page */
  /* Surfaces, lightest-on-top order */
  --bg: #070b08;
  --bg-elevated: #0d130e;
  --bg-raised: #131b14;
  --bg-sunken: #040604;
  --bg-input: #0a100b;
  --header-bg: #030503;

  /* Borders */
  --border: #1d2a1f;
  --border-strong: #2a3d2d;

  /* Text */
  --text: #e6f2e6;
  --text-muted: #9fb8a2;
  --text-dim: #6b8a6f;
  --text-on-accent: #04110a;

  /* Brand: the egg's pixel green */
  --accent: #4ce84f;
  --accent-hover: #7dff80;
  --accent-deep: #1f9e3a;
  --accent-soft: rgba(76, 232, 79, 0.14);
  --accent-border: rgba(76, 232, 79, 0.35);
  --accent-glow: 0 0 18px rgba(76, 232, 79, 0.45);

  /* Status colours, tuned for dark backgrounds */
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --gold: #ffd700;

  /* Shadows read as depth against dark surfaces only when they're strong */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);

  /* Monospace for anything that should feel like the terminal in the banner */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;

  color-scheme: dark;
}

/* Buttons and links that use the accent get the glow on hover */
a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
}

/* Form controls inherit the dark scheme rather than the OS light default */
input,
textarea,
select,
button {
  font-family: inherit;
  color-scheme: dark;
}

input,
textarea,
select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Native pickers render light-on-light without this */
option {
  background: var(--bg-elevated);
  color: var(--text);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-sunken);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}
