:root {
  color-scheme: dark;
  --void: #040604;
  --ink: #ece9d8;
  --muted: #a7ad9b;
  --acid: #ccf238;
  --acid-hot: #deff58;
  --acid-dim: rgba(204, 242, 56, .13);
  --line: rgba(204, 242, 56, .48);
  --line-soft: rgba(204, 242, 56, .18);
  --panel: rgba(8, 12, 8, .94);
  --panel-2: #0c100b;
  --radius: 18px;
  --font-display: "Bungee", Impact, sans-serif;
  --font-ui: "Space Grotesk", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(70% 75% at 50% 60%, rgba(139, 166, 34, .08), transparent 70%),
    linear-gradient(180deg, #030503, #080b06 72%, #020302);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--acid);
  color: #111507;
  font-weight: 700;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--acid-hot); outline-offset: 4px; }

.top-shell { position: relative; z-index: 40; padding: max(12px, env(safe-area-inset-top)) 14px 0; }
.top-rail {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  gap: clamp(12px, 2vw, 32px);
  width: min(1680px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 9px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(3, 5, 3, .88);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .025);
  backdrop-filter: blur(16px);
}
.rail-link,
.rail-status,
.contract-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: .82rem;
  letter-spacing: .035em;
}
.rail-link { transition: color .2s ease; }
.rail-link:hover { color: var(--acid); }
.rail-spacer { flex: 1 1 auto; }
.signal-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px rgba(204, 242, 56, .65); }
.rail-status { color: var(--muted); }

.buy-control { position: relative; }
.buy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--acid);
  border-radius: 999px;
  background: var(--acid);
  color: #121607;
  box-shadow: 0 0 24px rgba(204, 242, 56, .34);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.buy-button span { margin-left: 9px; transition: transform .2s ease; }
.buy-button[aria-expanded="true"] span { transform: rotate(180deg); }
.buy-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 60;
  width: min(330px, calc(100vw - 34px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 8, 5, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .72);
}
.buy-menu[hidden] { display: none; }
.buy-menu__eyebrow,
.buy-menu__network { margin: 2px 8px 8px; color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.buy-menu a,
.buy-menu__copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.buy-menu a:hover,
.buy-menu__copy:hover { background: var(--acid-dim); color: var(--acid-hot); }
.buy-menu__copy { justify-content: flex-start; }
.buy-menu__network { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.contract-control { padding: 0; cursor: pointer; }
.contract-control > span:first-child { color: var(--muted); }
.contract-control code { color: var(--ink); font-family: var(--font-ui); }

.case-dialog {
  width: min(720px, 94vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .65);
}
.case-dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(5px); }
.case-dialog[open] { animation: drawer-in .34s ease-out both; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(36px); } }
.case-dialog[data-active-file="origin"] { width: min(1040px, 96vw); }
.case-dialog[data-active-file="origin"][open] { animation-name: origin-drawer-in; animation-duration: .42s; }
@keyframes origin-drawer-in { from { opacity: 0; transform: translateX(76px); } }
.case-dialog__bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 92px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 10, 7, .92);
  backdrop-filter: blur(14px);
}
.case-dialog__eyebrow { color: var(--acid); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.case-dialog h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: clamp(1.45rem, 4vw, 2.25rem); font-weight: 400; }
.dialog-close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, .035);
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover { border-color: var(--acid); color: var(--acid); }
.case-dialog__body { padding: 24px 24px max(64px, env(safe-area-inset-bottom)); }
.file-panel[hidden] { display: none; }
.panel-lead { margin: 0 0 22px; color: var(--muted); font-size: 1.05rem; }

.panel-hero { display: grid; grid-template-columns: minmax(180px, .75fr) 1fr; gap: 24px; align-items: center; margin-bottom: 24px; }
.panel-hero > * { min-width: 0; }
.panel-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(46dvh, 440px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  filter: saturate(.65) contrast(1.08);
}
.panel-hero span,
.dossier-grid span,
.operation-grid span,
.comms-grid span { color: var(--acid); font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.panel-hero h3,
.transmission-card h3 { margin: 8px 0 10px; font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2.3rem); line-height: 1.08; font-weight: 400; }
.panel-hero p,
.dossier-grid p,
.transmission-card p,
.operation-grid p { color: var(--muted); }
.dossier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dossier-grid article,
.transmission-card,
.stat-grid article,
.contract-card,
.comms-grid a { border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.dossier-grid article { padding: 18px; }
.dossier-grid h3 { margin: 10px 0 8px; font-size: 1rem; }
.dossier-grid p { margin: 0; font-size: .88rem; }
.origin-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 0 24px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--line-soft);
}
.origin-facts div { min-width: 0; padding: 15px 16px; background: rgba(4, 7, 4, .96); }
.origin-facts dt { color: var(--acid); font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.origin-facts dd { margin: 7px 0 0; color: var(--ink); font-family: var(--font-display); font-size: clamp(.95rem, 2vw, 1.25rem); line-height: 1.05; }
.dossier-source {
  display: inline-flex;
  margin-top: 13px;
  color: var(--acid);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
}
.dossier-source:hover, .dossier-source:focus-visible { color: var(--acid-hot); text-decoration: underline; text-underline-offset: 4px; }

.sightings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sightings-grid figure { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 12px; background: #080b07; }
.sightings-grid img { display: block; width: 100%; height: auto; max-height: 260px; aspect-ratio: 1; object-fit: cover; filter: saturate(.7) contrast(1.08); transition: transform .3s ease; }
.sightings-grid figure:hover img { transform: scale(1.03); }
.sightings-grid figcaption { padding: 9px 10px 11px; color: var(--muted); font-size: .75rem; }

.transmission-stack { display: grid; gap: 14px; }
.transmission-card { padding: clamp(22px, 5vw, 42px); }
.transmission-card__status { display: inline-flex; align-items: center; gap: 8px; color: var(--acid); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; }
.action-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border: 1px solid var(--line-soft); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 700; }
.action-button:hover { border-color: var(--acid); color: var(--acid); }
.action-button--acid { border-color: var(--acid); background: var(--acid); color: #111506; }
.action-button--acid:hover { color: #111506; background: var(--acid-hot); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-grid article { padding: 18px 12px; text-align: center; }
.stat-grid strong { display: block; color: var(--acid); font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; }
.stat-grid span { color: var(--muted); font-size: .75rem; }
.contract-card { display: grid; gap: 10px; margin-top: 14px; padding: 20px; }
.contract-card span { color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.contract-card code { overflow-wrap: anywhere; color: var(--ink); }
.contract-card button { justify-self: start; min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--acid-dim); color: var(--acid); cursor: pointer; }
.risk-copy { margin-top: 22px; color: var(--muted); font-size: .78rem; }

.operation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.operation-card { overflow: hidden; margin: 0; border: 1px solid var(--line-soft); border-radius: 15px; background: rgba(255, 255, 255, .025); color: var(--ink); text-decoration: none; }
.operation-grid img { display: block; width: 100%; height: auto; max-height: 260px; aspect-ratio: 16 / 9; object-fit: cover; filter: saturate(.65) contrast(1.08); }
.operation-grid span,
.operation-grid h3,
.operation-grid p,
.operation-grid strong { display: block; margin-left: 18px; margin-right: 18px; }
.operation-grid span { margin-top: 18px; }
.operation-grid h3 { margin-top: 6px; margin-bottom: 6px; font-family: var(--font-display); font-weight: 400; }
.operation-grid p { margin-top: 0; }
.operation-grid strong { margin-top: 18px; margin-bottom: 20px; color: var(--acid); }
.operation-grid a.operation-card:hover { border-color: var(--acid); }
.operation-card--soon { opacity: .76; }
.operation-card--soon strong { color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.comms-grid { display: grid; gap: 12px; }
.comms-grid a { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 16px; min-height: 84px; padding: 16px 20px; color: var(--ink); text-decoration: none; }
.comms-grid strong { font-size: 1.15rem; }
.comms-grid em { color: var(--muted); font-size: .82rem; font-style: normal; }
.comms-grid a:hover { border-color: var(--acid); }

.no-script-nav { max-width: 900px; margin: 30px auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; }
.no-script-nav a { display: inline-block; margin: 8px 12px 0 0; color: var(--acid); }

@media (max-width: 1120px) {
  .rail-social, .rail-status { display: none; }
  .contract-control > span:first-child { display: none; }
}
@media (max-width: 760px) {
  .top-shell { padding-left: 8px; padding-right: 8px; }
  .top-rail { width: calc(100vw - 16px); min-height: 56px; gap: 8px; padding: 5px 8px; border-radius: 18px; backdrop-filter: none; }
  .rail-link { padding: 0 8px; font-size: .75rem; }
  .rail-link--archive .signal-dot { display: none; }
  .buy-button { min-height: 42px; padding: 0 15px; font-size: .78rem; }
  .contract-control { margin-left: auto; padding: 0 7px; }
  .contract-control code, .contract-control > span:last-child { display: none; }
  .contract-control::before { content: "CA"; color: var(--muted); }
  .rail-spacer, .rail-link--play { display: none; }
  .buy-menu { position: fixed; left: 10px; right: 10px; top: auto; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; padding: 14px; border-radius: 22px; }
  .buy-menu a, .buy-menu__copy { min-height: 54px; }
  .case-dialog { width: 100vw; height: min(88dvh, 920px); margin: auto 0 0; border-top: 1px solid var(--line); border-left: 0; border-radius: 22px 22px 0 0; }
  .case-dialog[data-active-file="origin"] { width: 100vw; }
  .case-dialog[open] { animation-name: sheet-in; }
  .case-dialog[data-active-file="origin"][open] { animation-name: sheet-in; animation-duration: .34s; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(32px); } }
  .case-dialog__bar { min-height: 76px; padding: 12px 16px; }
  .case-dialog__body { padding: 18px 16px max(42px, env(safe-area-inset-bottom)); }
  .panel-hero { grid-template-columns: 1fr; }
  .panel-hero img { max-height: min(28dvh, 240px); aspect-ratio: 16 / 8; }
  .origin-facts { grid-template-columns: repeat(2, 1fr); }
  .dossier-grid { grid-template-columns: 1fr; }
  .sightings-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .operation-grid { grid-template-columns: 1fr; }
  .comms-grid a { grid-template-columns: 1fr auto; }
  .comms-grid span { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .rail-link--archive { font-size: 0; }
  .rail-link--archive::after { content: "Archive"; font-size: .7rem; }
  .sightings-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
