:root {
  --ink: #0a1020;
  --ink-soft: #202b41;
  --blue: #2347ff;
  --blue-dark: #132fc7;
  --acid: #d7ff43;
  --coral: #ff6248;
  --sky: #dceaff;
  --paper: #f7f8f3;
  --white: #ffffff;
  --muted: #59657a;
  --line: #0a1020;
  --soft-line: rgba(10, 16, 32, 0.2);
  --max: 1220px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 4px solid var(--coral);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

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

.top-note {
  padding: 0.38rem 1rem;
  color: white;
  background: var(--blue);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 2px solid var(--line);
  background: rgba(247, 248, 243, 0.97);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.8fr);
  align-items: center;
  gap: 1.5rem;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 78px;
  margin: 0 auto;
}

.brand {
  display: inline-grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--acid);
  font-family: "Courier New", monospace;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
}

.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 0.96rem; }
.brand-copy small { margin-top: 0.3rem; color: var(--muted); font-family: "Courier New", monospace; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

.menu-button {
  display: none;
  justify-self: end;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--acid);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.site-nav a {
  padding: 0.48rem 0.58rem;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { border-color: var(--blue); color: var(--blue-dark); }
.site-nav .nav-cta { margin-left: 0.3rem; border: 2px solid var(--ink); color: white; background: var(--ink); }
.site-nav .nav-cta:hover,
.site-nav .nav-cta[aria-current="page"] { border-color: var(--ink); color: var(--ink); background: var(--acid); }

main { overflow: hidden; }

.hero,
.page-hero,
.section,
.decision-banner {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  min-height: 680px;
  border-inline: 2px solid var(--ink);
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: clamp(3rem, 6vw, 6rem);
  background:
    linear-gradient(90deg, rgba(35, 71, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(35, 71, 255, 0.08) 1px, transparent 1px),
    var(--white);
  background-size: 24px 24px;
}

.system-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto repeat(2, 1fr);
  border-left: 2px solid var(--ink);
  background: var(--ink);
  gap: 2px;
}

.system-map > div {
  display: grid;
  align-content: space-between;
  gap: 1.5rem;
  min-height: 170px;
  padding: 1.3rem;
  color: white;
  background: var(--blue);
}

.system-map .map-title { grid-column: 1 / -1; min-height: auto; color: var(--ink); background: var(--acid); }
.system-map .map-warn { color: var(--ink); background: var(--coral); }
.system-map .map-light { color: var(--ink); background: var(--sky); }
.system-map code { font-family: "Courier New", monospace; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em; }
.system-map b { max-width: 15ch; font-size: 1.25rem; line-height: 1.12; }
.system-map span { font-size: 0.82rem; }

.eyebrow,
.route-code,
.tag {
  margin: 0 0 1rem;
  color: var(--blue-dark);
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

h1 { max-width: 14ch; margin-bottom: 1.4rem; font-size: clamp(3rem, 7.5vw, 6.5rem); }
h2 { margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 3.6rem); }
h3 { margin-bottom: 0.65rem; font-size: clamp(1.2rem, 2vw, 1.65rem); }
p { margin-top: 0; }

.lede { max-width: 63ch; color: var(--ink-soft); font-size: clamp(1.08rem, 2vw, 1.3rem); }
.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

.button,
.button-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--ink);
}

.button { color: white; background: var(--blue); }
.button-alt { color: var(--ink); background: var(--acid); }
.button:hover,
.button-alt:hover { color: white; background: var(--ink); }

.page-hero {
  position: relative;
  min-height: 460px;
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
  border-inline: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--white);
}

.page-hero::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 30%;
  height: 100%;
  border-left: 2px solid var(--ink);
  background:
    linear-gradient(135deg, transparent 48%, var(--ink) 49%, var(--ink) 51%, transparent 52%) 0 0 / 34px 34px,
    var(--acid);
  content: "";
  opacity: 0.85;
}

.page-hero h1,
.page-hero .lede,
.page-hero .route-code { position: relative; z-index: 1; }
.page-hero h1 { max-width: 13ch; }
.page-hero .lede { max-width: 58%; }

.section { padding-block: clamp(4rem, 7vw, 7rem); }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.8rem;
}

.section-heading > p { color: var(--ink-soft); font-size: 1.05rem; }

.matrix,
.route-grid,
.source-grid,
.process-grid,
.brief-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.matrix-card,
.route-card,
.source-card,
.process-card,
.brief-card {
  position: relative;
  grid-column: span 4;
  padding: 1.35rem;
  border: 2px solid var(--ink);
  background: var(--white);
}

.matrix-card:nth-child(1),
.matrix-card:nth-child(5),
.route-card:nth-child(1),
.route-card:nth-child(5) { grid-column: span 5; }
.matrix-card:nth-child(2),
.matrix-card:nth-child(6),
.route-card:nth-child(2),
.route-card:nth-child(6) { grid-column: span 3; }

.matrix-card::before,
.route-card::before,
.source-card::before,
.process-card::before,
.brief-card::before {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--acid);
  content: "";
}

.matrix-card:nth-child(even)::before,
.route-card:nth-child(even)::before { background: var(--coral); }

.card-code {
  display: block;
  margin-bottom: 2.2rem;
  color: var(--blue-dark);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.matrix-card p,
.route-card p,
.source-card p,
.process-card p,
.brief-card p { color: var(--muted); }

.route-card a,
.source-card a,
.inline-link { color: var(--blue-dark); font-weight: 900; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.blue-band {
  width: 100%;
  max-width: none;
  padding-inline: max(1rem, calc((100% - var(--max)) / 2));
  color: white;
  background: var(--blue);
}

.blue-band .section-heading > p,
.blue-band .process-card p { color: #e1e7ff; }
.blue-band .eyebrow { color: var(--acid); }
.blue-band .process-card { border-color: white; background: rgba(10, 16, 32, 0.22); }
.blue-band .process-card::before { border-color: white; background: var(--acid); }

.decision-list,
.boundary-list,
.plain-list {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.decision-list li,
.boundary-list li,
.plain-list li {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--ink);
}

.decision-list strong,
.boundary-list strong,
.plain-list strong { font-size: 1.05rem; }

.note {
  margin-top: 2rem;
  padding: 1.2rem;
  border: 2px solid var(--ink);
  background: var(--sky);
  box-shadow: 7px 7px 0 var(--ink);
}

.decision-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 2rem;
  align-items: center;
  margin-block: clamp(3rem, 7vw, 7rem);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 2px solid var(--ink);
  background: var(--acid);
  box-shadow: 10px 10px 0 var(--ink);
}

.decision-banner h2 { max-width: 16ch; }
.contact-stack { display: grid; gap: 0.7rem; }
.contact-stack a { color: var(--blue-dark); font-weight: 900; overflow-wrap: anywhere; }
.contact-stack small { color: var(--ink-soft); }

.source-card { grid-column: span 4; padding-top: 3.5rem; }
.source-card .tag { position: absolute; top: 1rem; left: 1.35rem; margin: 0; }
.source-card small { display: block; margin-top: 1rem; color: var(--muted); }

.brief-card { grid-column: span 6; counter-increment: brief; }
.brief-grid { counter-reset: brief; }
.brief-card::after {
  display: block;
  margin-top: 1.5rem;
  color: var(--blue-dark);
  font-family: "Courier New", monospace;
  font-weight: 900;
  content: "BESLISPUNT " counter(brief, decimal-leading-zero);
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 2rem;
  padding: 3.5rem max(1rem, calc((100% - var(--max)) / 2));
  border-top: 8px solid var(--acid);
  color: white;
  background: var(--ink);
}

.site-footer h2 { margin-bottom: 0.6rem; font-size: 1.65rem; }
.site-footer p,
.site-footer small { color: #c9d1df; }
.site-footer nav { display: grid; align-content: start; gap: 0.55rem; }
.site-footer nav a { width: fit-content; color: white; }
.site-footer small { grid-column: 1 / -1; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.25); }

.error-page { display: grid; place-items: center; min-height: 72vh; padding: 2rem; text-align: center; background: var(--acid); }
.error-page h1 { margin-inline: auto; }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .js .menu-button { display: block; }
  .site-nav { grid-column: 1 / -1; display: grid; justify-content: stretch; padding-bottom: 1rem; }
  .js .site-nav[data-open="false"] { display: none; }
  .site-nav .nav-cta { margin-left: 0; }
  .hero { grid-template-columns: 1fr; }
  .system-map { border-top: 2px solid var(--ink); border-left: 0; }
  .page-hero .lede { max-width: 66%; }
}

@media (max-width: 760px) {
  .section-heading,
  .decision-banner { grid-template-columns: 1fr; }
  .matrix-card,
  .matrix-card:nth-child(1),
  .matrix-card:nth-child(2),
  .matrix-card:nth-child(5),
  .matrix-card:nth-child(6),
  .route-card,
  .route-card:nth-child(1),
  .route-card:nth-child(2),
  .route-card:nth-child(5),
  .route-card:nth-child(6),
  .source-card,
  .process-card,
  .brief-card { grid-column: span 12; }
  .decision-list li,
  .boundary-list li,
  .plain-list li { grid-template-columns: 1fr; gap: 0.35rem; }
  .page-hero::after { width: 21%; opacity: 0.42; }
  .page-hero .lede { max-width: 80%; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer small { grid-column: auto; }
}

@media (max-width: 520px) {
  .system-map { grid-template-columns: 1fr; }
  .system-map .map-title { grid-column: auto; }
  .page-hero::after { display: none; }
  .page-hero .lede { max-width: 100%; }
  h1 { font-size: clamp(2.75rem, 16vw, 4.3rem); }
}

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

