/*
  Soundings — StreamKeel is drawn as a nautical chart. This sheet is the status page.

  1. State, don't sell. Every claim is a number, a date or a plain sentence.
  2. Every line marks something. A rule is a boundary, a dash is a route, a tick is a unit.
  3. Ink on paper. Depth comes from hairlines, a second paper tone and the land tint.
  4. Calm water. Nothing moves unless the state changed.
  5. Legible at the helm. Codes read character by character; graphics sit beside their words.
  6. One chart, many sheets. One grid, one margin column, one set of symbols.

  Foundations (fonts, tokens, base, grid, masthead, footer, chart notes, marks, soundings)
  are copied from site/src/styles/global.css; keep them in step with the site.
*/

/* ---------- Fonts ---------- */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/atkinson-next.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/atkinson-mono.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 500;
  font-display: swap;
  src: url('/fonts/source-serif-4-italic.woff2') format('woff2');
}

/* Atkinson has no arrows; borrow the upright arrows from the serif file. */
@font-face {
  font-family: 'Soundings Arrows';
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-italic.woff2') format('woff2');
  unicode-range: U+2190-2199;
}

@font-face {
  font-family: 'Next Fallback';
  src: local('Arial'), local('Liberation Sans'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 99.6%;
  ascent-override: 98.8%;
  descent-override: 31.7%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Mono Fallback';
  src: local('Courier New'), local('Liberation Mono'), local('Menlo');
  size-adjust: 105.3%;
  ascent-override: 93.4%;
  descent-override: 30%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Serif Fallback';
  font-style: italic;
  src: local('Georgia Italic'), local('Georgia-Italic'), local('Times New Roman Italic'),
    local('Liberation Serif Italic');
  size-adjust: 95%;
  ascent-override: 109%;
  descent-override: 35%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --paper: #f4f1e8;
  --paper-2: #eae5d6;
  --land: #e6d9b4;
  --shoal: #d3e6ee;
  --contour: #8db7ca;
  --ink: #16191b;
  --ink-2: #464b4e;
  --ink-3: #62666a;
  --line: #d2cdbf;
  --line-strong: #7f7a6e;
  --magenta: #962065;
  --depth: #1f5a78;
  --ok: #1e6a3b;
  --caution: #8a5600;
  --danger: #b0261c;
  --on-ink: #f4f1e8;
  --ink-hover: #2b3034;

  --font-text: 'Atkinson Hyperlegible Next', 'Soundings Arrows', 'Next Fallback', system-ui,
    sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', 'Soundings Arrows', 'Mono Fallback', ui-monospace,
    monospace;
  --font-sounding: 'Source Serif 4', 'Serif Fallback', Georgia, serif;

  --fs-label: 0.75rem;
  --fs-meta: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-body: 1.0625rem;
  --fs-lede: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --fs-h1: clamp(2.375rem, 1.55rem + 3.4vw, 4.25rem);
  --fs-sounding-sm: clamp(2rem, 1.6rem + 1.5vw, 2.75rem);
  --fs-sounding: clamp(4.5rem, 2.2rem + 9vw, 9rem);

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --s10: 144px;

  --gutter: 16px;
  --gap: 24px;
  --sheet: 76rem;
  --sec-pad: var(--s8);

  --t-press: 90ms;
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 700ms;
  --t-zoom: 420ms;
  --ease-settle: cubic-bezier(0.2, 0.7, 0.1, 1);

  --hatch: repeating-linear-gradient(-45deg, currentColor 0 1px, transparent 1px 6px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1114;
    --paper-2: #141a1e;
    --land: #1e1b15;
    --shoal: #1c3a48;
    --contour: #2e5566;
    --ink: #e7e2d4;
    --ink-2: #b3aea1;
    --ink-3: #8f8a80;
    --line: #283036;
    --line-strong: #6b737a;
    --magenta: #e58ac4;
    --depth: #86bcd6;
    --ok: #7dc495;
    --caution: #e3b15c;
    --danger: #f2897f;
    --on-ink: #0d1114;
    --ink-hover: #ffffff;
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: clamp(24px, 5vw, 64px);
    --sec-pad: var(--s9);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s5);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 650;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.028em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.3;
  letter-spacing: -0.005em;
}

p,
li {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 650;
}

em {
  font-style: italic;
}

img,
svg {
  display: block;
  max-width: 100%;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums slashed-zero;
}

a {
  color: var(--depth);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--t-fast) var(--ease-settle),
    text-decoration-thickness var(--t-fast) var(--ease-settle);
}

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

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

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

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: var(--s3);
  z-index: 10;
  padding: var(--s3) var(--s4);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 650;
  border-radius: 2px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--on-ink);
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Sheet and grid ---------- */

.sheet {
  width: min(100% - 2 * var(--gutter), var(--sheet));
  margin-inline: auto;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--s5);
}

@media (min-width: 40rem) {
  .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: var(--gap);
  }

  .c-label {
    grid-column: 1 / 3;
  }

  .c-main,
  .c-wide,
  .c-note,
  .c-full {
    grid-column: 3 / 9;
  }
}

@media (min-width: 64rem) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .c-label {
    grid-column: 1 / 4;
  }

  .c-main {
    grid-column: 4 / 11;
  }

  .c-wide {
    grid-column: 4 / 13;
  }

  .c-note {
    grid-column: 11 / 13;
  }

  .c-full {
    grid-column: 1 / 13;
  }
}

/* A section of the sheet: a sheet-width hairline with a tick on the column-4 edge. */
.sec > .sheet {
  padding-block: var(--sec-pad);
  border-top: 1px solid var(--line);
  background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 0 / 1px 10px;
}

@media (min-width: 40rem) {
  .sec > .sheet {
    background-position: calc((100% - 7 * var(--gap)) / 4 + 2 * var(--gap)) 0;
  }
}

@media (min-width: 64rem) {
  .sec > .sheet {
    background-position: calc((100% - 11 * var(--gap)) / 4 + 3 * var(--gap)) 0;
  }
}

.sec-first > .sheet {
  border-top: 0;
  background: none;
}

/* Sheet label: a § number plus a short section name, in the margin column. */
.sheet-label {
  display: flex;
  gap: var(--s3);
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-2);
}

.sheet-label .sec-num {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 40rem) {
  .sheet-label {
    flex-direction: column;
    gap: var(--s1);
    padding-top: 0.55em;
  }
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 52ch;
}

.muted {
  color: var(--ink-2);
}

.small {
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.5;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.stack > * + * {
  margin-top: var(--s4);
}

/* ---------- Masthead ---------- */

.masthead-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'brand dash'
    'nav nav';
  align-items: center;
  column-gap: var(--s4);
  padding-block: var(--s4) var(--s3);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.nav {
  display: contents;
}

.nav-list {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--s4);
  list-style: none;
  padding: 0;
  font-size: var(--fs-sm);
}

.nav-list a,
.nav-dash {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.nav-list a:hover,
.nav-dash:hover {
  color: var(--magenta);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.nav-list a[aria-current='page'],
.nav-dash[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--magenta);
}

.nav-dash {
  grid-area: dash;
  justify-self: end;
  gap: 6px;
  font-weight: 650;
  font-size: var(--fs-sm);
}

@media (min-width: 52rem) {
  .masthead-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'brand nav dash';
    padding-block: var(--s5) var(--s4);
  }

  .nav-list {
    justify-content: flex-end;
    column-gap: var(--s6);
    padding-right: var(--s6);
    font-size: var(--fs-body);
  }

  .nav-dash {
    font-size: var(--fs-body);
  }
}

/* Neatline: the border of a printed chart, with an alternating minute scale. */
.neatline {
  height: 6px;
  border-block: 1px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 24px, transparent 24px 48px);
}

/* ---------- Footer (land band) ---------- */

.colophon {
  margin-top: var(--s9);
}

.colophon-band {
  background: var(--land);
  color: var(--ink);
}

.colophon-inner {
  display: grid;
  gap: var(--s5);
  padding-block: var(--s6) var(--s7);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.colophon-tagline {
  max-width: 44ch;
  color: var(--ink-2);
}

.colophon-tagline strong {
  color: var(--ink);
}

.colophon-links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  column-gap: var(--s7);
  list-style: none;
  padding: 0;
}

.colophon-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.colophon-links a:hover {
  color: var(--magenta);
  text-decoration: underline;
}

@media (min-width: 64rem) {
  .colophon-inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: start;
  }

  .colophon-tagline {
    grid-column: 1 / 7;
    padding-top: 10px;
  }

  .colophon-inner > nav {
    grid-column: 8 / 13;
  }

  .colophon-links {
    grid-template-columns: repeat(3, max-content);
    justify-content: end;
  }
}

/* ---------- Actions ---------- */

/* Secondary action: a text link with an underline that thickens and turns magenta. */
.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-settle),
    text-decoration-thickness var(--t-fast) var(--ease-settle);
}

.act:hover {
  color: var(--magenta);
  text-decoration-thickness: 2px;
}

.act:disabled {
  color: var(--ink-3);
  text-decoration: none;
  cursor: not-allowed;
}

/* ---------- Chart notes ---------- */

.chart-note {
  display: grid;
  gap: var(--s2);
  max-width: 66ch;
}

.chart-note-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--magenta);
}

.chart-note-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
}

.chart-note-danger .chart-note-head {
  color: var(--danger);
}

.chart-note-title {
  font-weight: 650;
  color: var(--ink);
}

.chart-note p:not(.chart-note-head):not(.chart-note-title) {
  color: var(--ink-2);
}

/* ---------- Position marks ---------- */

.mark {
  position: relative;
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  vertical-align: -2px;
}

.mark-ready {
  color: var(--ok);
}

.mark-ready::after,
.mark-active::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
}

.mark-active {
  color: var(--ok);
}

.mark-unset {
  color: var(--ink-3);
}

.mark-caution {
  color: var(--caution);
}

.mark-wait::after,
.mark-caution::after {
  content: '';
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.mark-danger {
  color: var(--danger);
  border-style: dotted;
  border-width: 2px;
}

.mark-danger::before,
.mark-danger::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 1.5px;
  background: currentColor;
  translate: -50% -50%;
  rotate: 45deg;
}

.mark-danger::after {
  rotate: -45deg;
}

.status-word {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 600;
}

.status-ok {
  color: var(--ok);
}

.status-caution {
  color: var(--caution);
}

.status-danger {
  color: var(--danger);
}

.status-unset {
  color: var(--ink-2);
}

/* ---------- Sounding numerals ---------- */

.sounding {
  font-family: var(--font-sounding);
  font-style: italic;
  font-weight: 300;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
  line-height: 0.88;
}

.sounding-sm {
  font-family: var(--font-sounding);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-sounding-sm);
  line-height: 1;
  font-variant-numeric: lining-nums;
}

/* ======================================================================
   Status page
   ====================================================================== */

/* ---------- Head: the overall reading ---------- */

.head > .sheet {
  padding-block: var(--s7) var(--s8);
}

.head-main > * + * {
  margin-top: var(--s4);
}

.state {
  display: flex;
  align-items: flex-start;
  gap: 0.32em;
}

/* Centre the mark on the first line of the headline. */
.state .mark-lg {
  margin-top: 0.285em;
}

.head-figure {
  align-self: end;
  padding-top: var(--s4);
  border-top: 1px solid var(--ink);
}

.figure {
  display: flex;
  align-items: baseline;
  gap: 0.08em;
  margin-top: var(--s2);
}

.figure .sounding {
  font-size: clamp(3.75rem, 2.4rem + 4vw, 6rem);
}

.figure-unit {
  font-family: var(--font-sounding);
  font-style: italic;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  color: var(--ink-2);
}

.figure-none {
  font-size: var(--fs-h3);
  font-weight: 650;
  color: var(--ink-2);
}

.figure-label {
  margin-top: var(--s3);
  text-wrap: balance;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-2);
}

@media (min-width: 40rem) {
  .head-main,
  .head-figure {
    grid-column: 3 / 9;
  }

  .head-figure {
    max-width: 22rem;
  }
}

@media (min-width: 64rem) {
  .head-main {
    grid-column: 4 / 10;
  }

  .head-figure {
    grid-column: 10 / 13;
    max-width: none;
  }
}

/* Large position marks beside the headline. */
.mark-lg {
  width: 0.46em;
  height: 0.46em;
  border-width: 0.06em;
  vertical-align: 0;
}

.mark-lg.mark-ready::after {
  inset: 0.08em;
}

.mark-lg.mark-caution::after {
  inset: 0.06em;
  border-width: 0.05em;
}

.mark-lg.mark-danger {
  border-width: 0.07em;
}

.mark-lg.mark-danger::before,
.mark-lg.mark-danger::after {
  width: 0.24em;
  height: 0.05em;
}

/* ---------- Legend ---------- */

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3) var(--s6);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  list-style: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 14px;
}

.key {
  display: inline-block;
  width: 18px;
  height: 10px;
}

.key-line {
  border-top: 2px solid var(--depth);
  background: var(--shoal);
  height: 10px;
}

.key-down,
.key-empty {
  height: 5px;
  background: var(--danger);
}

.key-empty {
  background: var(--line-strong);
}

/* ---------- Components: one ruled row each, with the 90-day strip ---------- */

.parts {
  list-style: none;
  padding: 0;
  margin-top: var(--s5);
  border-bottom: 1px solid var(--line);
}

.part {
  padding-block: var(--s5) var(--s4);
  border-top: 1px solid var(--line);
}

.part-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'name state'
    'role role';
  align-items: baseline;
  column-gap: var(--s4);
}

.part-name {
  grid-area: name;
}

.part-role {
  grid-area: role;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
}

.part-state {
  grid-area: state;
  font-size: var(--fs-sm);
}

@media (min-width: 40rem) {
  .part-head {
    grid-template-columns: minmax(10.5rem, max-content) minmax(0, 1fr) auto;
    grid-template-areas: 'name role state';
  }
}

/* The strip: one bar per UTC day, oldest first. Colour bands match the legend. */
.days {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 1px;
  height: 30px;
  margin-top: var(--s3);
  list-style: none;
  padding: 0;
}

@media (min-width: 40rem) {
  .days {
    gap: 2px;
    height: 36px;
  }
}

.d-ok {
  background: var(--ok);
}

.d-warn {
  background: var(--caution);
}

.d-bad {
  background: var(--danger);
}

/* No data: hatched, the chart's "unsurveyed" mark. */
.d-none {
  color: var(--line-strong);
  background: var(--hatch), var(--paper-2);
}

.days .d-none {
  background-attachment: fixed, scroll;
}

.days .d-today {
  position: relative;
}

.days .d-today::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 3px;
  background: var(--magenta);
}

.days-axis {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.days-pct {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  color: var(--ink);
  white-space: nowrap;
}

.days-pct::before,
.days-pct::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.days-today {
  color: var(--magenta);
}

/* ---------- Response time ---------- */

.readings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s7);
  margin-top: var(--s5);
}

.readings dt {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-2);
}

.readings dd {
  margin: var(--s1) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.readings .sounding-sm {
  color: var(--ink);
}

.reading-at {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
}

.speed {
  margin-top: var(--s6);
}

.plot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 200px auto;
  column-gap: var(--s3);
}

@media (min-width: 40rem) {
  .plot {
    grid-template-rows: 240px auto;
  }
}

.y-axis,
.x-axis {
  list-style: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.3;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
}

.y-axis li:first-child {
  translate: 0 -50%;
}

.y-axis li:last-child {
  translate: 0 50%;
}

.plot-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.x-axis {
  grid-column: 2;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--s3);
}

.x-axis li {
  translate: -50% 0;
}

.x-axis li:first-child {
  translate: none;
}

.x-axis .x-now {
  position: absolute;
  right: 0;
  translate: none;
  color: var(--magenta);
}

@media (max-width: 39.99rem) {
  .x-axis .x-minor {
    visibility: hidden;
  }
}

.grid-minor {
  stroke: var(--line);
  stroke-width: 1;
}

.grid-major {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.plot-area {
  fill: var(--shoal);
}

.plot-line {
  fill: none;
  stroke: var(--depth);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.plot-down {
  fill: var(--danger);
}

.plot-empty {
  fill: var(--line-strong);
}

.plot-base {
  stroke: var(--ink);
  stroke-width: 1;
}

.speed figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  margin-top: var(--s5);
}

.speed-empty {
  margin-top: var(--s4);
}

/* ---------- Outages ledger ---------- */

.sec-lead {
  margin-top: var(--s2);
  max-width: 62ch;
}

.outages {
  list-style: none;
  padding: 0;
  margin-top: var(--s5);
  border-bottom: 1px solid var(--line);
}

.outage {
  display: grid;
  gap: var(--s1);
  padding-block: var(--s4);
  border-top: 1px solid var(--line);
}

.o-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  line-height: 1.3;
  color: var(--ink-2);
}

.o-when {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.o-lasted {
  font-weight: 650;
}

.outage-open .o-lasted {
  color: var(--danger);
}

.o-what {
  color: var(--ink-2);
}

.outage-headrow {
  display: none;
}

@media (min-width: 40rem) {
  .outage {
    grid-template-columns: 15rem 11rem minmax(0, 1fr);
    column-gap: var(--gap);
    align-items: baseline;
  }

  .outage-headrow {
    display: grid;
    padding-block: var(--s2);
    border-top: 0;
    font-family: var(--font-mono);
    font-size: var(--fs-meta);
    color: var(--ink-2);
  }

  .outage:not(.outage-headrow) .o-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

.calm {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
  color: var(--ink-2);
}
