/* ==========================================================================
   CRISIS LINE — shared site chrome.

   Served under a strict CSP: default-src 'none'; style-src 'self'. That means
   no JavaScript, no inline <style> or style="" attributes, and no web fonts.
   Everything here is external CSS on system fonts, and every interactive part
   of the site is plain HTML (links, <details>) rather than script.

   The palette is lifted straight from src/theme.ts so the site and the app
   read as the same object. Dark only, on purpose: the game is a night shift.
   ========================================================================== */

:root {
  color-scheme: dark;

  --ink: #07090F;          /* page ground, below the panels */
  --bg: #0B0E14;
  --panel: #141926;
  --panel-2: #1B2130;
  --line: #232B3E;
  --line-soft: rgba(35, 43, 62, 0.6);

  --text: #E6EAF2;
  --dim: #8A93A6;

  --accent: #4FA3FF;
  --gold: #E8B45A;
  --trust: #3FCF8E;
  --tension: #FF5C5C;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;

  --radius: 12px;
  --gutter: 1.25rem;
  --measure: 68rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.68 var(--sans);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7CBEFF; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link — visible only once it has focus. -------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #04101F;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* The house label: mono, uppercase, widely tracked. Used for every kicker,
   every nav item, every field name on the site. --------------------------- */
.kicker {
  margin: 0;
  color: var(--dim);
  font: 11px/1.5 var(--mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.kicker--accent { color: var(--accent); }

/* Header ---------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 9, 15, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
}

.masthead__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  min-height: 58px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--text);
  font: 800 14px/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand:hover { color: var(--text); }

/* The ringing indicator from the title screen, reduced to a 8px tell. */
.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(79, 163, 255, 0.55);
  animation: ring 2.2s ease-out infinite;
}

@keyframes ring {
  0%   { box-shadow: 0 0 0 0 rgba(79, 163, 255, 0.5); opacity: 1; }
  70%  { box-shadow: 0 0 0 9px rgba(79, 163, 255, 0); opacity: 0.55; }
  100% { box-shadow: 0 0 0 0 rgba(79, 163, 255, 0); opacity: 1; }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.nav a {
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  color: var(--dim);
  font: 11px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--panel); }

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--panel);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 800 13px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #04101F;
  box-shadow: 0 0 26px rgba(79, 163, 255, 0.28);
}
.btn--primary:hover { background: #6FB5FF; color: #04101F; }
.btn--primary .dot { background: #04101F; animation: none; box-shadow: none; }

.btn--ghost {
  border-color: var(--line);
  background: rgba(20, 25, 38, 0.6);
  color: var(--dim);
}
.btn--ghost:hover { color: var(--text); border-color: #33405C; }

/* Panels ---------------------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The one non-negotiable block on every page: this is fiction, and here is
   the number for a line that is not. ------------------------------------- */
.lifeline {
  border-left: 3px solid var(--trust);
  background: rgba(63, 207, 142, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.15rem 1.35rem;
}
.lifeline p { margin: 0.55rem 0 0; }
.lifeline p:first-of-type { margin-top: 0.7rem; }
.lifeline strong { color: var(--text); }
.lifeline .kicker { color: var(--trust); }

.lifeline__number {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.6rem 1.05rem;
  border-radius: 8px;
  background: rgba(63, 207, 142, 0.14);
  border: 1px solid rgba(63, 207, 142, 0.35);
  color: var(--trust);
  font: 800 12px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}
.lifeline__number:hover { color: #6FE0AD; background: rgba(63, 207, 142, 0.2); }

/* Footer ---------------------------------------------------------------- */
.footer {
  margin-top: 5rem;
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--dim);
  font-size: 0.92rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font: 11px/1.9 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer__links a { color: var(--dim); text-decoration: none; }
.footer__links a:hover { color: var(--text); }

.footer p { margin: 0.9rem 0 0; max-width: 40rem; }
.footer__fine { color: #6E7688; font-size: 0.85rem; }

@media (max-width: 46rem) {
  .footer__grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
