@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/schibsted-600.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/schibsted-700.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-700.woff2") format("woff2");
}
@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/fragment-400.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #e6eef3;
  --sheet: #f3f7fa;
  --ink: #14202a;
  --muted: #2c4252;
  --line: #b7c8d4;
  --rule: #14202a;
  --hazard: #9d2436;
  --focus: #9d2436;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #10181e;
    --sheet: #172229;
    --ink: #e7f0f5;
    --muted: #c5d5df;
    --line: #31424d;
    --rule: #e7f0f5;
    --hazard: #ff8d9a;
    --focus: #ff8d9a;
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: 2rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

::selection {
  background: var(--hazard);
  color: var(--sheet);
}

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

* {
  scrollbar-color: var(--line) transparent;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--sheet);
  padding: 0.5rem 0.75rem;
  z-index: 2;
}
.skip:focus { transform: none; }

.sheet {
  display: grid;
  grid-template-columns: 15rem minmax(0, 52rem);
  column-gap: var(--s8);
  max-width: 78rem;
  margin: 0 auto;
  padding: var(--s9) var(--s7) 8rem;
}

.rail {
  position: sticky;
  top: var(--s6);
  align-self: start;
  max-height: calc(100dvh - var(--s7));
  overflow: auto;
  padding-top: var(--s2);
}

.rail p {
  margin: 0 0 var(--s5);
  font-size: 1rem;
  color: var(--muted);
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: var(--s2) 0 var(--s2) var(--s4);
  border-left: 2px solid var(--rule);
}

.rail a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.35;
  padding: 0.55rem 0 0.55rem var(--s4);
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .rail a:hover { color: var(--ink); }
}

.rail a:active { transform: scale(0.98); }

.rail a[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
}

main h1,
main h2,
main h3 {
  font-family: "Schibsted Grotesk", "Avenir Next", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: clamp(3rem, 5.5vw, 4.5rem);
  max-width: 14ch;
  line-height: 1.05;
}

.dateline {
  margin: var(--s5) 0 0;
  color: var(--muted);
  max-width: 42rem;
}

.soundings {
  list-style: none;
  margin: var(--s8) 0 0;
  padding: 0;
  border-left: 0;
}

.soundings li {
  display: grid;
  grid-template-columns: 0.7rem 9.5rem minmax(0, 1fr);
  column-gap: var(--s5);
  align-items: center;
  padding: var(--s4) 0;
}

.soundings li::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  background: var(--hazard);
  justify-self: center;
}

.soundings b {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-weight: 400;
  font-size: 2.15rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.soundings span { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .soundings li {
    animation: rise 420ms var(--ease) both;
  }
  .soundings li:nth-child(2) { animation-delay: 50ms; }
  .soundings li:nth-child(3) { animation-delay: 100ms; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

main > section {
  margin-top: var(--s9);
}

h2 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: var(--s5);
}

h3 {
  font-size: 1.35rem;
  margin-top: var(--s7);
  margin-bottom: var(--s3);
}

p { margin: 0 0 var(--s4); max-width: 65ch; }

a { color: var(--hazard); }
a:hover { text-decoration-thickness: 2px; }

.note {
  color: var(--muted);
  font-size: 1rem;
  margin-top: var(--s6);
  max-width: 62ch;
}

main > section.work {
  margin-top: var(--s8);
  padding-top: var(--s6);
  border-top: 2px solid var(--rule);
}

.work ol {
  margin: 0;
  padding-left: 1.35rem;
  max-width: 65ch;
}

.work li { margin: 0 0 var(--s4); }
.work li:last-child { margin-bottom: 0; }

.register, .plain, .lab {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4rem 0 1rem;
  font-size: 0.98rem;
}

.register th,
.plain th,
.lab th {
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  padding: 0 var(--s5) var(--s4) 0;
  border-bottom: 2px solid var(--rule);
}

.lab th.num, .lab td.num { text-align: right; }

.register td,
.plain td,
.lab td {
  vertical-align: top;
  padding: var(--s5) var(--s5) var(--s5) 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}

.register td:first-child,
.plain td:first-child {
  width: 13.5rem;
  padding-right: var(--s6);
  font-weight: 700;
}

.mark {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.45rem;
  vertical-align: -0.05rem;
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.mark.blocker { background: var(--hazard); box-shadow: none; }
.mark.minor {
  height: 2px;
  width: 0.85rem;
  box-shadow: none;
  background: var(--ink);
  vertical-align: 0.2rem;
}

.lab td.num, .lab th.num {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.answer-no { color: var(--hazard); font-weight: 700; }
.answer-yes { font-weight: 700; }

@media (max-width: 800px) {
  .sheet {
    grid-template-columns: 1fr;
    padding: var(--s7) var(--s5) var(--s8);
    column-gap: var(--s6);
  }
  .rail {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .rail ol {
    display: flex;
    gap: 0.25rem 1rem;
    flex-wrap: wrap;
    border-left: 0;
    padding: 0;
  }
  .soundings li { grid-template-columns: 1fr; gap: 0.15rem; }
  section { overflow-x: auto; }
  .register, .plain, .lab { min-width: 36rem; }
}
