:root {
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text: #f2f2f0;
  --muted: #9a9ca3;
  --dim: #5c5f66;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--text); }
body { font: 18px/1.35 var(--mono); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- map ---------- */
#stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
#flow { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the open ocean fades into the frame edges */
.vignette { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, #000 0, rgba(0,0,0,0) 9%),
    linear-gradient(0deg, #000 0, rgba(0,0,0,0) 10%),
    linear-gradient(180deg, #000 0, rgba(0,0,0,0) 4%); }
#labels { position: absolute; inset: 0; pointer-events: none; }
.place { position: absolute; display: flex; align-items: center; gap: 0.55em; white-space: nowrap;
  font: 500 17px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #e8e8e8;
  text-shadow: 0 0 4px #000, 0 0 8px #000; transform: translate(-0.3em, -50%); }
.place::before { content: ""; width: 0.42em; height: 0.42em; border-radius: 50%; background: #fff; flex: none; }
.place.left { flex-direction: row-reverse; transform: translate(calc(-100% + 0.3em), -50%); }
.place.small { font-size: 15px; }
.place[hidden] { display: none; }
.loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.loading[hidden] { display: none; }

/* ---------- title block ---------- */
.titleblock { transform-origin: right top; text-shadow: 0 0 6px #000, 0 0 12px #000; position: fixed; z-index: 5; right: 5vw; top: 50%; transform: translateY(-50%); width: min(34vw, 470px); }
.titleblock h1 { font: 600 clamp(36px, 3.6vw, 64px)/1.02 var(--serif); margin: 0; letter-spacing: -0.005em; }
.titleblock h2 { font: 400 clamp(22px, 2vw, 36px)/1.2 var(--serif); margin: 0.2em 0 1.1em; color: #b8bcc4; }
.when { display: flex; align-items: center; gap: 0.6em; font-size: clamp(18px, 1.45vw, 26px); letter-spacing: 0.06em; margin-bottom: 0.6em; }
.play { font-size: 0.7em; color: var(--muted); width: 1.6em; height: 1.6em; border: 1px solid var(--dim); border-radius: 50%; display: grid; place-items: center; flex: none; }
.bar { position: relative; height: 16px; border-radius: 8px; background: #23262c; cursor: pointer; touch-action: none; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(#e9edf3, #b9c2cf); }
.bar-ticks span { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: rgba(0,0,0,.55); }
.bar-ticks span.minor { top: 5px; bottom: 5px; width: 1px; background: rgba(0,0,0,.3); }
.bar-now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px #fff; }
.bar-knob { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 3px solid #23262c; }
.bar-labels { position: relative; height: 1.4em; font-size: 15px; color: var(--muted); letter-spacing: 0.06em; margin-top: 4px; text-transform: uppercase; }
.bar-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.cap { font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 1.6em 0 0.5em; }
.ramp { height: 6px; border-radius: 3px; }
.ramp-ticks { position: relative; height: 1.4em; font-size: 16px; margin-top: 0.35em; }
.ramp-ticks span { position: absolute; transform: translateX(-50%); }
.ramp-ticks span:first-child { transform: none; }
.ramp-ticks span:last-child { transform: translateX(-100%); }
.readout { display: grid; grid-template-columns: auto 1fr; gap: 0.35em 1.2em; margin: 2em 0 0; font-size: 18px; }
.readout dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.readout dd { margin: 0; text-align: right; white-space: nowrap; }
.g-head { gap: 0.8em; display: flex; justify-content: space-between; align-items: baseline; margin-top: 1.6em; }
.g-head .cap { margin: 0 0 0.4em; white-space: nowrap; }
.graph { background: rgba(0,0,0,.72); border-radius: 4px; display: block; width: 100%; height: clamp(130px, 16vh, 210px); overflow: visible; font-family: var(--mono); }
.graph .grid { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.graph .msl { stroke: rgba(255,255,255,.28); stroke-width: 1; stroke-dasharray: 3 4; }
.graph .axis { fill: var(--muted); font-size: 14px; }
.graph .curve { fill: none; stroke: #7cc4f0; stroke-width: 2.5; }
.graph .area { fill: rgba(124,196,240,.14); }
.graph .hl { fill: #fff; }
.graph .hl-label { fill: #e8e8e8; font-size: 14px; }
.wind-graph { height: clamp(110px, 13vh, 170px); }
.graph .wind { fill: none; stroke: #e8e8e8; stroke-width: 2.2; }
.graph .gust { fill: none; stroke: rgba(232,232,232,.55); stroke-width: 1.4; stroke-dasharray: 4 3; }
.graph .arrow { fill: #cfd3da; }
.graph .rain { fill: #5aa8e8; }
.graph .rain-zero { fill: rgba(90,168,232,.18); }
.graph .lbl { fill: #e8e8e8; font-size: 14px; }
.graph .now { stroke: rgba(255,255,255,.5); stroke-width: 1; stroke-dasharray: 2 3; }
.graph .sel { stroke: #f2c14e; stroke-width: 2; }
.graph .sel-dot { fill: #f2c14e; stroke: #000; stroke-width: 2; }
.graph .sel-label { fill: #f2c14e; font-size: 15px; font-weight: 500; }

/* ---------- corners ---------- */
.status { position: fixed; z-index: 5; right: 18px; bottom: 14px; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.status.ok .dot { background: #5bd38b; }
.status.warn .dot { background: #f0b33c; }
.status.warn .text { color: #c9a35a; }
.status.bad .dot { background: #f05a4f; }
.status.bad .text { color: #d0756e; }
.credit { position: fixed; z-index: 5; left: 18px; bottom: 14px; font-size: 13px; color: var(--dim); letter-spacing: 0.04em; max-width: 60vw; }

/* ---------- portrait screens and phones: the reel's own layout ---------- */
@media (max-aspect-ratio: 1/1) {
  .titleblock { right: 4vw; top: 42%; transform: none; width: 44vw; }
  .titleblock h1 { font-size: clamp(24px, 6.4vw, 56px); }
  .titleblock h2 { font-size: clamp(15px, 4vw, 32px); margin-bottom: 0.8em; }
  .when { font-size: clamp(12px, 3.1vw, 24px); gap: 0.4em; white-space: nowrap; }
  .bar { height: 10px; }
  .bar-knob { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-width: 2px; }
  .cap, .bar-labels { font-size: clamp(9px, 2.4vw, 15px); }
  .cap { margin-top: 1.2em; }
  .ramp-ticks { font-size: clamp(11px, 2.8vw, 16px); }
  .readout { font-size: clamp(11px, 2.8vw, 18px); grid-template-columns: auto auto; gap: 0.3em 0.8em; margin-top: 1.4em; }
  .readout dd, .readout dt { white-space: nowrap; }
  .readout dt { letter-spacing: 0.02em; }
  .titleblock { width: 45vw; right: 3vw; }
  .readout { font-size: clamp(9px, 2.3vw, 18px); }
  .tide-graph { height: clamp(80px, 13vh, 200px); }
  .wind-graph { height: clamp(70px, 10vh, 160px); }
  .graph .axis, .graph .hl-label, .graph .lbl { font-size: 9px; }
  .g-head { margin-top: 0.8em; }
  .titleblock { transform-origin: right top; }
  .place { font-size: clamp(10px, 2.7vw, 17px); }
  .place.small { font-size: clamp(9px, 2.4vw, 15px); }
  .credit { max-width: 66vw; font-size: 10px; }
  .status { font-size: 10px; }
}
