/* Overhead — one stylesheet, no build step, no webfonts.
 *
 * The palette is the sky at the two ends of a day: a cool paper ground with a
 * slate ink, and an amber-to-red ramp that is only ever used for loudness, so
 * a color on this page always means the same thing. Numbers are tabular
 * throughout, because the whole page is a column of figures.
 */

:root {
  color-scheme: light dark;

  --ink:        #17202b;
  --ink-soft:   #4a5867;
  --ink-faint:  #7b8896;
  --ground:     #f6f4f0;
  --panel:      #ffffff;
  --line:       #dcd8d1;
  --accent:     #1f5f8b;
  --accent-ink: #ffffff;

  /* Loudness, quiet to loud. Used for nothing else. */
  --q1: #8fb8cf;
  --q2: #d9c46b;
  --q3: #e0913f;
  --q4: #cf5b39;
  --q5: #a32f2a;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 32, 43, .06), 0 8px 24px rgba(23, 32, 43, .05);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #e8ecf1;
    --ink-soft:   #a8b4c1;
    --ink-faint:  #79868f;
    --ground:     #12171d;
    --panel:      #1a2028;
    --line:       #2c3540;
    --accent:     #6fb3dc;
    --accent-ink: #0d1218;
    --q1: #4d738b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

/* The browser's own `[hidden] { display: none }` is a type-selector rule and
 * loses to any class that sets `display` -- which is how the spinner ended up
 * visible on first paint. Anything toggled with `el.hidden` needs this. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- masthead */

.masthead { border-bottom: 1px solid var(--line); background: var(--panel); }
.masthead .wrap {
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  padding-top: .9rem; padding-bottom: .9rem;
}
.brand {
  font: 600 1.05rem/1 var(--sans); letter-spacing: .01em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: .5rem;
}
.brand-mark {
  width: 1.45rem; height: 1.45rem; flex: none;
  background: url("/mark-color.svg") center / contain no-repeat;
}
/* Two files rather than one recolored: the mark carries the aircraft and the
   ground line in off-white on a dark ground, which a filter cannot fake. */
@media (prefers-color-scheme: dark) {
  .brand-mark { background-image: url("/mark-color-dark-bg.svg"); }
}
.tagline { margin: 0; color: var(--ink-faint); font-size: .9rem; }

/* -------------------------------------------------------------------- ask */

.ask { padding: 3rem 0 2rem; max-width: 40rem; }
h1 {
  font: 600 clamp(1.7rem, 4.5vw, 2.6rem)/1.15 var(--serif);
  margin: 0 0 .75rem; text-wrap: balance; letter-spacing: -.01em;
}
.lede { margin: 0 0 1.75rem; color: var(--ink-soft); font-size: 1.05rem; max-width: 34rem; }

.row { display: flex; gap: .5rem; flex-wrap: wrap; }
input[type=text], input[type=email] {
  flex: 1 1 20rem; min-width: 0;
  padding: .8rem .9rem;
  font: inherit; color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
input[type=text]:focus-visible, input[type=email]:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button {
  padding: .8rem 1.4rem;
  font: 600 1rem/1 var(--sans);
  color: var(--accent-ink); background: var(--accent);
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer;
}
button:hover { filter: brightness(1.07); }
button[disabled] { opacity: .55; cursor: default; filter: none; }
button.ghost {
  background: transparent; color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fineprint { color: var(--ink-faint); font-size: .85rem; margin: .9rem 0 0; }
.error {
  margin: .9rem 0 0; padding: .7rem .85rem;
  color: var(--q5); font-size: .92rem;
  background: color-mix(in srgb, var(--q5) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--q5) 30%, transparent);
  border-radius: var(--radius);
}

#turnstile-slot:not(:empty) { margin-top: 1rem; }

/* ---------------------------------------------------------------- working */

.working { display: flex; align-items: center; gap: .9rem; padding: 3rem 0; color: var(--ink-soft); }
.spinner {
  width: 1.4rem; height: 1.4rem; flex: none;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}

/* ----------------------------------------------------------------- result */

.result { padding: 2rem 0 3rem; }
.result h2 { font: 600 1.6rem/1.2 var(--serif); margin: 0 0 .2rem; text-wrap: balance; }
.result h3 { font: 600 1.15rem/1.3 var(--sans); margin: 2.5rem 0 .35rem; }
.period { margin: 0 0 2rem; color: var(--ink-faint); font-size: .9rem; }
.sub { margin: 0 0 1rem; color: var(--ink-soft); font-size: .92rem; max-width: 44rem; }

.figures {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.figure { background: var(--panel); padding: 1.1rem 1.15rem 1.2rem; }
.figure-value {
  font: 600 2.1rem/1 var(--sans);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.figure-value .unit { font-size: .9rem; font-weight: 500; color: var(--ink-faint); margin-left: .2rem; }
.figure-label { margin-top: .45rem; font-size: .82rem; font-weight: 600; }
.figure-note { margin-top: .2rem; color: var(--ink-faint); font-size: .8rem; }

/* -------------------------------------------------------------------- map */

.mapbox {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
#map { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 34rem; }
#map svg { display: block; width: 100%; height: 100%; }
.legend {
  display: flex; flex-wrap: wrap; gap: .35rem .9rem;
  padding: .7rem .9rem; border-top: 1px solid var(--line);
  font-size: .78rem; color: var(--ink-soft);
}
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 1.4rem; height: 3px; border-radius: 2px; }
.attribution { margin: 0; padding: 0 .9rem .7rem; font-size: .72rem; color: var(--ink-faint); }

/* ------------------------------------------------------------------ hours */

.hours {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px;
  align-items: end; height: 8rem;
  padding: .6rem .6rem 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.hour { position: relative; height: 100%; display: flex; align-items: flex-end; }
.hour .all {
  width: 100%; background: color-mix(in srgb, var(--q1) 55%, transparent);
  border-radius: 2px 2px 0 0; position: relative;
}
.hour .loud {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--q4); border-radius: 2px 2px 0 0;
}
.hour-axis {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px;
  padding: .3rem .6rem 0; font-size: .65rem; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.hour-axis span { text-align: center; }

/* ----------------------------------------------------------------- table */

.table-scroll { overflow-x: auto; margin-top: 1.5rem; }
table.flights { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 34rem; }
table.flights th, table.flights td {
  text-align: right; padding: .5rem .7rem; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.flights th:first-child, table.flights td:first-child { text-align: left; width: 2.5rem; }
table.flights th:last-child, table.flights td:last-child { text-align: left; }
table.flights th { font-size: .78rem; color: var(--ink-faint); font-weight: 600; }
table.flights td .dot {
  display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .45rem;
}

/* ---------------------------------------------------------------- upsell */

.upsell {
  margin-top: 2.5rem; padding: 1.4rem 1.5rem;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--q3); border-radius: var(--radius);
}
.upsell h3 { margin-top: 0; }
.upsell p { color: var(--ink-soft); max-width: 42rem; }
.upsell button { margin-top: .5rem; }

/* ----------------------------------------------------------------- notify */

.notify {
  margin: 3rem 0 2rem; padding: 1.4rem 1.5rem; max-width: 40rem;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.notify h2 { font: 600 1.35rem/1.2 var(--serif); margin: 0 0 .4rem; text-wrap: balance; }
.notify > p { color: var(--ink-soft); margin: 0 0 1rem; }
.notice {
  margin: .5rem 0 0; padding: .7rem .85rem;
  color: var(--ink); font-size: .95rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius);
}

.foot {
  padding: 2rem 1.25rem 3rem; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: .8rem;
}
.foot p { max-width: 46rem; margin: 0; }
.foot p + p { margin-top: .6rem; }
.foot a { color: inherit; }
