/* Layout: one scene. A night sea fills the top of the page and is the instrument: the rain falls
   on it, the bolts strike it, one bar of controls sits at its foot. A quiet column of notes
   follows. Cold storm, one warm lantern for the controls. One dark look on purpose. */

@font-face { font-family: "Alegreya SC"; font-weight: 500; font-display: swap; src: url("/fonts/alegreya-sc-500.woff2") format("woff2"); }
@font-face { font-family: "Alegreya SC"; font-weight: 700; font-display: swap; src: url("/fonts/alegreya-sc-700.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap; src: url("/fonts/alegreya-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-display: swap; src: url("/fonts/alegreya-sans-500.woff2") format("woff2"); }

:root {
  --night: #070b0f;
  --rule: rgba(160, 185, 200, 0.18);
  --spray: #dfe6ea;
  --haze: #8a99a3;
  --lantern: #e9b872;
  --lantern-soft: rgba(233, 184, 114, 0.16);
  --face-display: "Alegreya SC", "Palatino Linotype", Palatino, Georgia, serif;
  --face-body: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--night); color: var(--spray); font: 17px/1.55 var(--face-body); }
p { margin: 0; }
a { color: var(--spray); text-decoration-color: var(--lantern); text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.scene { position: relative; height: clamp(500px, 74vh, 660px); overflow: hidden; background: var(--night); }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-inner {
  position: relative;
  height: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-block: calc(36px + env(safe-area-inset-top, 0px)) 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.title { display: grid; gap: 6px; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.title p { max-width: 34ch; color: var(--haze); font-size: 16px; text-wrap: pretty; }
.eyebrow { font: 700 15px/1 var(--face-display); letter-spacing: 0.14em; color: var(--lantern); }
h1 { margin: 0; font: 500 clamp(44px, 9vw, 84px)/0.95 var(--face-display); letter-spacing: 0.01em; text-wrap: balance; }

.countdown { align-self: center; justify-self: center; text-align: center; display: grid; gap: 2px; opacity: 0; transition: opacity 0.2s; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }
[data-thunder="coming"] .countdown { opacity: 1; }
.countdown b { font: 500 clamp(40px, 8vw, 64px)/1 var(--face-display); font-variant-numeric: lining-nums tabular-nums; }
.countdown span { color: var(--haze); font-size: 15px; }

.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 20px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(7, 11, 15, 0.72);
  border: 1px solid var(--rule);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@media (max-width: 760px) { .bar { grid-template-columns: 1fr; } }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.spread { gap: 18px; }
button {
  font: 500 16px/1 var(--face-body);
  color: var(--night);
  background: var(--lantern);
  border: 1px solid var(--lantern);
  border-radius: 6px;
  padding: 12px 18px;
  min-height: 44px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.quiet { color: var(--spray); background: transparent; border-color: var(--rule); }
button.quiet:hover { background: var(--lantern-soft); filter: none; }
#storm[aria-pressed="true"] { background: transparent; color: var(--lantern); }
.speeds button { min-width: 44px; padding: 8px 10px; font-size: 14px; min-height: 36px; }
.speeds button[aria-pressed="true"] { color: var(--lantern); border-color: var(--lantern); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--lantern); outline-offset: 2px; }
.dial { display: grid; gap: 4px; min-width: 0; }
.dial label { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--haze); }
.dial label b { color: var(--spray); font-weight: 500; }
input[type="range"] { width: 100%; accent-color: var(--lantern); margin: 0; }
.readings { display: flex; gap: 18px; font-size: 14px; color: var(--haze); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.readings b { color: var(--spray); font-weight: 500; }

.below {
  max-width: 760px;
  margin: 0 auto;
  padding-block: 40px calc(56px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 36px;
}
.status { color: var(--lantern); font-size: 15px; min-height: 1.55em; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px; }
h2 { margin: 0 0 6px; font: 500 26px/1.1 var(--face-display); }
.pair p, .notes li { color: var(--haze); }
.notes ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
footer { color: var(--haze); font-size: 15px; border-top: 1px solid var(--rule); padding-top: 18px; }
