:root {
  color-scheme: dark;
  --bg: #0e0e10;
  --surface: #161618;
  --track: #1c1d21;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f1ea;
  --muted: #b7b1a6;
  --faint: #8f897f;
  --red: #f42300;
  --red-soft: rgba(244, 35, 0, 0.16);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

header {
  border-bottom: 1px solid var(--line);
  background: #0b0b0c;
}

.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
}

.logo img {
  display: block;
  height: 36px;
  width: auto;
}

.clock {
  margin-left: auto;
  text-align: right;
}

.clock-line {
  margin: 0;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.zone,
.clock-date {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.clock-date {
  margin: 2px 0 0;
  letter-spacing: 0.04em;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.text-button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.text-button:hover { border-color: var(--red); color: white; }

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.icon-button:hover,
.icon-button[aria-expanded="true"] {
  border-color: var(--red);
  color: white;
}

.icon-button[aria-expanded="true"] {
  background: var(--red);
}

.contact {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding-bottom: 1px;
}

.contact:hover { color: white; }

main .wrap { padding: 28px 0 72px; }

h1 {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 2.4vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; }

.lede {
  margin: 0 0 22px;
  color: var(--muted);
}

.lede:has(+ .constellation:not([hidden])) { margin-bottom: 8px; }

.constellation {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 22px;
}

.constellation-label {
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.constellation strong {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #2a2116;
  border-left: 3px solid #e0a24a;
  color: #f3e6d0;
}

.status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 28px;
  align-items: center;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid #3c3d42;
  margin-bottom: 28px;
}

.status.coverage { border-left-color: var(--red); }
.status.marginal { border-left-color: #e0a24a; }

.state {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
  margin: 0;
}

.share,
.next {
  margin: 6px 0 0;
  color: var(--muted);
}

.next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
}

.next .wait {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.share { color: var(--text); font-size: 1.05rem; }

.controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.country-picker:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-picker select {
  min-width: 220px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121316;
  color: var(--text);
  font: inherit;
}

.mask {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mask-label {
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 6px;
}

.mask button {
  min-width: 52px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.mask button[aria-checked="true"] {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.forecast { margin-bottom: 32px; }

.day {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.day-meta { display: flex; flex-direction: column; gap: 2px; }

.when {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.day-date { font-weight: 600; }

.total { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.track {
  background: var(--track);
  border-radius: 6px;
  height: 72px;
  position: relative;
}

.track canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

.hours {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.caveat {
  color: var(--muted);
  max-width: 72ch;
  line-height: 1.5;
  margin: 8px 0 0;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.map-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.map-heading h2 { margin: 0; }

#map-now {
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

#map-now:hover {
  border-color: var(--red);
  color: white;
}

.map-frame {
  background: #121316;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

#map { width: 100%; height: 460px; display: block; }

.map-note { color: var(--muted); min-height: 1.4em; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 2px;
}

.swatch-cover { background: var(--red); }
.swatch-clear { background: rgba(255, 255, 255, 0.35); }
.swatch-sat { background: transparent; border: 1.5px solid var(--red); border-radius: 50%; }

#windows {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.window-day { margin: 0; }
.window-day h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 10px 12px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.window-day ul { list-style: none; margin: 0; padding: 0 0 8px; }
.window-day li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 8px 12px;
  margin: 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.window-day li strong { font-weight: 600; }
.window-day li .detail { color: var(--muted); grid-column: 1; }
.window-day li .timing { color: var(--text); text-align: right; }
.window-day li.current {
  background: rgba(244, 35, 0, 0.14);
  box-shadow: inset 3px 0 0 var(--red);
}
.window-day li.current .timing { color: white; font-weight: 600; }
.window-day li.past { opacity: 0.55; }
.window-day li:not(.empty):hover,
.window-day li.previewing { background: rgba(255, 255, 255, 0.05); }
.window-day li.current:hover,
.window-day li.current.previewing { background: rgba(244, 35, 0, 0.22); }
.window-day .empty { color: var(--faint); border-top: 0; padding-top: 0; box-shadow: none; background: none; }
.now-tag {
  color: white;
  background: var(--red);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: 1px;
}

#meta {
  margin-top: 28px;
  color: var(--faint);
  font-size: 0.88rem;
  line-height: 1.5;
}

.placeholder { color: var(--muted); }

#tip {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  background: #0b0b0c;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  transform: translate(-50%, -130%);
  white-space: nowrap;
}

dialog {
  border: 0;
  border-top: 3px solid var(--red);
  padding: 0;
  background: #17181b;
  color: var(--text);
  width: min(540px, calc(100vw - 28px));
  max-height: min(90vh, 820px);
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.64); }

.dialog-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.dialog-head h2 { margin: 0; }

#about-close {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.dialog-body { flex: 1 1 auto; min-height: 0; padding: 8px 22px 22px; overflow: auto; }
.dialog-body p { line-height: 1.55; color: #e4dfd6; }
.dialog-body a { color: white; }

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

@media (max-width: 800px) {
  .bar { flex-wrap: wrap; padding: 10px 0; }
  .clock { margin-left: 0; text-align: left; }
  .status, .split, .day { grid-template-columns: 1fr; }
  .controls { align-items: flex-start; }
  .country-picker select { min-width: 0; max-width: 100%; }
  #map { height: 320px; }
  .day-meta { flex-direction: row; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
