/* Frequent Flyer · $MILES. A black grain poster: a split-flap departures board, a boarding pass under it,
   grey comp windows for the gate and the passenger. Type: Yellowtail (script), Barlow Condensed (board), IBM Plex Mono (captions). */
:root {
  --ink: #070707;
  --ink-2: #111;
  --housing: #151515;
  --line: #2c2c2c;
  --paper: #ececea;
  --paper-2: #d9d9d6;
  --text: #f2f2ef;
  --dim: #9a9a95;
  --yellow: #f6c700;
  --yellow-dim: #7a6300;
  --red: #e3342f;
  --cw: 30px;      /* flap cell width */
  --ch: 43px;      /* flap cell height */
  --cf: 28px;      /* flap letter size */
  --gap: 3px;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --board: "Barlow Condensed", "Arial Narrow", sans-serif;
  --script: "Yellowtail", cursive;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
  cursor: url("art/web/plane_cursor.png") 3 8, auto;
}
/* film grain: a halftone dot screen over the whole poster */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) .6px, transparent .8px);
  background-size: 4px 4px;
  mix-blend-mode: screen;
}
.mono { font-family: var(--mono); }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }

.terminal {
  position: relative; z-index: 1;
  width: min(1560px, 100% - 32px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

/* ---------- masthead ---------- */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "lockup meta" "line meta";
  align-items: start;
  column-gap: 24px;
  margin-bottom: 26px;
}
.lockup {
  grid-area: lockup;
  margin: 0;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .18em;
  line-height: 1.1;
}
.lockup-script {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(48px, 7.2vw, 118px);
  color: #fff;
  transform: rotate(-3deg) translateY(.06em);
  display: inline-block; line-height: 1.3; padding: 0 .12em;
  position: relative; z-index: 1;
  text-shadow: 0 0 6px #000, 0 0 2px #000;
}
.lockup-block {
  font-family: var(--board); font-weight: 700;
  font-size: clamp(50px, 7.4vw, 124px);
  letter-spacing: .02em; line-height: 1.2; padding-right: .1em;
  color: #fff;
  margin-left: -.22em;
  position: relative; z-index: 0;
  text-shadow: 3px 3px 0 #000, 5px 5px 0 #3a3a3a;
}
.masthead-line {
  grid-area: line;
  margin: 22px 0 0;
  color: var(--dim);
  font-size: 15px;
}
.masthead-line .ticker { color: var(--yellow); }
.masthead-meta {
  grid-area: meta;
  display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end;
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim);
  padding-top: 8px;
}
.masthead-meta span { position: relative; padding-left: 14px; }
.masthead-meta span::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; background: var(--dim); }
#utc-clock { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- board ---------- */
.board-wrap { margin-bottom: 30px; }
.board-nav {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  margin: 0 0 12px 2px;
}
.flapword {
  background: none; border: 0; padding: 0; margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--yellow-dim);
  cursor: inherit;
}
.flapword .flaptext { display: inline-flex; gap: 2px; }
.flapword .flap { --cw: 22px; --ch: 30px; --cf: 20px; color: var(--yellow-dim); }
.flapword.is-active .flap { color: var(--yellow); }
.flapword kbd {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); padding: 1px 5px; border-radius: 2px;
}
.sound {
  margin-left: auto;
  background: none; border: 1px solid var(--line); color: var(--dim);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 12px; min-height: 36px; cursor: inherit;
}
.sound[aria-pressed="true"] { color: var(--yellow); border-color: var(--yellow-dim); }

.board-housing {
  background: var(--housing);
  border: 1px solid #262626;
  box-shadow: inset 0 0 0 1px #000, inset 0 18px 40px -20px #000, 0 30px 60px -30px #000;
  padding: 18px 18px 12px;
}
.board-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-color: #444 #111; }
.board { display: grid; gap: 10px; min-width: max-content; }
.board-head, .board-row { display: flex; gap: 14px; align-items: center; }
.board-head { padding: 0 0 4px; border-bottom: 1px solid #242424; margin-bottom: 2px; }
.board-head span { font-size: 12px; letter-spacing: .1em; color: var(--dim); }
.grp { display: inline-flex; gap: var(--gap); }
.board-head span, .grp { width: calc(var(--n) * (var(--cw) + var(--gap)) - var(--gap)); flex: none; }
.flap {
  display: inline-grid; place-items: center;
  width: var(--cw); height: var(--ch);
  font-family: var(--board); font-weight: 600; font-size: var(--cf); line-height: 1;
  color: var(--yellow);
  background: url("art/web/flap.png") center / 100% 100% no-repeat;
  text-transform: uppercase;
  perspective: 300px;
  user-select: none;
}
.flap.is-flipping { animation: flapflip .07s linear; }
@keyframes flapflip { 0% { transform: scaleY(1); } 50% { transform: scaleY(.15); } 100% { transform: scaleY(1); } }
.board-row { position: relative; }
.board-row.is-link { cursor: inherit; }
.board-row button.rowbtn {
  position: absolute; inset: 0; background: none; border: 0; cursor: inherit; z-index: 2;
}
.board-row button.rowbtn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }
.board-row.is-blank .flap { color: transparent; }
.status-ontime .flap { color: #d7f5c5; }
.status-boarding .flap { color: var(--yellow); }
.status-delayed .flap, .status-cancelled .flap { color: #ff8a80; }
.board-caption { margin: 12px 2px 0; font-size: 12px; letter-spacing: .06em; color: var(--dim); text-transform: uppercase; }

/* ---------- boarding pass under the board ---------- */
.pass-section { display: grid; gap: 14px; justify-items: start; }
.pass {
  position: relative;
  width: min(920px, 100%);
  container-type: inline-size;
  color: #111;
}
.pass-art { width: 100%; height: auto; }
.pass-fields { position: absolute; inset: 0; }
.pf { position: absolute; display: grid; gap: .25em; }
.pf-label { font-size: clamp(9px, 1.35cqw, 12px); letter-spacing: .1em; color: #666; text-transform: uppercase; }
.pf-value { font-family: var(--board); font-weight: 700; font-size: clamp(16px, 3.6cqw, 34px); line-height: 1.15; letter-spacing: .02em; }
.pf-airline { left: 14%; top: 9%; }
.pf-flight { left: 54%; top: 9%; }
.pf-ticket { left: 14%; top: 40%; width: 56%; }
.pf-mint {
  font-size: clamp(11px, 1.6cqw, 15px); line-height: 1.35;
  word-break: break-all; overflow-wrap: anywhere; user-select: all;
}
.pf-chart { left: 14%; top: 73%; }
.pf-x { left: 30%; top: 73%; }
.pf-copy {
  position: absolute; left: 52%; top: 73%;
  background: #111; color: var(--paper); border: 0;
  font-size: clamp(10px, 1.4cqw, 13px); letter-spacing: .12em;
  padding: .55em 1em; min-height: 32px; cursor: inherit;
}
.pf-copy:disabled { background: #b9b9b6; color: #555; }
.pf-copynote { position: absolute; left: 63%; top: 74%; font-size: clamp(9px, 1.3cqw, 12px); color: #444; max-width: 20%; }
.mark {
  display: inline-grid; place-items: center;
  width: clamp(30px, 4.6cqw, 44px); height: clamp(30px, 4.6cqw, 44px);
  background: #111; border-radius: 3px;
  transition: transform .08s;
}
.mark img { width: 56%; height: 56%; object-fit: contain; }
.mark-dex img { filter: invert(1) brightness(1.6); }
.mark:active { transform: translateY(1px); }
.mark[aria-disabled="true"] { background: #bcbcb9; pointer-events: none; }
.mark[aria-disabled="true"] img { opacity: .5; }
.pass-stub {
  position: absolute; left: 77.5%; top: 6%; width: 20%; height: 88%;
  display: grid; align-content: center; justify-items: center; gap: .5em;
  text-decoration: none; color: #111; text-align: center;
  border-left: 1px dashed transparent;
  transition: transform .08s;
}
.pass-stub img { width: clamp(22px, 4cqw, 40px); height: auto; }
.pass-stub b { display: block; font-family: var(--board); font-weight: 700; font-size: clamp(14px, 3cqw, 28px); line-height: 1.15; }
.pass-stub small { display: block; font-size: clamp(9px, 1.3cqw, 12px); letter-spacing: .08em; text-transform: uppercase; color: #555; }
.pass-stub:hover { transform: translateY(-1px); }
.pass-stub:active { transform: translateY(1px); }
.pass-stub[aria-disabled="true"] { pointer-events: none; opacity: .45; }
.pass-under { display: none; }

/* ---------- windows (dialogs) ---------- */
.win {
  padding: 0; border: 1px solid #000;
  background: var(--ink-2); color: var(--text);
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-shadow: 0 0 0 1px #3a3a3a, 0 40px 80px -30px #000;
  translate: var(--dx, 0) var(--dy, 0);
  overflow: hidden;
  display: none;
}
.win[open] { display: grid; grid-template-rows: auto 1fr; }
.win::backdrop { background: rgba(0,0,0,.72); }
.win-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper-2); color: #111;
  padding: 0 0 0 14px; height: 40px;
  font-family: var(--mono); font-size: 16px;
  touch-action: none; user-select: none;
}
.win-bar[data-drag] { cursor: inherit; }
.win-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-close {
  width: 48px; height: 40px; border: 0; border-left: 1px solid #111;
  background: var(--red); color: #fff; font-size: 26px; line-height: 1; cursor: inherit;
}
.win-close:active { filter: brightness(.9); }
.win-body { overflow: auto; padding: 20px; }

/* gate */
.gate { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-areas: "photo panel" "rules rules"; gap: 20px; }
.gate-photo { grid-area: photo; margin: 0; border: 1px solid #333; background: #000; align-self: start; }
.gate-photo img { width: 100%; height: auto; }
.gate-panel { grid-area: panel; display: grid; gap: 16px; align-content: start; }
.gate-livery { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.gate-livery img { width: 88px; height: auto; }
.gate-stats, .passenger-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.gate-stats div, .passenger-stats div { border-top: 1px solid var(--line); padding-top: 8px; min-width: 0; }
.gate-stats dt, .passenger-stats dt { font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.gate-stats dd, .passenger-stats dd { margin: 3px 0 0; font-family: var(--board); font-weight: 600; font-size: 24px; line-height: 1.1; color: var(--yellow); overflow-wrap: anywhere; }
.gate-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 18px;
  background: var(--paper); color: #111; border: 0;
  font-family: var(--board); font-weight: 700; font-size: 20px; letter-spacing: .03em; text-transform: uppercase;
  text-decoration: none; cursor: inherit;
  transition: transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; pointer-events: none; }
.btn img { width: 22px; height: 22px; }
.gate-note, .redeem-note, .lookup-note { color: var(--dim); font-size: 13px; margin: 0; }
.gate-rules { grid-area: rules; border-top: 1px solid var(--line); padding-top: 16px; }
.gate-rules h2, .passenger h2 { font-size: 12px; letter-spacing: .12em; color: var(--dim); margin: 18px 0 10px; font-weight: 500; }
.rules { margin: 0; padding-left: 22px; font-size: 15px; max-width: 78ch; }
.rules li { margin: 6px 0; }
.rules b { color: var(--yellow); font-weight: 500; }
.seals { display: flex; gap: 26px; flex-wrap: wrap; margin: 18px 0 6px; }
.seals figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.seals img { width: 80px; height: 80px; }
.seals figcaption { font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.receipts, .cancelled { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--dim); }
.receipts li, .cancelled li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.receipts a { color: var(--text); }

/* passenger */
.lookup { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; }
.lookup label { font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.lookup input {
  min-height: 48px; padding: 8px 12px;
  background: #000; color: var(--text); border: 1px solid var(--line);
  font-size: 14px; min-width: 0;
}
.lookup-note { grid-column: 1 / -1; }
.passenger-result { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 20px; }
.pass-card-wrap { display: grid; gap: 12px; align-content: start; }
#pass-canvas { width: 100%; height: auto; }
.pass-card-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.passenger h2:first-of-type { margin-top: 0; }
.passenger-result > h2, .passenger-result > ul { grid-column: 1 / -1; }
.cancelled li { display: flex; gap: 10px; align-items: center; }
.cancelled li img { width: 28px; height: 28px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .flap.is-flipping { animation: none; }
  .btn, .mark, .pass-stub { transition: none; }
}

/* ---------- widths ---------- */
@media (max-width: 1600px) { :root { --cw: 25px; --ch: 37px; --cf: 23px; } }
@media (max-width: 1440px) { :root { --cw: 24px; --ch: 35px; --cf: 22px; } }
@media (max-width: 1100px) {
  :root { --cw: 26px; --ch: 38px; --cf: 24px; }
  .gate { grid-template-columns: 1fr; grid-template-areas: "photo" "panel" "rules"; }
  .passenger-result { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .win { width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; translate: none; max-width: none; }
  .win-body { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .masthead { grid-template-columns: 1fr; grid-template-areas: "lockup" "line" "meta"; }
  .masthead-meta { justify-content: flex-start; padding-top: 12px; }
}
@media (max-width: 720px) {
  :root { --cw: 18px; --ch: 27px; --cf: 17px; --gap: 2px; }
  .board { min-width: 0; }
  .board-row { width: 100%; }
  .lockup { display: grid; justify-items: start; }
  .lockup-script { font-size: 54px; }
  .lockup-block { font-size: 62px; margin: -.28em 0 0 .9em; }
  .terminal { width: calc(100% - 32px); padding-top: 20px; }
  .board-housing { padding: 12px 10px 8px; }
  .board { gap: 12px; }
  .board-head { display: none; }
  .board-row { flex-wrap: wrap; gap: 6px 8px; }
  .board-row:nth-child(n+5) { display: none; }   /* three blank rows are enough on a phone */
  .grp { position: relative; padding-top: 14px; }
  .board-row:not(:first-child) .grp { padding-top: 0; }
  .board-row.is-blank .grp[data-col="rate"], .board-row.is-blank .grp[data-col="pool"] { display: none; }
  .board-row:not(:first-child) .grp::before { display: none; }
  .grp::before { content: attr(data-label); position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--dim); }
  .grp[data-col="airline"] { display: none; }
  .grp[data-col="status"] { order: 3; }
  .grp[data-col="rate"] { order: 4; }
  .grp[data-col="pool"] { order: 5; }
  .board-nav { gap: 14px; }
  .flapword .flap { --cw: 17px; --ch: 24px; --cf: 16px; }
  .flapword kbd { display: none; }
  .sound { margin-left: 0; width: 100%; }
  .pf-ticket, .pf-copy, .pf-copynote { display: none; }
  .pf-chart { top: 62%; }
  .pf-x { top: 62%; left: 34%; }
  .pass-under { display: grid; gap: 6px; width: 100%; padding: 12px; border: 1px solid var(--line); font-size: 13px; }
  .pass-under .pf-label { font-size: 10px; }
  .pass-under code { word-break: break-all; user-select: all; font-size: 13px; line-height: 1.4; }
  .pf-copy-under { justify-self: start; background: var(--paper); color: #111; border: 0; min-height: 44px; padding: 8px 18px; letter-spacing: .12em; cursor: inherit; }
  .pf-copy-under:disabled { opacity: .45; }
  .lookup { grid-template-columns: 1fr 1fr; }
  .lookup label { grid-column: 1 / -1; }
  .lookup input { grid-column: 1 / -1; }
  .gate-stats, .passenger-stats { grid-template-columns: 1fr 1fr; }
  .gate-stats dd, .passenger-stats dd { font-size: 20px; }
  .rules { padding-left: 18px; font-size: 14px; }
}
@media (max-width: 380px) {
  :root { --cw: 18px; --ch: 26px; --cf: 16px; }
  .gate-stats, .passenger-stats { grid-template-columns: 1fr; }
}
