/* Warbird Watch: a quiet, readable aircraft logbook.
   Shared across the live board, history, and watchlist. */
:root {
  color-scheme: dark;
  --night: #0b1510;
  --panel: #14221a;
  --panel-soft: #101b14;
  --ink: #eef2e8;
  --muted: #afbaac;
  --quiet: #839387;
  --line: #324137;
  --green: #bbd68b;
  --orange: #edb476;
  --red: #ef9583;
  --shadow: none;
}

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--night);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before { display: none; }
::selection { background: var(--green); color: var(--night); }
a { text-underline-offset: 0.22em; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
.app-shell { width: min(1000px, calc(100% - 40px)); }
.topbar { border-bottom-color: var(--line); }
.topbar .brand { text-wrap: nowrap; }
.topbar .top-links { font-weight: 600; }
.topbar .top-links a[aria-current="page"] { opacity: 1; color: var(--quiet); }
.topbar .top-links a:not([aria-current="page"]) { color: var(--ink); }
.topbar .top-links a:not([aria-current="page"]):hover { color: var(--green); }

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
h1, h2, h3 { color: var(--ink); font-family: Inter, system-ui, sans-serif; }
h1 { line-height: 1.04; letter-spacing: -0.055em; }
h2 { line-height: 1.07; letter-spacing: -0.047em; }
p { line-height: 1.55; }

.intro-line { padding: 26px 0 34px; }
.intro-line p {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.1rem, 2.35vw, 1.42rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.025em;
}
.live-board, .watchlist-section, .history-panel {
  margin: 0 0 30px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 28px 0 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.live-board .section-heading, .section-heading, .history-heading {
  align-items: end;
  gap: 20px;
}
.live-board h1 {
  font-size: clamp(2.5rem, 5.3vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.062em;
}
.fetch-status, .history-status, .section-copy {
  max-width: 360px;
  padding: 0;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: right;
}
.fetch-status { margin-bottom: 5px; }
.live-key {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 26px 0 15px;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
}
.key-dot {
  width: 7px; height: 7px; margin-right: 6px;
  box-shadow: none !important;
  vertical-align: 1px;
}
.airborne-dot { background: var(--orange); }
.detected-dot { background: var(--green); }
.quiet-dot { background: var(--quiet); }

.live-cards { gap: 16px; }
.live-card, .empty-state {
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}
.empty-state {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 260px;
  padding: clamp(30px, 6vw, 68px);
  gap: 0;
}
.empty-state .empty-icon, .empty-state .quiet-radar { display: none; }
.empty-state h3 {
  margin: 0 0 12px;
  font-size: clamp(2.45rem, 5.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 1.03;
}
.empty-state p {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}
.error-state { background: #281b19; }
.error-state h3 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.loading-state { min-height: 240px; }
.loading-state h3 { font-size: clamp(1.8rem, 4vw, 2.65rem); }

.live-card {
  position: relative;
  min-height: 0;
  padding: 30px;
  overflow: visible;
}
.live-card.airborne::before {
  width: 4px;
  height: auto;
  top: 0; bottom: 0; left: 0; right: auto;
  background: var(--orange);
  box-shadow: none;
}
.live-card.has-route-link { padding-bottom: 30px; }
.live-card-head { align-items: start; }
.live-card-head h3 {
  max-width: none;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.05em;
}
.status-badge {
  flex: 0 0 auto;
  border: none;
  border-radius: 0;
  padding: 3px 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.live-card-meta { margin: 12px 0 26px; color: var(--muted); }
.data-grid { gap: 19px 16px; }
.data-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.data-grid strong {
  font-size: 1rem; font-weight: 650; white-space: normal;
}
.live-route-link {
  display: inline-block;
  position: static;
  margin-top: 28px;
  color: var(--green);
  font-size: 0.93rem;
  font-weight: 700;
}
.live-route-link:hover { text-decoration: underline; }

.notification-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 18px;
  border: 0;
  border-radius: 0;
  padding: 28px 32px;
  background: var(--panel-soft);
}
.notification-cta strong {
  margin-bottom: 5px;
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.notification-cta span {
  color: var(--muted);
  font-size: 0.95rem;
}
.notification-cta a {
  min-height: 44px;
  border: 0;
  border-radius: 3px;
  padding: 0 18px;
  color: var(--night);
  background: var(--green);
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: none;
}
.notification-cta a:hover { background: #d3e6b2; transform: none; }

.page-lede { padding: 35px 0 30px; }
.page-lede h1 {
  max-width: 800px;
  margin: 0 0 14px;
  font-size: clamp(2.85rem, 6vw, 4.8rem);
  font-weight: 750;
  line-height: 1.04;
}
.page-lede .hero-copy, .page-lede .hero-text {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 1.07rem;
  line-height: 1.58;
}
.page-lede .eyebrow { margin-bottom: 12px; }
.collection-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}
.collection-meta strong { color: var(--ink); font-weight: 700; }
.watchlist-section.detail-section {
  margin-top: 0; padding-top: 24px;
}
.aircraft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  counter-reset: aircraft;
  margin: 0;
}
.aircraft-card {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 265px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 24px 16px 22px 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.aircraft-card::before {
  position: absolute;
  top: 24px;
  right: 4px;
  color: var(--quiet);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  content: counter(aircraft, decimal-leading-zero);
  counter-increment: aircraft;
}
.aircraft-card:hover, .aircraft-card:focus-visible {
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
  transform: none;
}
.aircraft-code {
  display: block;
  align-self: flex-start;
  margin: 0 0 15px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.aircraft-card strong {
  margin: 0 0 5px;
  font-size: clamp(1.65rem, 3vw, 2.05rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.055em;
}
.aircraft-model {
  color: var(--ink);
  opacity: 0.75;
  font-size: 0.95rem;
  line-height: 1.5;
}
.aircraft-card p {
  margin: 15px 0 20px;
  max-width: 360px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.52;
}
.aircraft-footer {
  display: inline-block;
  position: static;
  margin-top: auto;
  color: var(--green);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.aircraft-card:hover .aircraft-footer { text-decoration: underline; }

.history-panel { padding-top: 28px; }
.history-heading h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); }
.history-heading .eyebrow { margin-bottom: 9px; }
.history-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  justify-content: end;
}
.history-tools .history-status { max-width: 430px; margin: 0; }
.history-tools .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 15px;
  color: var(--ink);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 650;
}
.history-tools .button:hover {
  border-color: var(--muted);
  color: var(--ink);
  background: var(--panel);
  transform: none;
}
.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  margin-top: 27px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.history-summary article {
  display: flex;
  align-items: baseline;
  gap: 9px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: none;
}
.history-summary span {
  margin: 0;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.history-summary strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}
.history-list { margin-top: 8px; border-top: 0; }
.scan-row {
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr) 74px;
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.scan-time {
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}
.scan-message {
  color: var(--ink);
  font-size: 1.03rem;
  line-height: 1.52;
}
.scan-tag {
  justify-self: end;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.scan-row.airborne .scan-tag { border-color: transparent; color: var(--orange); }
.scan-row.detected .scan-tag { border-color: transparent; color: var(--green); }
.scan-row.error .scan-tag { border-color: transparent; color: var(--red); }
.status-word { font-weight: 700; }
.status-word.airborne { color: var(--orange); }
.status-word.detected { color: var(--green); }
.status-word.error { color: var(--red); }

.history-list .empty-state {
  margin-top: 12px;
  min-height: 225px;
  padding: 38px;
  background: var(--panel);
}
.history-list .empty-state h3 {
  font-size: clamp(1.7rem, 3.3vw, 2.3rem);
  letter-spacing: -0.05em;
}
.history-list .empty-state p { font-size: 0.98rem; }

footer {
  margin-top: 12px;
  padding: 20px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.81rem;
}
footer p { max-width: 700px; margin: 0; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 28px, 1000px); }
  .intro-line { padding: 22px 0 27px; }
  .live-board, .watchlist-section, .history-panel { padding-top: 24px; }
  .live-board .section-heading, .section-heading, .history-heading { display: block; }
  .live-board h1 { font-size: clamp(2.4rem, 10vw, 3.3rem); }
  .fetch-status, .history-status, .section-copy {
    max-width: none;
    padding: 0;
    margin-top: 13px;
    text-align: left;
  }
  .empty-state { min-height: 200px; padding: 28px; }
  .empty-state h3 { font-size: clamp(2.25rem, 9vw, 3.2rem); }
  .live-cards, .aircraft-grid { grid-template-columns: 1fr; }
  .live-card { padding: 24px; }
  .notification-cta { display: block; padding: 25px 24px; }
  .notification-cta a { width: 100%; margin-top: 18px; }
  .page-lede { padding: 28px 0 25px; }
  .page-lede h1 { font-size: clamp(2.75rem, 10vw, 4rem); }
  .collection-meta { font-size: 0.85rem; }
  .aircraft-card { min-height: 225px; padding: 22px 38px 24px 0; }
  .history-tools { align-items: flex-start; margin-top: 20px; }
  .history-tools .history-status { margin-top: 0; text-align: left; }
  .history-summary { gap: 8px 24px; }
  .scan-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 16px; }
  .scan-time { grid-column: 1; }
  .scan-message { grid-column: 1; }
  .scan-tag { grid-column: 2; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* History paging: never build thousands of scan rows unless someone asks for them. */
.history-pagination {
  display: flex;
  justify-content: center;
  padding: 24px 0 12px;
}
.history-pagination[hidden] { display: none; }
.history-more {
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: var(--panel);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.94rem;
  font-weight: 650;
  cursor: pointer;
}
.history-more:hover,
.history-more:focus-visible {
  border-color: var(--green);
  color: var(--green);
}
.history-more:disabled,
.history-tools .button:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* Flight-session events: data colour only, never another decorative badge. */
.scan-row.landed .scan-tag,
.status-word.landed { color: var(--muted); }
.scan-row.reacquired .scan-tag,
.status-word.reacquired { color: var(--muted); }
.status-word.takeoff { color: var(--orange); }

/* Compact museum support CTA; matches the Live board's Discord panel. */
.museum-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 18px 0 30px;
  border: 0;
  border-radius: 0;
  padding: 28px 32px;
  background: var(--panel-soft);
}

.museum-support-copy { min-width: 0; }

.museum-support h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.museum-support-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.museum-support-link {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 0 18px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.museum-support-link:hover,
.museum-support-link:focus-visible {
  color: var(--night);
  background: var(--green);
}

@media (max-width: 760px) {
  .museum-support {
    display: block;
    margin: 18px 0 30px;
    padding: 25px 24px;
  }

  .museum-support-link {
    width: 100%;
    margin-top: 18px;
  }
}
