/* Shared by every page: self-hosted pixel fonts (SIL OFL, see fonts/LICENSE.txt) and the palette. */

@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/pressstart2p-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/pressstart2p-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/vt323-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/vt323-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: "VT323", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Phosphor themes: green by default, amber and white on demand (terminal: `couleur`). */
  --fg: #46f27a;
  --fg-dim: #2a9c4e;
  --fg-faint: #134d27;
  --glow: rgba(70, 242, 122, 0.45);
  --bg: #050b07;
  --bg-raise: #0a140d;
  --accent: #ffd447;
  --danger: #ff6b5e;
  color-scheme: dark;
}
:root[data-phosphor="ambre"] {
  --fg: #ffb63d;
  --fg-dim: #b07a1f;
  --fg-faint: #4d340b;
  --glow: rgba(255, 182, 61, 0.45);
  --bg: #0b0703;
  --bg-raise: #150e06;
  --accent: #7df2ff;
}
:root[data-phosphor="blanc"] {
  --fg: #e8f1ff;
  --fg-dim: #8c9ab0;
  --fg-faint: #2c3442;
  --glow: rgba(200, 220, 255, 0.35);
  --bg: #07090d;
  --bg-raise: #0e1219;
  --accent: #ffd447;
}

*, *::before, *::after { box-sizing: border-box; }

/* Classes like .px-btn set display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-variant-ligatures: none; /* VT323's "ff"/"fi" ligatures break the monospace columns */
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* CRT overlay: scanlines + vignette, never intercepts clicks. */
.crt::before,
.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}
.crt::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.28) 3px
  );
}
.crt::after {
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.55) 100%);
}

/* Press Start 2P has no accented capitals (É renders lower-case): write pixel-font labels without accents. */

/* Pixel button: stepped corners via box-shadow, presses down like a 1990 key. */
.px-btn {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.6;
  color: var(--bg);
  background: var(--fg);
  border: 0;
  padding: 12px 18px;
  margin: 4px;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 -4px 0 0 var(--fg),
    0 4px 0 0 var(--fg),
    -4px 0 0 0 var(--fg),
    4px 0 0 0 var(--fg),
    0 8px 0 0 var(--fg-faint);
  transition: transform 60ms steps(1);
}
.px-btn:hover { background: var(--accent); box-shadow: 0 -4px 0 0 var(--accent), 0 4px 0 0 var(--accent), -4px 0 0 0 var(--accent), 4px 0 0 0 var(--accent), 0 8px 0 0 var(--fg-faint); }
.px-btn:active { transform: translateY(4px); }
.px-btn.ghost {
  color: var(--fg);
  background: transparent;
  box-shadow: inset 0 0 0 3px var(--fg);
}
.px-btn.ghost:hover { color: var(--bg); background: var(--fg); box-shadow: inset 0 0 0 3px var(--fg); }
.px-btn[disabled] { opacity: 0.5; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
