:root {
  --ink: #080808;
  --paper: #f7f7f2;
  --panel: #ffffff;
  --cyan: #00b7ff;
  --yellow: #ffd400;
  --red: #ff3d2e;
  --green: #18c58f;
  --violet: #7c4dff;
  --muted: #5f6368;
  --line: #1f1f1f;
  --soft: #e8e6dc;
  --shadow: 6px 6px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
}

img,
iframe {
  max-width: 100%;
}

iframe {
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 50;
  transform: translateY(-140%);
  padding: 8px 10px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  font-weight: 900;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 32px;
  border-bottom: 3px solid var(--ink);
  background: rgba(247, 247, 242, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 1rem;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.primary-nav a {
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 190px;
  border: 3px solid var(--ink);
  background: var(--ink);
  gap: 3px;
}

.mode-switch.inline {
  min-width: 220px;
}

.mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.mode-option.is-active {
  background: var(--yellow);
}

.kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.15;
  text-transform: uppercase;
}

.glitch {
  position: relative;
  letter-spacing: 0;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.glitch::before {
  color: var(--cyan);
  transform: translate(2px, -1px);
}

.glitch::after {
  color: var(--red);
  transform: translate(-2px, 1px);
}

.glitch:hover::before,
.glitch:hover::after,
.project-hero:hover .glitch::before,
.project-hero:hover .glitch::after,
.home-hero:hover .glitch::before,
.home-hero:hover .glitch::after {
  opacity: 0.42;
}

.home-hero,
.project-hero,
.utility-hero {
  border-bottom: 4px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 212, 0, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(0, 183, 255, 0.24), transparent 60%),
    var(--paper);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 34px;
  padding: 72px 52px 36px;
}

.home-hero h1,
.project-hero h1,
.utility-hero h1 {
  margin: 18px 0 18px;
  max-width: 1100px;
  font-size: 5.4rem;
  line-height: 0.88;
  font-weight: 950;
  text-transform: uppercase;
}

.project-hero h1 {
  font-size: 4.8rem;
}

.utility-hero h1 {
  font-size: 4.2rem;
}

.dek {
  max-width: 840px;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.home-dashboard {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 4px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.home-dashboard div {
  min-height: 124px;
  padding: 16px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.home-dashboard div:nth-child(2n) {
  border-right: 0;
}

.home-dashboard div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.home-dashboard strong {
  display: block;
  font-size: 3rem;
  line-height: 1;
  font-weight: 950;
}

.home-dashboard span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.atlas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 52px;
  border-bottom: 3px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.atlas-toolbar p {
  margin: 0;
  max-width: 700px;
  font-size: 0.95rem;
  font-weight: 850;
}

.atlas-toolbar .mode-switch {
  flex: 0 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 34px 52px 58px;
}

.card-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 374px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-card:nth-child(4n + 2) .kicker {
  background: var(--cyan);
}

.project-card:nth-child(4n + 3) .kicker {
  background: var(--green);
}

.project-card:nth-child(4n + 4) .kicker {
  background: var(--red);
  color: white;
}

.project-card h2 {
  margin: 18px 0 10px;
  font-size: 1.75rem;
  line-height: 0.98;
  font-weight: 950;
  text-transform: uppercase;
}

.project-card h2 a {
  text-decoration: none;
}

.project-card p {
  margin: 0 0 18px;
  font-weight: 750;
}

.project-card dl {
  display: grid;
  gap: 8px;
  margin: auto 0 16px;
}

.project-card dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft);
}

.project-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.project-card dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 850;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-actions a,
.command-link,
.source-card a,
.media-card a,
.source-note a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.card-actions a:nth-child(2),
.command-link.secondary {
  background: var(--red);
  color: white;
}

.ticker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 3px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.ticker span {
  min-width: 0;
  padding: 10px 16px;
  border-right: 1px solid #444;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ticker span:last-child {
  border-right: 0;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 36px;
  padding: 56px 52px 42px;
}

.hero-copy {
  min-width: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.signal-panel {
  align-self: start;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}

.signal-topline {
  padding: 11px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.route-art {
  position: relative;
  height: 242px;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.08) 1px, transparent 1px, transparent 18px),
    repeating-linear-gradient(90deg, rgba(8, 8, 8, 0.06), rgba(8, 8, 8, 0.06) 1px, transparent 1px, transparent 24px),
    #eaf8ff;
}

.sea-band {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 42%;
  height: 36%;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: linear-gradient(90deg, rgba(0, 183, 255, 0.44), rgba(24, 197, 143, 0.34), rgba(124, 77, 255, 0.28));
}

.route-line {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 56%;
  z-index: 3;
  height: 10px;
  border: 3px solid var(--ink);
  background: var(--red);
  transform: rotate(-6deg);
  transform-origin: center;
}

.route-node {
  position: absolute;
  z-index: 4;
  width: 30px;
  height: 30px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.route-node-a {
  left: 11%;
  top: 50%;
}

.route-node-b {
  right: 11%;
  top: 40%;
  background: var(--cyan);
}

.scanline {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0, rgba(8, 8, 8, 0.10) 50%, transparent 100%);
  opacity: 0.38;
  animation: scan 5s linear infinite;
}

.signal-panel p {
  margin: 0;
  padding: 14px;
  border-top: 3px solid var(--ink);
  font-weight: 850;
}

.metric-stack {
  margin: 0;
  border-top: 3px solid var(--ink);
}

.metric-stack div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--soft);
}

.metric-stack div:last-child {
  border-bottom: 0;
}

.metric-stack dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.metric-stack dd {
  margin: 0;
  text-align: right;
  font-size: 0.88rem;
  font-weight: 900;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 42px;
  padding: 46px 52px 58px;
}

.story-body {
  max-width: 920px;
}

.story-body h1 {
  display: none;
}

.story-body h2,
.section-heading h2,
.source-card h2,
.media-card h2,
.media-card h3,
.prose-band h2,
.source-row h2 {
  margin: 0 0 14px;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
}

.story-body h2 {
  display: inline-flex;
  margin-top: 22px;
  padding: 5px 8px;
  border: 3px solid var(--ink);
  background: var(--cyan);
  font-size: 0.78rem;
}

.story-body p {
  max-width: 850px;
  margin: 0 0 18px;
  font-size: 1.1rem;
  font-weight: 680;
}

.story-body ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
}

.story-body li {
  min-height: 118px;
  padding: 15px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 780;
}

.source-card {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.source-card p {
  margin: 0 0 14px;
  font-weight: 780;
}

.source-card ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
}

.source-card li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.is-verified {
  color: #08704f;
}

.is-corrected {
  color: #6a3cff;
}

.is-pending {
  color: #a82d23;
}

.media-section,
.related-section,
.fact-checks {
  padding: 48px 52px 58px;
  border-top: 4px solid var(--ink);
}

.media-section {
  background:
    linear-gradient(90deg, rgba(255, 61, 46, 0.16), transparent 28%),
    var(--soft);
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading p {
  max-width: 780px;
  margin: 0;
  font-weight: 780;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.fact-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.fact-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.08;
  font-weight: 950;
  text-transform: uppercase;
}

.fact-card p {
  margin: 0 0 16px;
  font-weight: 760;
}

.fact-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: auto;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  background: var(--cyan);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.is-global .media-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 330px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.media-card iframe,
.audio-fallback {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 3px solid var(--ink);
  background: var(--ink);
}

.audio-fallback {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--paper);
  text-align: center;
}

.audio-fallback p {
  margin: 0;
  font-weight: 900;
}

.media-card a {
  margin-top: auto;
}

.media-card.is-pending {
  background:
    repeating-linear-gradient(135deg, rgba(8, 8, 8, 0.05), rgba(8, 8, 8, 0.05) 10px, transparent 10px, transparent 20px),
    var(--panel);
}

.source-note {
  margin-top: 20px;
}

.utility-hero {
  padding: 62px 52px 42px;
}

.utility-hero p {
  max-width: 860px;
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
}

.prose-band {
  max-width: 920px;
  padding: 46px 52px 70px;
}

.prose-band p {
  margin: 0 0 24px;
  font-size: 1.12rem;
  font-weight: 700;
}

.source-list {
  display: grid;
  gap: 18px;
  padding: 34px 52px 64px;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.source-row p {
  margin: 0;
  font-weight: 780;
}

.source-row ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.source-row li {
  display: grid;
  grid-template-columns: 90px 90px 70px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid var(--soft);
  font-size: 0.82rem;
  font-weight: 850;
}

.source-row li span,
.source-row li b {
  text-transform: uppercase;
}

.source-row li a {
  font-weight: 950;
}

.source-row li em {
  min-width: 0;
  color: var(--muted);
  font-style: normal;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 26px 52px;
  background: var(--ink);
  color: var(--paper);
}

.site-footer p {
  max-width: 920px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: start;
  justify-content: flex-end;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--paper);
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@media (max-width: 1100px) {
  .card-grid,
  .card-grid.compact,
  .fact-grid,
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-layout,
  .project-hero,
  .home-hero,
  .source-row {
    grid-template-columns: 1fr;
  }

  .source-card {
    position: static;
  }

  .project-hero h1,
  .home-hero h1 {
    font-size: 4rem;
  }
}

@media (max-width: 760px) {
  .site-topbar {
    grid-template-columns: 1fr;
    padding: 12px 18px;
  }

  .primary-nav {
    justify-content: flex-start;
  }

  .mode-switch,
  .mode-switch.inline {
    width: 100%;
    min-width: 0;
  }

  .home-hero,
  .project-hero,
  .utility-hero,
  .story-layout,
  .media-section,
  .related-section,
  .prose-band,
  .source-list,
  .card-grid,
  .atlas-toolbar,
  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-hero h1,
  .project-hero h1,
  .utility-hero h1 {
    font-size: 2.8rem;
    line-height: 0.92;
  }

  .dek,
  .utility-hero p {
    font-size: 1.08rem;
  }

  .home-dashboard,
  .ticker,
  .story-body ul,
  .card-grid,
  .card-grid.compact,
  .fact-grid,
  .media-grid,
  .is-global .media-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .home-dashboard div,
  .home-dashboard div:nth-child(2n),
  .home-dashboard div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 3px solid var(--ink);
  }

  .home-dashboard div:last-child {
    border-bottom: 0;
  }

  .atlas-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .project-card,
  .media-card {
    min-height: auto;
  }

  .story-body li {
    min-height: auto;
  }

  .source-row li {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scanline {
    animation: none;
  }

  .glitch::before,
  .glitch::after {
    display: none;
  }
}
