:root {
  color-scheme: light dark;

  --background: light-dark(#e2dfd2, #0e1411);
  --surface: light-dark(#f0eee5, #151d19);
  --surface-hover: light-dark(#d5d1c1, #1f2a25);
  --border: light-dark(#7b7e73, #5a6d63);
  --rule: light-dark(#bfbcad, #2c3a33);
  --accent: light-dark(#7a5610, #d6ab55);
  --signal: light-dark(#a5331f, #e4614a);
  --text: light-dark(#121a16, #e8e3d5);
  --text-dim: light-dark(#4e594f, #9ca79e);
  --sea: light-dark(#dcd8c8, #101a16);

  --font-label:
    "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-text: "Newsreader", Charter, "Iowan Old Style", Georgia, serif;

  --gutter: clamp(0.75rem, 0.5rem + 1vw, 1rem);
}

[data-theme="light"] {
  color-scheme: only light;
}

[data-theme="dark"] {
  color-scheme: only dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-text);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.6;
  text-transform: lowercase;
}

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

.container {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden,
.world-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--background);
  font-family: var(--font-label);
  font-size: 0.75rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem;
  left: var(--gutter);
}

.masthead {
  padding: 1.75rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.masthead .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.identity {
  font-family: var(--font-label);
}

.identity h1 {
  margin: 0;
  font-size: 1.25rem;
  font-stretch: 78%;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.identity p {
  margin: 0.3rem 0 0;
  color: var(--text-dim);
  font-size: 0.6875rem;
  font-stretch: 82%;
  letter-spacing: 0.05em;
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 82%;
  letter-spacing: 0.04em;
}

.lamp {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent);
}

.lamp.live {
  border-color: var(--signal);
  background: var(--signal);
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.3;
  }
}

.theme-button {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 1px;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 82%;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  cursor: pointer;
}

.theme-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.map {
  margin: 2rem 0 0;
  padding: 0;
}

.map svg {
  display: block;
  width: 100%;
  height: auto;
}

.caption {
  margin: 0.25rem 0 0;
  min-height: 1.4em;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 82%;
  letter-spacing: 0.04em;
}

.caption strong {
  color: var(--text);
  font-weight: 600;
}

.ring {
  fill: none;
  stroke: var(--rule);
}

.cord {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.cord.active {
  stroke: var(--accent);
  stroke-width: 2;
}

.jack-hit {
  fill: transparent;
}

.jack-ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
}

.jack-hole {
  fill: var(--text-dim);
}

.node {
  cursor: pointer;
}

.node:hover .jack-ring,
.node.active .jack-ring {
  stroke: var(--accent);
}

.node:hover .jack-hole,
.node.active .jack-hole {
  fill: var(--accent);
}

.center {
  fill: var(--signal);
}

.center-ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
}

.map-label,
.compass {
  fill: var(--text-dim);
  font-family: var(--font-label);
  font-size: 9px;
  font-stretch: 78%;
  letter-spacing: 0.06em;
}

.compass {
  fill: var(--border);
}

.section-title {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin: 2.5rem 0 0.5rem;
}

.section-title h2 {
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.6875rem;
  font-stretch: 80%;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.section-title span {
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 82%;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.filters button {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 1px;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 82%;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
}

.filters button:hover {
  color: var(--text);
}

.filters button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.world-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-stretch: 85%;
}

.world-table thead th {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.5625rem;
  font-stretch: 78%;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: lowercase;
}

.world-table .latency {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.world-table tbody tr {
  border-bottom: 1px solid var(--rule);
}

.world-table tbody tr:hover,
.world-table tbody tr.active,
.world-table tbody tr[aria-current="true"] {
  background: var(--surface-hover);
}

.world-table tbody th {
  padding: 0.7rem 0.75rem;
  border-left: 3px solid transparent;
  color: var(--text-dim);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.world-table tbody td {
  padding: 0.7rem 0.75rem;
  color: var(--text-dim);
}

.world-table tbody td.location {
  padding: 0;
}

.world-table tbody a {
  display: block;
  padding: 0.7rem 0.75rem;
  color: var(--text);
  text-decoration: none;
}

.world-table tbody a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.world-table tbody tr[aria-current="true"] th {
  border-left-color: var(--accent);
  color: var(--accent);
}

.world-table tbody tr[aria-current="true"] a {
  color: var(--accent);
}

.panel {
  margin: 1.5rem 0 3rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  background: var(--surface);
}

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

.panel .meta {
  margin: 0 0 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 80%;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.panel h2 {
  margin: 0 0 0.9rem;
  font-family: var(--font-label);
  font-size: 0.9375rem;
  font-stretch: 80%;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel p {
  max-width: 62ch;
  margin: 0 0 0.85rem;
  font-size: 1.0625rem;
}

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

.panel a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.panel .note {
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.6875rem;
  font-stretch: 82%;
}

.panel .filter-note {
  margin-top: 0.9rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--rule);
}

.details {
  margin: 0;
  font-size: 0.9375rem;
}

.details div {
  display: flex;
  gap: 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.details dt {
  flex: none;
  min-width: 9rem;
  max-width: 9rem;
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 80%;
  letter-spacing: 0.05em;
  line-height: 1.9;
  text-transform: lowercase;
}

.details dd {
  margin: 0;
}

.details dd p {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
}

.details .stack {
  margin: 0.3rem 0 0;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.5625rem;
  font-stretch: 80%;
  letter-spacing: 0.09em;
  text-transform: lowercase;
}

.subhead {
  margin: 1.75rem 0 0.5rem;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.5625rem;
  font-stretch: 80%;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.details strong {
  font-family: var(--font-label);
  font-size: 0.8125rem;
  font-stretch: 82%;
  font-weight: 600;
}

.connecting::after {
  content: "";
  animation: ellipsis 1.2s steps(4, end) infinite;
}

@keyframes ellipsis {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

.sections {
  padding: 1.25rem 0 3rem;
  border-top: 1px solid var(--rule);
}

.sections ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sections a {
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.6875rem;
  font-stretch: 80%;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: lowercase;
}

.sections a:hover,
.sections a[aria-current="page"] {
  color: var(--accent);
}

@media (max-width: 32rem) {
  .map-label,
  .compass {
    display: none;
  }

  .map {
    margin-top: 1.5rem;
  }

  .details div {
    flex-direction: column;
    gap: 0.15rem;
  }

  .details dt {
    max-width: none;
    line-height: 1.6;
  }
}

@media (max-width: 34rem) {
  .world-table .region {
    display: none;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .panel {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition: none !important;
  }
}

#globe {
  cursor: grab;
  touch-action: none;
}

#globe:active {
  cursor: grabbing;
}

.globe-sea {
  fill: var(--sea);
}

.globe-limb {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.25;
}

.graticule {
  fill: none;
  stroke: var(--rule);
  stroke-width: 0.75;
}

.graticule.far {
  stroke-dasharray: 2 3;
  opacity: 0.32;
}

.cord.far {
  stroke: var(--rule);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.3;
}

.cord.far.active {
  stroke: var(--accent);
  opacity: 0.55;
}

.port .jack-ring,
.port .jack-hole {
  transition: none;
}

.rose {
  pointer-events: none;
}

.sea-label {
  fill: var(--text-dim);
  font-family: var(--font-text);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.09em;
  opacity: 0.75;
  pointer-events: none;
}

.view-toggle {
  display: flex;
  gap: -1px;
}

.view-toggle button {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 1px;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-stretch: 82%;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  cursor: pointer;
}

.view-toggle button + button {
  margin-left: -1px;
}

.view-toggle button:hover {
  color: var(--text);
}

.view-toggle button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.board-intro {
  max-width: 62ch;
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.world-parent {
  color: var(--text-dim);
}

.world-table tbody a:hover .world-parent,
.world-table tbody tr[aria-current="true"] .world-parent {
  color: inherit;
}

@media (max-width: 34rem) {
  .view-toggle {
    order: 2;
  }

  .world-parent {
    display: none;
  }
}
