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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #0b0c0e;
}

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

::selection {
  background: #4cd07a;
  color: #0b0c0e;
}

/* The browser default focus ring is a mid-blue that all but disappears on this
   near-black background. Replace it with a light, offset ring. */
:focus-visible {
  outline: 2px solid #e8e6df;
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- page wrapper ---
   `overflow-x: clip` — NOT `overflow: hidden` — is load-bearing, which is why
   it lives here rather than inline on the element.

   Several sections carry rotated decorative stamps that would otherwise widen
   the page and produce a horizontal scrollbar, so the overflow has to be
   contained. But `overflow: hidden` on an ancestor makes that ancestor the
   scroll container for any `position: sticky` descendant, and since this
   wrapper is as tall as the document, the sticky nav had nothing left to stick
   within — it scrolled away with the page, taking the only conversion CTA with
   it. `clip` suppresses the same overflow WITHOUT establishing a scroll
   container, so the nav sticks and the page still can't scroll sideways.

   Keep this on `overflow-x` only: setting `overflow: clip` on both axes would
   also clip the sticky nav out of view once it left the wrapper's padding box. */
.cs-page {
  position: relative;
  overflow-x: clip;
  min-height: 100vh;
  background: #0b0c0e;
  color: #e8e6df;
  font-family: "Archivo", sans-serif;
}

/* Keyboard users would otherwise tab the logo, file-number link, AUTHENTICATE
   and the CTA on every page before reaching content. Visually hidden until
   focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #4cd07a;
  color: #0b0c0e;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 20px;
}

.skip-link:focus {
  left: 0;
}

/* --- decorative animations --- */

@keyframes csmarq {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes csblink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.12;
  }
}

@keyframes csglitch {
  0%,
  100% {
    text-shadow: 0 0 0 transparent;
  }
  45% {
    text-shadow: -2px 0 #c23b2b, 2px 0 #4cd07a;
  }
  55% {
    text-shadow: 2px 0 #c23b2b, -2px 0 #4cd07a;
  }
}

.cs-marquee {
  display: flex;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  animation: csmarq 38s linear infinite;
  will-change: transform;
}

.cs-scan {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.cs-glitch {
  animation: csglitch 5.5s steps(1) infinite;
}

.cs-blink {
  animation: csblink 1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cs-marquee,
  .cs-glitch,
  .cs-blink,
  .briefing-btn--sound:not([aria-pressed="true"]),
  .briefing-btn[aria-pressed="true"] .briefing-eq i,
  .briefing-gate-btn {
    animation: none;
  }

  /* The landing page is ~12,500px tall, so a smooth-scrolled jump to #access
     or #engine is a long animated travel — exactly what this setting exists to
     suppress. Overrides `scroll-behavior: smooth` on `html` above. */
  html {
    scroll-behavior: auto;
  }
}

/* --- responsive grid columns ---
   `data-col` marks the design's multi-column grids; the inline style sets the
   desktop column count and this collapses it at narrower widths. */
@media (max-width: 880px) {
  [data-col="split"] {
    grid-template-columns: 1fr !important;
  }
  [data-col="3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [data-col="4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  [data-col="3"] {
    grid-template-columns: 1fr !important;
  }
  [data-col="4"] {
    grid-template-columns: 1fr !important;
  }
  .cs-page > section {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }
  .cs-page > header {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }
  .cs-page > footer {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }
}

/* --- interactive components ---------------------------------------------
   The rest of the page keeps its inline `style` attributes (that is how the
   design tool emits markup), but every element with a :hover/:focus state has
   its base declarations here instead.

   That is load-bearing, not tidiness: an inline style beats a stylesheet class
   no matter how specific the selector, so a `:hover` rule for a property also
   set inline on the same element silently does nothing. Leaving
   `border-color: …` inline on a button is enough to kill its hover border. */

.btn-outline {
  border: 1px solid #2a2c34;
  color: #e8e6df;
  transition: border-color 0.2s, color 0.2s;
}

.btn-outline:hover {
  border-color: #4cd07a;
  color: #4cd07a;
}

.btn-accent {
  background: #4cd07a;
  color: #0b0c0e;
}

.btn-brighten {
  transition: filter 0.2s;
}

.btn-brighten:hover {
  filter: brightness(1.12);
}

.btn-accent-swap {
  background: #4cd07a;
  color: #0b0c0e;
  transition: background 0.2s, color 0.2s;
}

.btn-accent-swap:hover {
  background: #0b0c0e;
  color: #4cd07a;
}

.rule-card {
  background: #101115;
  transition: background 0.2s;
}

.rule-card:hover {
  background: #14161c;
}

.case-card {
  border: 1px solid #23252d;
  transition: border-color 0.2s;
}

.case-card:hover {
  border-color: #4cd07a;
}

/* --- redacted / classified text --- */

.redact-inline {
  background: #1c1e25;
  color: transparent;
  padding: 0 6px;
  border-radius: 1px;
  cursor: help;
  transition: background 0.2s, color 0.2s;
}

.redact-inline:hover {
  background: transparent;
  color: #e8e6df;
}

.redact-inline.redact-amber:hover {
  color: #e0a83e;
}

.redact-manila {
  background: #1a1813;
  color: transparent;
  padding: 0 6px;
  cursor: help;
  transition: background 0.2s, color 0.2s;
}

.redact-manila:hover {
  background: transparent;
  color: #1a1813;
}

/* The redaction is a visual gag, but the words under it are real copy — the
   hero's "no gurus, no signals service, no advice" disclaimer, the engine rule
   bodies, the memo. On a device that cannot hover there is no way to recover
   them, so the joke would cost a phone visitor whole sentences. Reveal them
   outright wherever hover isn't available. `color: inherit` picks up the
   surrounding text colour, which is legible on both the dark page and the
   manila memo. */
@media (hover: none) {
  .redact-inline,
  .redact-manila {
    background: transparent;
    color: inherit;
    cursor: auto;
  }
}

/* Keyboard reveal. Every redacted span carries tabindex="0" so these rules
   actually fire — without it they were dead code and a sighted keyboard-only
   user on a mouse-capable machine had no way to read the copy at all (the
   `hover: none` block above only rescues touch devices). The text itself is
   `color: transparent`, not hidden, so screen readers and text selection were
   never affected — this is about the visual affordance. */
.redact-inline:focus-visible {
  background: transparent;
  color: #e8e6df;
}

.redact-manila:focus-visible {
  background: transparent;
  color: #1a1813;
}

/* --- FAQ accordion ---
   Built on native <details>/<summary>. The browser owns show/hide and the
   announced expanded state, so the markup cannot drift out of sync with what
   is rendered the way a hand-rolled aria-expanded could. main.js adds only the
   single-open behaviour; everything below works with JS switched off.

   `color` lives here, not inline on the summary — an inline colour would beat
   the :hover rule and silently kill the one affordance saying this is
   clickable. */
.faq-item {
  border: 1px solid #23252d;
  background: #0e0f13;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  cursor: pointer;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #e8e6df;
  transition: color 0.2s;
}

.faq-question:hover {
  color: #4cd07a;
}

/* Drop the default disclosure triangle — .faq-sign is the affordance. */
.faq-question {
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

/* Driven off the `open` attribute rather than JS, so the sign always matches
   the panel state even with no JavaScript at all. */
.faq-sign {
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  color: #4cd07a;
  flex: none;
  line-height: 1;
  width: 18px;
  text-align: center;
}

.faq-sign::before {
  content: "+";
}

.faq-item[open] .faq-sign::before {
  content: "−";
}

/* --- hero briefing ---
   src/js/hero-briefing.js adds `.is-live` once it is ready to draw. Until then
   (and forever, with JS off or on failure) the static terminal renders and the
   canvas + player controls stay hidden. Once live, the terminal is visually
   hidden but kept in the accessibility tree: it is the text version of the
   briefing's closing "daily diff" scene. */
.briefing-stage,
.briefing-controls {
  display: none;
}

.briefing.is-live .briefing-stage {
  display: block;
}

.briefing.is-live .briefing-controls {
  display: flex;
}

.briefing.is-live .briefing-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.briefing-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #070809;
}

.briefing-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* A taller stage on phones, so the chart isn't a sliver. The script lays out
   against whatever box it gets. */
@media (max-width: 600px) {
  .briefing-stage {
    aspect-ratio: 4 / 3.3;
  }
}

.briefing-controls {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-top: 1px solid #1a1c22;
  background: #101115;
}

.briefing-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #cfd2d8;
  background: transparent;
  border: 1px solid #2a2c34;
  border-radius: 0;
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.briefing-btn:hover,
.briefing-btn[aria-pressed="true"] {
  border-color: #4cd07a;
  color: #4cd07a;
}

/* Sound is opt-in, so the button has to be findable: a slow pulse until the
   visitor turns it on. */
.briefing-btn--sound:not([aria-pressed="true"]) {
  animation: briefing-invite 2.4s ease-in-out infinite;
}

@keyframes briefing-invite {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(76, 208, 122, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(76, 208, 122, 0.22);
  }
}

/* Three-bar level meter: flat when muted, bouncing when sound is on. */
.briefing-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.briefing-eq i {
  width: 2px;
  height: 3px;
  background: currentColor;
}

.briefing-btn[aria-pressed="true"] .briefing-eq i {
  animation: briefing-eq 0.5s ease-in-out infinite alternate;
}

.briefing-btn[aria-pressed="true"] .briefing-eq i:nth-child(2) {
  animation-delay: -0.2s;
}

.briefing-btn[aria-pressed="true"] .briefing-eq i:nth-child(3) {
  animation-delay: -0.35s;
}

@keyframes briefing-eq {
  from {
    height: 2px;
  }
  to {
    height: 10px;
  }
}

/* Scene scrubber: one segment per scene, sized by its length in beats (set
   inline by the script). Each is a button that jumps to that scene. */
.briefing-scenes {
  display: flex;
  gap: 3px;
  flex: 1 1 140px;
  min-width: 140px;
}

.briefing-seg {
  position: relative;
  height: 22px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.briefing-seg::before,
.briefing-seg-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  height: 4px;
}

.briefing-seg::before {
  background: #23252d;
  transition: background 0.2s;
}

.briefing-seg:hover::before {
  background: #3a3d46;
}

.briefing-seg-fill {
  background: #4cd07a;
  transform: scaleX(0);
  transform-origin: left;
}

.briefing-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #7d8089;
  min-width: 7ch;
  text-align: right;
}

/* --- teaser pages (/intercept/NN/) ---
   2010 internet-marketing sales letter, in the dossier palette. */

/* Highlighter-pen block behind a phrase: dark ink on yellow, so it reads on
   the near-black page. */
.hl {
  background: #f2d03b;
  color: #0b0c0e;
  padding: 0 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Teaser player: 16:9 on wide screens, near-portrait on phones (the film lays
   out for either). */
.briefing--intercept .briefing-stage {
  aspect-ratio: 16 / 9;
}

@media (max-width: 600px) {
  .briefing--intercept .briefing-stage {
    aspect-ratio: 4 / 5;
  }
}

/* Click-to-start gate over the poster frame. Starting from a click is what
   lets the soundtrack (and later the voiceover) play with sound. */
.briefing-gate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(7, 8, 9, 0.35), rgba(7, 8, 9, 0.8));
}

.briefing-gate[hidden] {
  display: none;
}

.briefing-gate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 34px;
  font-family: "JetBrains Mono", monospace;
  color: #0b0c0e;
  background: #4cd07a;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 0 0 6px rgba(76, 208, 122, 0.18), 0 18px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s, box-shadow 0.2s;
  animation: briefing-invite 2.4s ease-in-out infinite;
}

.briefing-gate-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 10px rgba(76, 208, 122, 0.25), 0 18px 40px rgba(0, 0, 0, 0.6);
}

.briefing-gate-icon {
  font-size: 34px;
  line-height: 1;
}

.briefing-gate-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.briefing-gate-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  opacity: 0.75;
}

@media (max-width: 600px) {
  .briefing-gate-btn {
    padding: 16px 20px;
  }

  .briefing-gate-label {
    font-size: 13px;
  }
}

/* Hand-drawn arrows + scrawled note pointing at the player (wide screens). */
.intercept-arrow {
  position: absolute;
  width: 92px;
  height: 92px;
  top: -40px;
  pointer-events: none;
}

.intercept-arrow--left {
  left: -48px;
}

.intercept-arrow--right {
  right: -48px;
}

.intercept-note {
  position: absolute;
  top: -22px;
  right: 60px;
  transform: rotate(4deg);
  font-family: "Special Elite", monospace;
  font-size: 18px;
  color: #f2d03b;
  pointer-events: none;
}

@media (max-width: 1060px) {
  .intercept-arrow {
    display: none;
  }
}

@media (max-width: 600px) {
  .intercept-note {
    display: none;
  }
}

/* The "order box": dashed coupon border, starburst badge. */
.order-box {
  position: relative;
  border: 3px dashed #c23b2b;
  background: #0e0f13;
  padding: 34px 30px 28px;
  text-align: center;
}

.burst {
  position: absolute;
  top: -34px;
  right: -22px;
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2d03b;
  color: #0b0c0e;
  font-family: "Archivo Black", sans-serif;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  transform: rotate(12deg);
  clip-path: polygon(50% 0%, 61% 15%, 79% 9%, 79% 27%, 97% 32%, 87% 48%, 98% 64%, 80% 70%, 79% 89%, 61% 84%, 50% 100%, 39% 84%, 21% 89%, 20% 70%, 2% 64%, 13% 48%, 3% 32%, 21% 27%, 21% 9%, 39% 15%);
}

@media (max-width: 600px) {
  .order-box {
    padding: 34px 18px 24px;
  }

  .burst {
    right: -8px;
    width: 76px;
    height: 76px;
    font-size: 13px;
  }
}

/* The big yellow 2010 "add to cart" button. */
.btn-order {
  display: inline-block;
  padding: 18px 34px;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(17px, 2.4vw, 22px);
  letter-spacing: 0.02em;
  color: #0b0c0e;
  background: linear-gradient(#ffe36e, #f2c22e);
  border: 2px solid #8a6a12;
  border-radius: 6px;
  box-shadow: 0 4px 0 #8a6a12, 0 12px 26px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  transition: filter 0.2s, transform 0.1s, box-shadow 0.1s;
}

.btn-order:hover {
  filter: brightness(1.08);
}

.btn-order:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8a6a12, 0 8px 18px rgba(0, 0, 0, 0.5);
}
