@font-face {
  font-family: "Chakra Petch";
  src: url("/assets/fonts/chakra-petch-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: oklch(12.5% 0.009 158);
  --surface: oklch(15.5% 0.011 158);
  --surface-raised: oklch(18.5% 0.012 158);
  --line: oklch(30% 0.017 158);
  --line-strong: oklch(42% 0.024 158);
  --text: oklch(91% 0.019 158);
  --text-dim: oklch(72% 0.024 158);
  --text-faint: oklch(59% 0.024 158);
  --active: oklch(79% 0.17 151);
  --active-ink: oklch(15% 0.03 158);
  --caution: oklch(80% 0.11 83);
  --measure: 76ch;
  --display: "Chakra Petch", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

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

html {
  background: var(--bg);
  scroll-padding-top: 6rem;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.94rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--active);
  color: var(--active-ink);
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}

a:hover {
  text-decoration-color: var(--text);
}

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

.skip-link {
  position: fixed;
  z-index: 30;
  top: 0.75rem;
  left: 0.75rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  translate: 0 -180%;
  background: var(--active);
  color: var(--active-ink);
  font-weight: 700;
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: min(100% - 2rem, 76rem);
  min-height: 4.25rem;
  margin-inline: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-decoration: none;
}

.wordmark::before {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.75rem;
  border: 1px solid var(--line-strong);
  content: "";
}

.primary-nav {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.primary-nav a,
.language-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: 0.8rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--active);
  color: var(--active);
}

.page {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 8vw, 6rem) 4rem;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.eyebrow,
.section-id,
.record-label,
.status-label {
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.eyebrow::before {
  width: 2rem;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.5rem);
  letter-spacing: -0.045em;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

p,
li {
  max-width: var(--measure);
}

.lede {
  max-width: 61ch;
  margin: 1.5rem 0 0;
  color: var(--text-dim);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.8;
}

.status-card,
.notice,
.route-card,
.document-section {
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--surface);
}

.status-card {
  position: sticky;
  top: 6.25rem;
}

.status-card header,
.status-row,
.record-row {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.status-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--active);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-indicator::before {
  width: 0.45rem;
  height: 0.45rem;
  background: currentColor;
  content: "";
}

.status-row:last-child,
.record-row:last-child {
  border-bottom: 0;
}

.status-row {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  color: var(--text-dim);
}

.status-row strong {
  display: block;
  color: var(--text);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-row[data-state="active"] strong,
.status-row[data-state="active"] .status-number {
  color: var(--active);
}

.status-row[data-state="locked"] {
  color: var(--text-faint);
}

.status-number {
  color: var(--text-faint);
  font-family: var(--display);
  font-weight: 700;
}

.notice {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--caution);
  color: var(--text-dim);
}

.notice strong {
  color: var(--caution);
}

.language-nav {
  display: flex;
  gap: 0.25rem;
  margin-top: 2rem;
}

.language-nav a {
  border: 1px solid var(--line);
  background: var(--surface);
}

.language-nav a:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.route-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.route-card {
  display: grid;
  min-height: 12rem;
  padding: 1.2rem;
  color: inherit;
  text-decoration: none;
}

.route-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.route-card .route-id {
  color: var(--text-faint);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.route-card h2 {
  align-self: end;
}

.route-card .route-arrow {
  justify-self: end;
  color: var(--text-dim);
  font-size: 1.5rem;
}

.record {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 3rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.record-row {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.record-row:last-child {
  border-right: 0;
}

.record-value {
  display: block;
  margin-top: 0.25rem;
  color: var(--text);
  font-size: 0.8rem;
}

.document-body {
  margin-top: 4rem;
}

.language-block + .language-block {
  margin-top: 6rem;
  padding-top: 5rem;
  border-top: 1px solid var(--line-strong);
}

.language-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.language-heading span {
  color: var(--text-faint);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-section {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  margin-top: -1px;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.document-section:first-of-type {
  margin-top: 0;
}

.document-section p:first-of-type {
  margin-top: 0;
}

.document-section p:last-child,
.document-section ul:last-child {
  margin-bottom: 0;
}

.document-section ul {
  padding-left: 1.25rem;
}

.document-section li + li {
  margin-top: 0.65rem;
}

.document-section a,
.notice a,
.footer-inner a {
  overflow-wrap: anywhere;
}

.section-id {
  padding-top: 0.25rem;
  color: var(--text-faint);
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 76rem);
  min-height: 5rem;
  margin-inline: auto;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.footer-inner p {
  margin: 0;
}

@media (max-width: 52rem) {
  .site-header {
    position: static;
  }

  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 0.75rem;
  }

  .primary-nav {
    width: 100%;
    overflow-x: auto;
  }

  .primary-nav a {
    flex: 1;
  }

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

  .status-card {
    position: static;
  }

  .route-list,
  .record {
    grid-template-columns: 1fr;
  }

  .record-row {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .record-row:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 34rem) {
  body {
    font-size: 0.88rem;
  }

  .page,
  .header-inner,
  .footer-inner {
    width: min(100% - 1.25rem, 76rem);
  }

  h1 {
    font-size: clamp(2.3rem, 14vw, 3.6rem);
  }

  .document-section {
    grid-template-columns: 1fr;
  }

  .section-id {
    padding-top: 0;
  }

  .language-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

@media print {
  :root {
    color-scheme: light;
    --bg: oklch(100% 0 0);
    --surface: oklch(98% 0.004 158);
    --surface-raised: oklch(96% 0.004 158);
    --line: oklch(82% 0.01 158);
    --line-strong: oklch(60% 0.015 158);
    --text: oklch(18% 0.015 158);
    --text-dim: oklch(35% 0.018 158);
    --text-faint: oklch(45% 0.018 158);
    --active: oklch(48% 0.13 151);
    --active-ink: oklch(100% 0 0);
    --caution: oklch(45% 0.1 83);
  }

  body {
    background: var(--bg);
  }

  .site-header,
  .status-card,
  .language-nav,
  .site-footer {
    display: none;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .document-grid {
    display: block;
  }

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