@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #F5F3EE; --ink: #16202A; --muted: #5B6670; --faint: #8A949C;
  --accent: #0E7C74; --line: #DDD8CE; --card: #FFFFFF;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.5 "Plex", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 18px; }

.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 16px; padding-top: 14px; padding-bottom: 12px; }
.brand { font: 500 14px/1.2 "PlexMono", ui-monospace, monospace; letter-spacing: .04em;
  color: var(--accent); text-decoration: none; }
.tagline { margin: 0; color: var(--muted); font-size: 15px; font-weight: 600; }

.intro { padding: 22px 0 6px; }
h1 { font-size: clamp(28px, 7vw, 44px); line-height: 1.1; margin: 0 0 8px; font-weight: 700; letter-spacing: -.01em; }
.meta { margin: 0; color: var(--muted); font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin: 18px 0; padding: 16px; display: grid; gap: 12px; }
.card h2 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.card h2 span { color: var(--faint); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.card .head { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; }
.card .sub { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.card .impact { margin: 4px 0 0; color: var(--muted); }
.map img { display: block; width: 100%; height: auto; border-radius: 8px; }
.top-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.top-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.top-list li small { color: var(--faint); margin-left: 6px; }
.top-list b { white-space: nowrap; }

.note { color: var(--muted); font-size: 15px; padding: 4px 0 20px; }
.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; padding: 18px 0 32px; }
.foot p { margin: 0 0 8px; }
.signoff { color: var(--ink); font-weight: 600; font-size: 17px; }

@media (min-width: 820px) {
  .card { grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr; padding: 22px; column-gap: 26px; }
  .card .card-text { grid-column: 1; grid-row: 1; }
  .card .top-list { grid-column: 1; grid-row: 2; align-self: start; }
  .card .map { grid-column: 2; grid-row: 1 / span 2; }
  .card .map img { max-height: 88vh; width: auto; max-width: 100%; margin-left: auto; }
}

.card[hidden], .player[hidden], .warnings[hidden] { display: none; }
.badge { font-style: normal; font: 500 11px/1 "PlexMono", ui-monospace, monospace; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 7px; margin-left: 6px; vertical-align: 2px; }

/* timeline player under each map */
.player { display: grid; gap: 6px; }
.controls { display: flex; align-items: center; gap: 8px; }
.controls button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font: 600 20px/1 "Plex", system-ui, sans-serif; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.controls button.play { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 15px; }
.controls button:focus-visible, .views button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.controls input[type=range] { flex: 1; min-width: 0; height: 44px; margin: 0 4px; background: transparent;
  -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.controls input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
.controls input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px;
  border-radius: 50%; background: var(--ink); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.controls input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.controls input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--ink);
  border: 3px solid var(--card); }
.player .when { margin: 0; font-size: 15px; color: var(--muted); min-height: 3em; }
.player .when b { color: var(--ink); margin-right: 4px; }
.views { margin: 0; }
.views button { background: none; border: 0; padding: 8px 0; color: var(--accent); font: 600 14px/1.2 "Plex", system-ui, sans-serif;
  text-decoration: underline; cursor: pointer; }

/* thunder extras */
.hazards { margin: 0; font-size: 15px; }
.hazards dt { font-weight: 600; margin-top: 8px; }
.hazards dd { margin: 2px 0 0; color: var(--muted); }
.fine { margin: 0; color: var(--faint); font-size: 13.5px; }

/* Met Office warnings list */
.warnings { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 18px 0 0; padding: 14px 16px; }
.warnings h2 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.warnings ul { list-style: none; margin: 0 0 8px; padding: 0; }
.warnings li { display: grid; gap: 1px; padding: 8px 0 8px 12px; border-left: 5px solid; margin-bottom: 6px; }
.warnings li.w-yellow { border-color: #F5D000; }
.warnings li.w-amber { border-color: #F59300; }
.warnings li.w-red { border-color: #D7263D; }
.warnings li small { color: var(--faint); }

@media (min-width: 820px) {
  .card .player { grid-column: 2; }
  #thunder.card { grid-template-rows: auto auto auto 1fr auto; }
  #thunder .top-list { grid-row: 2; }
  #thunder .hazards { grid-column: 1; grid-row: 3; }
  #thunder .fine { grid-column: 1; grid-row: 4; align-self: start; }
  #thunder .map { grid-row: 1 / span 4; }
  #thunder .player { grid-row: 5; }
  .card .player { max-width: 540px; justify-self: end; width: 100%; }
}
