/* =========================================================================
   TDML — Task Force Intake
   Skunkworks / aerospace aesthetic. Dark, editorial, amber accent.
   Visible page is intentionally minimal: hero + timeline + form.
   Context lives behind the CLASSIFIED pill (opens the spec document)
   and the [ 01 ] [ 04 ] indices (open Mission / Rules dossiers).
   ========================================================================= */

:root {
  --bg: #07090c;
  --bg-elev: #0d1116;
  --bg-alt: #0a0d11;
  --bg-card: #10151b;
  --bg-input: #0b0f14;
  --bg-input-focus: #0e1319;

  --fg: #e7eaef;
  --fg-muted: #8a94a3;
  --fg-dim: #5b6471;
  --fg-faint: #2a313b;

  --accent: #5090ff;
  --accent-hot: #60a5fa;
  --accent-dim: #1e3a8a;

  --race-yellow: #ffd700;
  --race-yellow-dim: #7a6200;

  --warn: #ff6b6b;
  --rule: #1a2029;
  --rule-strong: #2a323d;

  /* Denied terminal accents (dossier-02 only) */
  --term-red: #ff3b3b;
  --term-green: #4dd38c;
  --term-bg: #030506;
  --term-fg: #c8d2dc;
  --term-mute: #6b7585;

  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --maxw: 960px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }

/* =========================================================================
   Ribbon — bigger now for accessibility. CLASSIFIED pill opens dossier-02;
   [ 01 ] and [ 04 ] open the Mission and Rules dossiers.
   ========================================================================= */

.ribbon {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(7, 9, 12, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  text-transform: uppercase;
}

.ribbon__tag {
  color: var(--accent);
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--accent-dim);
  flex-shrink: 0;
  letter-spacing: 0.15em;
}

.ribbon__tag--link {
  cursor: pointer;
  color: #ff000079;
  border-color: #ff000079;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.ribbon__tag--link:hover,
.ribbon__tag--link:focus-visible {
  background: #910000;
  color: var(--bg);
  border-color: #910000;
  outline: none;
}

.ribbon__tag--link:active { transform: translateY(1px); }

.ribbon__route {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ribbon__dossier {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.ribbon__index {
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.ribbon__index:hover,
.ribbon__index:focus-visible {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(245, 158, 11, 0.05);
  outline: none;
}

@media (max-width: 720px) {
  .ribbon { padding: 0.7rem 1rem; gap: 0.6rem; font-size: 0.72rem; }
  .ribbon__tag { padding: 0.25rem 0.55rem; }
  .ribbon__index { padding: 0.25rem 0.4rem; }
}

@media (max-width: 480px) {
  .ribbon__route { display: none; }
  .ribbon { font-size: 0.68rem; }
}

/* =========================================================================
   Hero
   The .hero section is a 2× tall scroll container. The inner .hero__stage
   is sticky and fills one viewport. Scrolling through the extra viewport
   worth of height is spent revealing the captions (see .hero__captions)
   before the stage unsticks and the rest of the page scrolls normally.
   ========================================================================= */

.hero {
  position: relative;
  height: 200vh;
  height: 200svh;
  min-height: 1240px;
}

.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #0a0e15 0%, #05070a 70%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero--no-webgl .hero__canvas { display: none; }

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.85) 20%, transparent 80%);
  pointer-events: none;
}

.hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(7,9,12,0.6) 75%, rgba(7,9,12,0.95) 100%);
  pointer-events: none;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 12rem 1.5rem 2rem;
  pointer-events: none;
}

.hero__logo {
  pointer-events: auto;
  margin-bottom: 3.75rem;
}

.logo-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 12vw, 7rem);
  letter-spacing: 0.08em;
  line-height: 0.9;
  color: var(--fg);
  text-shadow: 0 0 40px rgba(245, 158, 11, 0.15);
}

.logo-wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.9rem;
}

.logo-wordmark::after {
  content: "";
  display: block;
  width: var(--accent-line-width, 22rem);
  height: 1px;
  background: var(--accent);
  margin: 1.2rem auto 0;
}

/* When JS is active, start the line short and let hero-scroll.js grow it
   to full width as the sticky reveal progresses (1rem -> 22rem). */
html.js-hero .logo-wordmark {
  --accent-line-width: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html.js-hero .logo-wordmark {
    --accent-line-width: 22rem;
  }
}

.hero__tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  line-height: 1.35;
  max-width: 40ch;
  color: var(--fg);
  margin: 4;
}

.hero__tagline span { display: block; }

.hero__sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 1.25rem 0 0;
}

/* Captions are hidden below the fold when JS is available; hero-scroll.js
   animates them up to their natural position as the user scrolls. */
html.js-hero .hero__captions {
  opacity: 0;
  transform: translate3d(0, 60vh, 0);
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  html.js-hero .hero__captions {
    opacity: 1;
    transform: none;
  }
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--fg-muted);
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.hero__scroll:hover { color: var(--accent); }

.hero__chevron {
  animation: descend 2s ease-in-out infinite;
  font-size: 0.9rem;
}

@keyframes descend {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50%      { transform: translateY(5px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__chevron { animation: none; opacity: 0.7; }
}

/* =========================================================================
   Section scaffolding
   ========================================================================= */

.section {
  padding: 6rem 1.5rem;
  border-top: 1px solid var(--rule);
}

.section--alt { background: var(--bg-alt); }

.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.8vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 2rem;
  max-width: 28ch;
  letter-spacing: -0.01em;
}

.section__body {
  font-size: 1.02rem;
  color: var(--fg);
  max-width: 62ch;
}

.section__body p + p { margin-top: 1.1rem; }

.section__body--tight {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-top: 2rem;
}

.section__body .emphasis {
  color: var(--fg);
  font-size: 1.08rem;
}

.section__body strong {
  color: var(--accent);
  font-weight: 600;
}

.warning {
  border-left: 2px solid var(--accent);
  padding: 0.6rem 0 0.6rem 1rem;
  color: var(--fg);
  font-size: 0.95rem;
  margin: 1.5rem 0 0;
}

/* =========================================================================
   Countdown (sits above the timeline, section 03)
   ========================================================================= */

.countdown {
  border: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(59,130,246,0.04), rgba(59,130,246,0) 60%),
    var(--bg-card);
  padding: 1rem 1.25rem 1.15rem;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.countdown__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--rule-strong);
  padding-bottom: 0.65rem;
}

.countdown__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.countdown__target {
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.countdown__clock {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  justify-content: flex-start;
}

.countdown__seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.25rem;
}

.countdown__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 4.2vw, 2.4rem);
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.countdown__unit {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 0.35rem;
}

.countdown__sep {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  line-height: 1;
  color: var(--fg-dim);
  padding-bottom: 1rem;
}

@media (max-width: 480px) {
  .countdown__seg { min-width: 2.6rem; }
  .countdown__sep { padding-bottom: 0.9rem; }
}

/* =========================================================================
   Timeline (visible section 03)
   ========================================================================= */

.timeline {
  border: 1px solid var(--rule);
  background: var(--bg-card);
  margin: 0 0 1.5rem;
}

.timeline__row {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 2rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.timeline__row:last-child { border-bottom: none; }

.timeline__when {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.timeline__what {
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--fg);
}

@media (max-width: 620px) {
  .timeline__row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
  }
}

/* =========================================================================
   Rules grid (used inside dossier-04)
   ========================================================================= */

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border: 1px solid var(--rule);
  margin: 1.5rem 0 0;
}

.rule {
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rule:last-child { border-right: none; }
@media (max-width: 640px) { .rule { border-right: none; } }

.rule__key {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
}

.rule__val {
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: var(--fg);
}

/* =========================================================================
   Intake section + Form
   ========================================================================= */

.section--intake {
  background: var(--bg);
}

.intake__warning {
  border-left: 2px solid var(--accent-dim);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 0 0 2.5rem;
  color: var(--fg);
  font-size: 0.95rem;
  max-width: 62ch;
}

.intake__warning strong {
  color: var(--accent-hot);
  font-weight: 600;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 620px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field--group { gap: 0.45rem; }

.field__label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0;
}

.field__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.field__opt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  margin-left: auto;
  font-weight: 400;
}

.field__hint {
  font-size: 0.86rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0 0 0.25rem;
  max-width: 60ch;
}

.field__hint code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 0.05rem 0.3rem;
  color: var(--accent);
}

.field__input {
  background: var(--bg-input);
  color: var(--fg);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.8rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field__input::placeholder { color: var(--fg-dim); }
.field__input:hover { border-color: var(--rule-strong); }
.field__input:focus {
  border-color: var(--accent);
  background: var(--bg-input-focus);
}
.field__input:user-invalid { border-color: var(--warn); }

.field__input--area {
  resize: vertical;
  min-height: 128px;
  font-family: inherit;
}

/* Radio options */

.option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  background: var(--bg-input);
  cursor: pointer;
  font-size: 0.98rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover { border-color: var(--rule-strong); }
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-input-focus);
}

.option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s ease;
}

.option input[type="radio"]:checked { border-color: var(--accent); }
.option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}
.option input[type="radio"]:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* Submit — "Enter the Crucible"
   Hollow by default. Interior breathes an amber ember 0 → 20% over 10s,
   anchored at the base like coals in a crucible. On valid submit, form.js
   toggles .submit--igniting and a brief white-hot flash fires. */

.submit {
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 1rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.25s ease, transform 0.12s ease, box-shadow 0.25s ease;
  align-self: flex-start;
}

.submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 95% 75% at 50% 115%,
    #ff7a2a 0%,
    #ff5a1a 22%,
    rgba(255, 120, 40, 0.35) 55%,
    transparent 80%
  );
  opacity: 0;
  animation: ember-breathe 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 140% 120% at 50% 105%,
    #ffffff 0%,
    #ffe2a8 25%,
    #ff8a28 60%,
    rgba(255, 100, 30, 0) 100%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.submit__label,
.submit__arrow {
  position: relative;
  z-index: 1;
}

.submit:hover,
.submit:focus-visible {
  border-color: #ffb066;
  outline: none;
}
.submit:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 176, 102, 0.5);
}
.submit:hover::before,
.submit:focus-visible::before {
  animation-name: ember-breathe-hover;
}

.submit:active { transform: translateY(1px); }

.submit__arrow { transition: transform 0.15s ease; }
.submit:hover .submit__arrow { transform: translateX(4px); }

.submit:disabled:not(.submit--igniting) {
  opacity: 0.55;
  cursor: not-allowed;
}
.submit:disabled:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.submit--igniting {
  animation: submit-ignite-border 450ms ease-out forwards;
}
.submit--igniting::after {
  animation: submit-ignite-flash 450ms ease-out forwards;
}

@keyframes ember-breathe {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.2; }
}

@keyframes ember-breathe-hover {
  0%, 100% { opacity: 0.08; }
  50%      { opacity: 0.38; }
}

@keyframes submit-ignite-flash {
  0%   { opacity: 0; }
  10%  { opacity: 0.9; }
  25%  { opacity: 0.7; }
  100% { opacity: 0; }
}

@keyframes submit-ignite-border {
  0%   { border-color: var(--accent); box-shadow: none; }
  10%  {
    border-color: #ffd8a0;
    box-shadow:
      0 0 28px rgba(255, 200, 120, 0.9),
      inset 0 0 22px rgba(255, 220, 160, 0.5);
  }
  100% { border-color: var(--accent); box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .submit::before { animation: none; opacity: 0.12; }
  .submit--igniting,
  .submit--igniting::after { animation: none; }
}

.status {
  min-height: 1.25rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.status--success { color: var(--accent); }
.status--error   { color: var(--warn); }

/* =========================================================================
   Footer
   ========================================================================= */

.footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.footer__mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-right: 0.9rem;
}

.footer__desc { color: var(--fg-muted); }

@media (max-width: 540px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

/* =========================================================================
   Dossier — base (dialog) chrome. Mission + Rules use this.
   ========================================================================= */

.dossier {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 0;
  max-width: 680px;
  width: 92vw;
  max-height: 85vh;
  margin: auto;
  overflow: hidden;
  position: fixed;
  inset: 0;

  opacity: 0;
  transition: opacity 0.2s ease, transform 0.22s ease;
  transform: translateY(-8px);
}

.dossier[open] {
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .dossier[open] {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.dossier::backdrop {
  background: rgba(3, 5, 8, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dossier__dismiss {
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0.35rem;
  right: 0.55rem;
  z-index: 10;
}

.dossier__close {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  transition: color 0.15s ease;
}

.dossier__close:hover,
.dossier__close:focus-visible {
  color: var(--accent);
  outline: none;
}

.dossier__header {
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.dossier__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
}

.dossier__body {
  padding: 2rem 2rem 2.25rem;
  overflow-y: auto;
  max-height: calc(85vh - 2.8rem);
}

.dossier__body .section__title { margin-bottom: 1.25rem; }
.dossier__body .section__eyebrow { margin-bottom: 0.75rem; }

.dossier__return {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dossier__return:hover,
.dossier__return:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.05);
  outline: none;
}

@media (max-width: 560px) {
  .dossier { width: 96vw; max-height: 92vh; }
  .dossier__body { padding: 1.5rem 1.25rem 1.75rem; max-height: calc(92vh - 2.8rem); }
  .dossier__header { padding: 0.6rem 1.25rem; }
}

/* =========================================================================
   Dossier 02 / ACCESS DENIED
   Hacker-terminal aesthetic. Secure-system session that refuses access
   but leaks enough structure to confirm the document exists.
   ========================================================================= */

.dossier--denied {
  background: var(--term-bg);
  color: var(--term-fg);
  border: 1px solid var(--rule-strong);
  max-width: 760px;
  font-family: var(--font-mono);
  box-shadow:
    0 0 0 1px rgba(255, 59, 59, 0.1),
    0 30px 80px rgba(0, 0, 0, 0.8);
}

/* Close button lives inside the chrome for this variant. Override the
   absolute positioning from the base .dossier__dismiss. */
.dossier--denied .dossier__dismiss {
  position: static;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
}

.dossier--denied .dossier__close {
  color: var(--term-mute);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border: 1px solid transparent;
  line-height: 1;
}

.dossier--denied .dossier__close:hover,
.dossier--denied .dossier__close:focus-visible {
  color: var(--term-red);
  border-color: rgba(255, 59, 59, 0.4);
  outline: none;
}

/* Terminal wrapper */
.terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

/* Chrome / title bar */
.terminal__chrome {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  background: #0a0d11;
  border-bottom: 1px solid #1a2029;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--term-mute);
  text-transform: uppercase;
  flex-shrink: 0;
}

.terminal__chrome-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.terminal__led {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--term-red);
  box-shadow: 0 0 6px rgba(255, 59, 59, 0.7);
  animation: led-breathe 2.4s ease-in-out infinite;
}

@keyframes led-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

.terminal__host {
  color: var(--fg-muted);
}

.terminal__path {
  flex: 1;
  text-align: center;
  color: var(--term-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0.04em;
}

.terminal__session {
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 0.15rem 0.45rem;
  flex-shrink: 0;
  letter-spacing: 0.15em;
}

@media (max-width: 560px) {
  .terminal__chrome { padding: 0.5rem 0.65rem; gap: 0.5rem; font-size: 0.64rem; }
  .terminal__path { display: none; }
  .terminal__session { font-size: 0.6rem; padding: 0.12rem 0.3rem; }
}

/* Body */
.terminal__body {
  position: relative;
  padding: 1.5rem 1.75rem 1.75rem;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  z-index: 1;
}

.terminal__body code {
  font-family: var(--font-mono);
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
  padding: 0.05em 0.35em;
  border: 1px solid rgba(245, 158, 11, 0.18);
  font-size: 0.9em;
}

@media (max-width: 560px) {
  .terminal__body { padding: 1.25rem 1rem 1.5rem; font-size: 0.85rem; }
}

/* CRT scanlines overlay */
.terminal__scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(255, 255, 255, 0.018) 2px,
    rgba(255, 255, 255, 0.018) 3px
  );
}

/* Log lines */
.terminal__log { margin-bottom: 0.5rem; }
.terminal__log p { margin: 0 0 0.2rem; }
.terminal__log p:last-child { margin-bottom: 0; }

.terminal__ts {
  color: var(--term-mute);
  margin-right: 0.5rem;
}

.terminal__err {
  color: var(--term-red);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Denied banner */
.terminal__denied {
  margin: 1.75rem 0 1.5rem;
  text-align: center;
}

.terminal__denied-bar {
  display: inline-block;
  background: var(--term-red);
  color: var(--term-bg);
  padding: 0.75rem 2.2rem;
  font-weight: 700;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  letter-spacing: 0.3em;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255, 59, 59, 0.3),
    0 0 24px rgba(255, 59, 59, 0.25);
  animation: denied-pulse 2.8s ease-in-out infinite;
}

@keyframes denied-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.3), 0 0 20px rgba(255, 59, 59, 0.2); }
  50%      { box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.55), 0 0 40px rgba(255, 59, 59, 0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .terminal__denied-bar { animation: none; }
  .terminal__led        { animation: none; opacity: 0.9; }
  .terminal__cursor     { animation: none; opacity: 1; }
}

/* Command lines */
.terminal__cmd {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
  flex-wrap: wrap;
}

.terminal__prompt {
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}

.terminal__typed { color: var(--term-fg); }

.terminal__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Partial-disclosure preamble + spec rows */
.terminal__note {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
}

.terminal__specs { margin: 0 0 0.25rem; }

.terminal__row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.terminal__row-key {
  color: var(--term-fg);
  flex-shrink: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  min-width: 5.5rem;
}

.terminal__row-dots {
  flex: 1;
  border-bottom: 1px dotted #2a323d;
  transform: translateY(-0.3em);
  margin: 0 0.3rem;
  min-width: 1rem;
}

.terminal__row-val {
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.terminal__row-val--denied { color: var(--term-red); }
.terminal__row-val--ok     { color: var(--term-green); }

@media (max-width: 560px) {
  .terminal__row { font-size: 0.82rem; }
  .terminal__row-key { font-size: 0.76rem; min-width: 4.5rem; }
  .terminal__row-val { font-size: 0.78rem; }
  .terminal__row-dots { min-width: 0.5rem; }
}

.terminal__footer {
  color: var(--term-mute);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin: 1.25rem 0 0;
}

/* =========================================================================
   Smaller screens
   ========================================================================= */

@media (max-width: 640px) {
  .section { padding: 4.5rem 1.1rem; }
}
