/* base.css — Reset, custom properties, typography */

/* ── Custom properties ─────────────────────────────────────────────────── */
:root {
  --color-phosphor: #39ff14;   /* phosphor green */
  --color-amber:    #ffb000;   /* amber alternate */
  --color-bg:       #0a0a0a;   /* near-black */
  --color-dim:      #1a1a1a;   /* slightly lifted bg */
  --color-red:      #ff2222;   /* interruption alert */
  --color-white:    #f0f0f0;   /* high-contrast text */
  --color-grey:     #555555;   /* decorative / disabled state (WCAG-exempt) */
  /* T-20: secondary text colour that meets WCAG AA 4.5:1 on --color-bg (#0a0a0a).
     Calculated: lin(123) = 0.1957 → L = 0.1957 → ratio = (0.2457)/(0.0530) = 4.64:1 ✓ */
  --color-text-dim: #7b7b7b;

  --font-mono: "Courier New", Courier, "Lucida Console", monospace;
  --font-display: var(--font-mono); /* fallback until embedded font */

  --transition-fast: 150ms ease;
  --transition-screen: 0ms;   /* static-noise overlay handles timing in JS */
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-phosphor);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.5;
}

/* ── Typography ────────────────────────────────────────────────────────── */
h1 { font-size: 2.5rem; letter-spacing: 0.15em; text-transform: uppercase; }
h2 { font-size: 1.6rem; letter-spacing: 0.1em;  text-transform: uppercase; }
h3 { font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; }

p  { font-size: 1rem; line-height: 1.6; }

/* ── Screen layout ─────────────────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto; /* main area + controls footer */
}

section[data-screen] {
  display: none;
  width: 100%;
  height: 100%;
  padding: 2rem;
  overflow-y: auto;
}

section[data-screen].active {
  display: flex;
  flex-direction: column;
}

/* ── Per-screen layout overrides ───────────────────────────────────────── */
/* These rules replace inline style attributes removed from index.html
   (bug T-21: inline display:none overrode section[data-screen].active). */

#screen-interruption.active {
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: rgba(0, 0, 0, 0.92);
  text-align: center;
}

#screen-accusation.active {
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: center;
}

#screen-solution.active {
  gap: 1.5rem;
}

/* ── Accessibility helpers ─────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Focus styles ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
button {
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--color-phosphor);
  padding: 0.5rem 1.2rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

button:hover:not(:disabled) {
  background: var(--color-phosphor);
  color: var(--color-bg);
}

button:disabled,
button[aria-disabled="true"] {
  color: var(--color-grey);
  border-color: var(--color-grey);
  cursor: not-allowed;
}

/* ── Narrow-screen banner ──────────────────────────────────────────────── */
#narrow-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--color-amber);
  color: var(--color-bg);
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  z-index: 999;
}

@media (max-width: 1023px) {
  #narrow-banner { display: block; }
}
