/* ============================================================
   whenisgraceinmelbournenext.com
   Aesthetic brief: airport hazard tape meets 2004 novelty website.
   Restraint is not a goal here.
   ============================================================ */

:root {
  --ink: #111111;
  --paper: #f4f1e8;
  --hazard: #ffd400;
  --qantas: #e40000;
  --jetstar: #ff5400;
  --board: #0a0a0a;
  --board-text: #ffb000;
  --green: #00b140;
}

*, *::before, *::after { box-sizing: border-box; }

/* Class-based display rules outrank the UA stylesheet, so say it louder. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0 1px, transparent 1px 4px);
  color: var(--ink);
  font-family: "Space Mono", ui-monospace, "Courier New", monospace;
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

h1, h2 {
  font-family: "Archivo Black", "Arial Black", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: -.02em;
  line-height: .95;
  margin: 0;
}

/* --- hazard tape ------------------------------------------------------- */

.hazard {
  height: 26px;
  background: repeating-linear-gradient(
    45deg,
    var(--hazard) 0 22px,
    var(--ink) 22px 44px
  );
  border-block: 3px solid var(--ink);
}
.hazard--top { border-top: none; }
.hazard--bottom { border-bottom: none; }

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

.masthead { text-align: center; padding: 44px 0 22px; }

.masthead h1 {
  font-size: clamp(30px, 7.2vw, 76px);
  text-wrap: balance;
}

.tagline {
  font-size: clamp(13px, 2vw, 17px);
  text-transform: uppercase;
  letter-spacing: .28em;
  margin: 16px 0 0;
  opacity: .65;
}

/* --- THE ANSWER -------------------------------------------------------- */

.answer {
  border: 6px solid var(--ink);
  background: #fff;
  box-shadow: 12px 12px 0 var(--ink);
  padding: 34px 22px 40px;
  margin: 16px 0 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.answer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: repeating-linear-gradient(45deg, var(--hazard) 0 12px, var(--ink) 12px 24px);
}

.answer__label {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: clamp(11px, 2.2vw, 15px);
  font-weight: 700;
  margin-bottom: 14px;
  opacity: .7;
}

.answer__big {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(46px, 15vw, 150px);
  line-height: .88;
  text-transform: uppercase;
  word-break: break-word;
  text-wrap: balance;
}

.answer__sub {
  margin-top: 18px;
  font-size: clamp(14px, 2.6vw, 20px);
  text-wrap: balance;
}

/* states */
.answer.is-home        { background: #eafff0; }
.answer.is-home .answer__big { color: var(--green); }
.answer.is-airborne    { background: #fff7e6; }
.answer.is-airborne .answer__big { color: var(--jetstar); }
.answer.is-nothing .answer__big  { color: var(--qantas); }
.answer.is-soon .answer__big     { color: var(--ink); }

/* --- countdown --------------------------------------------------------- */

.countdown {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.unit {
  background: var(--board);
  color: var(--board-text);
  border: 3px solid var(--ink);
  min-width: 96px;
  padding: 12px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.unit__num {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(26px, 6vw, 44px);
  line-height: 1;
}

.unit__lab {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 10px;
  margin-top: 8px;
  opacity: .75;
}

/* --- stupid units ------------------------------------------------------ */

.units {
  display: block;
  margin: 22px auto 0;
  padding: 10px 18px;
  background: transparent;
  border: 2px dashed var(--ink);
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  max-width: 100%;
}
.units:hover, .units:focus-visible { background: var(--hazard); }
.units #units-text {
  display: block;
  font-size: clamp(14px, 2.4vw, 19px);
  font-weight: 700;
}
.units__hint {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .5;
}

/* --- live over the Nullarbor ------------------------------------------- */

.track {
  border: 4px solid var(--ink);
  background: #fff;
  padding: 20px 18px 16px;
  margin-bottom: 52px;
  box-shadow: 8px 8px 0 rgba(0,0,0,.15);
}

.track__label {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 11px;
  font-weight: 700;
  opacity: .6;
}

.track__svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
  overflow: visible;
}

.track__port { fill: var(--ink); }
#track-flown { color: var(--jetstar); stroke: var(--jetstar); }
#track-plane-shape { fill: var(--ink); }

.track__mark { font-family: "Space Mono", monospace; font-size: 15px; fill: currentColor; opacity: .55; }
.track__mark--near { opacity: 1; font-weight: 700; fill: var(--jetstar); }
.track__tick { stroke: currentColor; stroke-width: 2; opacity: .3; }

.track__status {
  margin: 10px 0 0;
  font-size: clamp(14px, 2.4vw, 19px);
  font-weight: 700;
  text-wrap: balance;
}

.track__pedant {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: .5;
  line-height: 1.5;
  text-wrap: balance;
}

/* --- boarding pass ----------------------------------------------------- */

.pass-wrap { margin-bottom: 52px; }

.pass-label {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  font-weight: 700;
  opacity: .55;
  margin: 0 0 10px;
}

.pass {
  display: grid;
  grid-template-columns: 190px 1fr;
  background: #fff;
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 rgba(0,0,0,.18);
  transform: rotate(-.7deg);
}

.pass__stub {
  border-right: 4px dashed var(--ink);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--hazard);
}

.pass__airline {
  font-family: "Archivo Black", sans-serif;
  font-size: 15px;
  letter-spacing: .12em;
}

.pass__flightno {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1;
}

.pass__barcode {
  margin-top: auto;
  height: 54px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px, transparent 2px 4px,
    var(--ink) 4px 7px, transparent 7px 9px,
    var(--ink) 9px 10px, transparent 10px 14px
  );
}

.pass__body { padding: 18px 20px; }

.pass__route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.port__code {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1;
}
.port__city { text-transform: uppercase; font-size: 11px; letter-spacing: .16em; opacity: .6; }
.port__time { font-weight: 700; margin-top: 6px; font-size: clamp(13px, 2.4vw, 16px); }

.port__plane {
  font-size: clamp(22px, 5vw, 34px);
  animation: taxi 3.2s ease-in-out infinite;
}

@keyframes taxi {
  0%, 100% { transform: translateX(-6px); }
  50%      { transform: translateX(6px); }
}

.pass__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.pass__meta dt { text-transform: uppercase; font-size: 10px; letter-spacing: .16em; opacity: .55; }
.pass__meta dd { margin: 3px 0 0; font-weight: 700; font-size: 14px; }

/* --- stats ------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 52px;
}

.stat {
  border: 3px solid var(--ink);
  background: #fff;
  padding: 18px 14px;
  text-align: center;
}

.stat__num {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__lab {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .1em;
  margin-top: 10px;
  opacity: .65;
  line-height: 1.4;
}

/* --- departure board --------------------------------------------------- */

.board { margin-bottom: 52px; }

.board h2 { font-size: clamp(20px, 4vw, 32px); margin-bottom: 14px; }

.board__inner {
  background: var(--board);
  color: var(--board-text);
  border: 4px solid var(--ink);
  padding: 4px;
  overflow-x: auto;
}

.board__head, .board__row {
  display: grid;
  grid-template-columns: 96px minmax(150px, 1fr) 150px 150px 130px;
  gap: 10px;
  padding: 12px 14px;
  align-items: center;
  min-width: 660px;
}

.board__head {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .2em;
  opacity: .55;
  border-bottom: 1px solid rgba(255,176,0,.3);
}

.board__row { border-bottom: 1px dashed rgba(255,176,0,.18); font-size: 14px; }
.board__row:last-child { border-bottom: none; }
.board__row.is-past { opacity: .38; }
.board__row .flightno { font-weight: 700; }
.board__row .tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid currentColor;
}
.tag--home { color: var(--green); }
.tag--away { color: var(--jetstar); }
.tag--past { color: #888; }

.board__note { font-size: 13px; opacity: .6; margin-top: 12px; }

/* --- subscribe --------------------------------------------------------- */

.subscribe {
  border: 4px solid var(--ink);
  background: var(--hazard);
  padding: 26px 22px;
  margin-bottom: 52px;
  text-align: center;
}

.subscribe h2 { font-size: clamp(20px, 4vw, 32px); margin-bottom: 12px; }

.subscribe__blurb {
  margin: 0 auto 20px;
  max-width: 52ch;
  font-size: 15px;
  text-wrap: balance;
}

.subscribe__button {
  display: inline-block;
  background: var(--ink);
  color: var(--hazard);
  font-family: "Archivo Black", "Arial Black", sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: clamp(15px, 3vw, 21px);
  padding: 16px 30px;
  text-decoration: none;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0,0,0,.25);
}
.subscribe__button:hover, .subscribe__button:focus-visible {
  background: #fff;
  color: var(--ink);
}

.subscribe__url {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px auto 0;
  max-width: 100%;
}
.subscribe__url code {
  background: #fff;
  border: 2px solid var(--ink);
  padding: 9px 12px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
  text-align: left;
}
.subscribe__url button {
  border: 2px solid var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 9px 16px;
  cursor: pointer;
}
.subscribe__url button:hover { background: var(--ink); color: var(--hazard); }

.subscribe__note {
  margin: 18px auto 0;
  max-width: 56ch;
  font-size: 12px;
  opacity: .7;
  line-height: 1.6;
  text-wrap: balance;
}

/* --- faq --------------------------------------------------------------- */

.faq { margin-bottom: 52px; }
.faq h2 { font-size: clamp(20px, 4vw, 32px); margin-bottom: 16px; }

.faq details {
  border: 3px solid var(--ink);
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: "Archivo Black", sans-serif; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; }

/* --- footer ------------------------------------------------------------ */

footer {
  text-align: center;
  border-top: 3px solid var(--ink);
  padding-top: 26px;
}
.footer__line { margin: 6px 0; font-size: 13px; }
.footer__line.small { opacity: .55; font-size: 12px; }

/* --- responsive -------------------------------------------------------- */

@media (max-width: 620px) {
  .pass { grid-template-columns: 1fr; transform: none; }
  .pass__stub {
    border-right: none;
    border-bottom: 4px dashed var(--ink);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .pass__barcode { margin: 0; width: 90px; height: 40px; }
  /* Four boxes in a row is three too many on a phone. */
  .countdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit { min-width: 0; }
  /* Too many place names to fit across a phone. */
  .track__mark--optional { display: none; }
  .track__pedant { font-size: 11px; }
  .answer { box-shadow: 7px 7px 0 var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
