/* OSMATRAC field notes — a quiet technical companion to the live map. */

:root {
  --bg: #060d0c;
  --surface: #0a1311;
  --surface-raised: #0d1815;
  --line: rgba(150, 184, 172, 0.18);
  --line-strong: rgba(150, 184, 172, 0.32);
  --text: #dde8e3;
  --muted: #93a69f;
  --faint: #64776f;
  --ember: #ff7a3d;
  --ember-soft: #ffa25e;
  --ember-dim: rgba(255, 122, 61, 0.12);
  --amber: #f2a92c;
  --online: #67c9a0;
  --focus: #ffd27a;
  --font-display: "Chakra Petch", "IBM Plex Sans", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 82% 4%, rgba(255, 122, 61, 0.1), transparent 28rem),
    linear-gradient(rgba(150, 184, 172, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 184, 172, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 48px 48px, 48px 48px, auto;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(6, 13, 12, 0) 0%, rgba(6, 13, 12, 0.78) 60%, var(--bg) 100%);
  content: "";
  pointer-events: none;
}

a {
  color: var(--ember-soft);
  text-decoration-color: rgba(255, 162, 94, 0.46);
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: #ffc18f;
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 9px 12px;
  transform: translateY(-150%);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 13, 12, 0.88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 34px;
  height: 34px;
}

.brand-name,
.brand-note {
  display: block;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-note {
  margin-top: -2px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a {
  padding: 9px 11px;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: var(--line);
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  border-color: rgba(255, 122, 61, 0.35);
  background: var(--ember-dim);
  color: var(--ember-soft);
}

.language-links {
  display: inline-flex;
  margin-left: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.language-links a {
  min-width: 40px;
  padding-inline: 10px;
  text-align: center;
  text-transform: lowercase;
}

.language-links a + a {
  border-left: 1px solid var(--line);
}

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 500px;
  padding: 98px 0 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  align-items: end;
  gap: 70px;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 34%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ember));
  content: "";
}

.eyebrow,
.section-code,
.toc-title,
.reviewed-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--ember-soft);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 7.5vw, 92px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.92;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 680px;
  margin: 28px 0 0;
  color: #b9c8c2;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
}

.hero-facts {
  margin: 0;
  border-top: 1px solid var(--line-strong);
}

.hero-facts div {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.hero-facts dt,
.hero-facts dd {
  margin: 0;
}

.hero-facts dt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-facts dd {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.hero-facts dd[data-state="online"] {
  color: var(--online);
}

.hero-facts dd[data-state="attention"] {
  color: var(--amber);
}

.hero-facts dd[data-state="unavailable"] {
  color: var(--faint);
}

.document-grid {
  padding: 72px 0 96px;
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  justify-content: space-between;
  gap: 80px;
}

.table-of-contents {
  position: sticky;
  top: 112px;
  align-self: start;
}

.toc-title {
  margin: 0 0 18px;
  color: var(--faint);
}

.table-of-contents ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.table-of-contents li {
  counter-increment: toc;
  border-top: 1px solid var(--line);
}

.table-of-contents li:last-child {
  border-bottom: 1px solid var(--line);
}

.table-of-contents a {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 27px 1fr;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.table-of-contents a::before {
  color: var(--faint);
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
}

.table-of-contents a:hover,
.table-of-contents a:focus-visible {
  color: var(--ember-soft);
}

.document {
  min-width: 0;
}

.answer-section {
  padding: 0 0 64px;
  scroll-margin-top: 112px;
}

.answer-section + .answer-section {
  padding-top: 64px;
  border-top: 1px solid var(--line);
}

.section-code {
  margin: 0 0 12px;
  color: var(--ember-soft);
}

.answer-section h2 {
  max-width: 720px;
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(31px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.answer-section h3 {
  margin: 40px 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.answer-section p {
  margin: 0 0 20px;
  color: #b9c8c2;
}

.answer-section p:last-child {
  margin-bottom: 0;
}

.answer-lead {
  padding-left: 22px;
  border-left: 2px solid var(--ember);
  color: var(--text) !important;
  font-size: 21px;
  line-height: 1.55;
}

.sensor-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sensor-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(13, 24, 21, 0.88), rgba(8, 17, 15, 0.72));
}

.sensor-card .sensor-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.sensor-card .resolution {
  color: var(--ember-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}

.sensor-card p {
  margin: 10px 0 0;
  font-size: 15px;
}

.caveat-list {
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  list-style: none;
}

.caveat-list li {
  position: relative;
  padding: 22px 22px 22px 46px;
  background: var(--surface);
  color: #b9c8c2;
}

.caveat-list li::before {
  position: absolute;
  top: 27px;
  left: 22px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  content: "";
}

.emergency-panel {
  position: relative;
  margin-top: 28px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 122, 61, 0.42);
  background: linear-gradient(120deg, rgba(255, 122, 61, 0.14), rgba(10, 19, 17, 0.9) 62%);
}

.emergency-panel::after {
  position: absolute;
  right: -32px;
  bottom: -64px;
  color: rgba(255, 122, 61, 0.08);
  content: "193";
  font-family: var(--font-display);
  font-size: 150px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.emergency-panel strong,
.emergency-panel p,
.emergency-panel a {
  position: relative;
  z-index: 1;
}

.emergency-panel strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ember-soft);
  font-family: var(--font-display);
  font-size: 23px;
  text-transform: uppercase;
}

.emergency-panel p {
  max-width: 580px;
  margin: 0;
  color: var(--text);
}

.reference-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.reference-list li {
  padding: 15px 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.reference-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.reference-number {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.reference-list a {
  font-size: 15px;
  line-height: 1.45;
}

.reviewed {
  margin-top: 40px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  background: rgba(13, 24, 21, 0.7);
}

.reviewed-label {
  color: var(--faint);
}

.reviewed time {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.return-to-map {
  padding: 0 0 96px;
}

.map-cta {
  min-height: 126px;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 90% 50%, rgba(255, 122, 61, 0.17), transparent 21rem),
    var(--surface-raised);
  color: var(--text);
  text-decoration: none;
}

.map-cta span:first-child {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 600;
}

.map-cta span:last-child {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 122, 61, 0.45);
  border-radius: 50%;
  color: var(--ember-soft);
  font-family: var(--font-mono);
  transition: transform 160ms ease, background 160ms ease;
}

.map-cta:hover span:last-child {
  transform: translateX(-4px);
  background: var(--ember-dim);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: var(--faint);
  font-size: 12px;
}

.footer-inner p {
  max-width: 700px;
  margin: 0;
}

.footer-inner a {
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 54px;
  }

  .hero-facts {
    max-width: 620px;
  }

  .document-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .table-of-contents {
    position: static;
  }

  .table-of-contents ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 82px;
  }

  body {
    font-size: 16px;
  }

  .header-inner,
  main,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

  .header-inner {
    min-height: 68px;
    gap: 12px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-note {
    display: none;
  }

  .site-nav {
    gap: 2px;
    font-size: 10px;
  }

  .site-nav > a {
    padding-inline: 7px;
  }

  .language-links {
    margin-left: 2px;
  }

  .language-links a {
    min-width: 34px;
    padding: 8px;
  }

  .hero {
    padding: 68px 0 54px;
    gap: 42px;
  }

  .hero h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .hero-lead {
    margin-top: 22px;
    font-size: 18px;
  }

  .document-grid {
    padding: 54px 0 72px;
  }

  .table-of-contents ol {
    grid-template-columns: 1fr;
  }

  .answer-section {
    padding-bottom: 48px;
  }

  .answer-section + .answer-section {
    padding-top: 48px;
  }

  .answer-section h2 {
    font-size: 32px;
  }

  .answer-lead {
    padding-left: 16px;
    font-size: 19px;
  }

  .sensor-grid,
  .caveat-list {
    grid-template-columns: 1fr;
  }

  .emergency-panel {
    padding: 24px;
  }

  .reviewed,
  .footer-inner {
    flex-direction: column;
  }

  .map-cta {
    min-height: 110px;
    padding: 24px;
  }

  .map-cta span:first-child {
    font-size: 24px;
  }

  .return-to-map {
    padding-bottom: 72px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  body::before,
  .site-header,
  .table-of-contents,
  .return-to-map {
    display: none;
  }

  main,
  .footer-inner {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding: 24px 0;
  }

  .hero h1,
  .answer-section h2,
  .answer-section h3,
  .answer-section p,
  .hero-lead,
  .footer-inner {
    color: #111;
  }

  .document-grid {
    display: block;
    padding: 24px 0;
  }

  .answer-section {
    break-inside: avoid;
  }
}
