/* Departure-board theme, light. Same palette as tauseefhussain.com. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  --board: #f4f4f0;
  --panel: #ffffff;
  --tile: #e6e6e0;
  --rule: #e2e2dc;
  --ink: #16181c;
  --dim: #5b616b;
  --yellow: #ffd200;
  --route: #16181c;
  --land: #e4e4dd;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--board); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
a { color: inherit; }
.wrap { max-width: 66rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- Wayfinding sign ---------- */
.sign { position: sticky; top: 0; z-index: 10; background: var(--yellow); color: #111; padding-top: env(safe-area-inset-top); }
.sign-inner {
  max-width: 66rem; margin: 0 auto; padding: 0.65rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem;
  font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1;
}
@media (min-width: 48rem) { .sign-inner { padding: 0.7rem 2rem; gap: 2rem; font-size: 1.35rem; } }
.sign a { text-decoration: none; }
.sign a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.brand { display: inline-flex; align-items: center; gap: 0.45rem; }
.arrow { background: #111; color: var(--yellow); width: 1.5rem; height: 1.5rem; display: inline-grid; place-items: center; border-radius: 3px; font-size: 0.95rem; }
.sign-nav { display: flex; gap: 1.1rem; }
.home { margin-left: auto; font-weight: 500; }
@media (max-width: 30rem) { .home { display: none; } .sign-nav { margin-left: auto; } }

/* ---------- Intro ---------- */
.intro { padding: 3rem 1.25rem 1.5rem; }
@media (min-width: 48rem) { .intro { padding: 4.5rem 2rem 2rem; } }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1; margin: 0 0 0.9rem; letter-spacing: -0.01em; }
.lede { color: var(--dim); font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 34rem; }

/* ---------- Year chips ---------- */
.years { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.4rem 0 0.8rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.years::-webkit-scrollbar { display: none; }
.years button {
  flex: none; border: 0; cursor: pointer; font: 600 1.05rem/1 var(--display);
  padding: 0.55rem 0.8rem; border-radius: 4px; background: var(--tile); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.years button[aria-selected="true"] { background: var(--ink); color: var(--yellow); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; padding-top: 0.5rem; padding-bottom: 3rem; }
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(4, 1fr); gap: 0.8rem; } }
.stat { background: var(--panel); border-radius: 6px; padding: 0.9rem 1rem 0.85rem; box-shadow: 0 1px 0 var(--rule); }
.stat .v { font: 700 clamp(1.9rem, 5vw, 2.6rem)/1 var(--display); font-variant-numeric: tabular-nums; display: block; }
.stat .k { font: 600 0.8rem/1.2 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin-top: 0.45rem; display: block; }
.stat .s { font-size: 0.85rem; color: var(--dim); display: block; margin-top: 0.2rem; }

/* ---------- Board titles ---------- */
.board-title { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.board-title h2 {
  margin: 0; font: 700 1.25rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--ink); color: var(--yellow); padding: 0.45rem 0.7rem; border-radius: 3px;
}
.board-sub { color: var(--dim); font-size: 0.95rem; }
section + section { margin-top: 0; }
#map, #fleet, #log { padding-bottom: 3.5rem; }

/* ---------- Map ---------- */
.map-card { position: relative; background: var(--panel); border-radius: 6px; box-shadow: 0 1px 0 var(--rule); overflow: hidden; }
.map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.map-scroll::-webkit-scrollbar { display: none; }
#mapsvg { display: block; width: 100%; min-width: 46rem; height: auto; touch-action: pan-x pan-y; }
.map-hint { display: none; position: absolute; right: 0.6rem; bottom: 0.5rem; font-size: 0.75rem; color: var(--dim); background: rgba(255,255,255,.85); padding: 0.15rem 0.4rem; border-radius: 3px; pointer-events: none; }
@media (max-width: 46rem) { .map-hint { display: block; } }
#mapsvg .land { fill: var(--land); stroke: #fff; stroke-width: 0.6; }
#mapsvg .route { fill: none; stroke: var(--route); stroke-linecap: round; opacity: 0.55; transition: opacity .15s, stroke .15s; }
#mapsvg .route.hot { stroke: #c49b00; opacity: 1; }
#mapsvg .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
#mapsvg .apt { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.4; }
#mapsvg .apt-label { font: 600 12px var(--display); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; letter-spacing: 0.04em; pointer-events: none; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 4px;
  padding: 0.4rem 0.6rem; font-size: 0.85rem; line-height: 1.3; white-space: nowrap; transform: translate(-50%, -120%);
}
.tip b { font-family: var(--display); font-size: 1rem; color: var(--yellow); letter-spacing: 0.03em; }

.top-routes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.8rem; }
@media (min-width: 40rem) { .top-routes { grid-template-columns: repeat(3, 1fr); } }
.route-chip { background: var(--panel); border-radius: 6px; padding: 0.7rem 0.9rem; box-shadow: 0 1px 0 var(--rule); display: flex; align-items: center; gap: 0.8rem; }
.route-chip .codes { font: 700 1.2rem/1 var(--display); letter-spacing: 0.04em; white-space: nowrap; }
@media (min-width: 40rem) { .route-chip .codes { font-size: 1.35rem; } }
.route-chip .codes i { font-style: normal; color: var(--dim); margin: 0 0.2rem; }
.route-chip .n { margin-left: auto; font: 600 1rem/1 var(--display); background: var(--tile); border-radius: 3px; padding: 0.3rem 0.45rem; font-variant-numeric: tabular-nums; }
.route-chip .cities { font-size: 0.82rem; color: var(--dim); display: block; margin-top: 0.15rem; }

@media (max-width: 40rem) { .route-chip { padding: 0.6rem 0.7rem; gap: 0.4rem; } .route-chip .cities { display: none; } }

/* ---------- Fleet bars ---------- */
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .two-col { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.bars li {
  background: var(--panel); border-radius: 5px; box-shadow: 0 1px 0 var(--rule);
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 0.7rem;
  padding: 0.45rem 0.75rem; position: relative; overflow: hidden;
}
.bars li .fill { position: absolute; inset: auto auto 0 0; height: 3px; background: var(--yellow); }
.bars img { width: 2rem; height: 2rem; object-fit: contain; }
.bars .badge { width: 2rem; height: 2rem; border-radius: 4px; background: var(--tile); display: grid; place-items: center; font: 700 0.75rem/1 var(--display); color: var(--dim); }
.bars .name { font-weight: 500; line-height: 1.2; }
.bars .name small { display: block; color: var(--dim); font-size: 0.8rem; font-weight: 400; }
.bars .n { font: 700 1.3rem/1 var(--display); font-variant-numeric: tabular-nums; }

/* ---------- Flight log ---------- */
.board { background: var(--panel); border-radius: 6px; box-shadow: 0 1px 0 var(--rule); overflow: hidden; }
.row {
  display: grid; grid-template-columns: 4.2rem 1fr auto; grid-template-areas: "when route km" "when flight ac";
  gap: 0.1rem 0.8rem; padding: 0.7rem 0.9rem; border-top: 1px solid var(--rule); align-items: center;
}
.row .when { grid-area: when; font: 600 1rem/1.15 var(--display); color: var(--dim); text-transform: uppercase; letter-spacing: 0.04em; }
.row .when b { display: block; color: var(--ink); font-size: 1.15rem; }
.row .flight { grid-area: flight; display: flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--dim); }
.row .flight img { width: 1.2rem; height: 1.2rem; object-fit: contain; }
.row .route { grid-area: route; font: 700 1.3rem/1.1 var(--display); letter-spacing: 0.04em; }
.row .route i { font-style: normal; color: var(--dim); margin: 0 0.25rem; }
.row .route small { font: 400 0.82rem var(--body); color: var(--dim); letter-spacing: 0; margin-left: 0.4rem; }
.row .ac { grid-area: ac; font-size: 0.88rem; color: var(--dim); text-align: right; }
.row .km { grid-area: km; font: 600 1rem/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.row.head { display: none; }
.trip-sep { border-top: 2px solid var(--tile); }
@media (max-width: 30rem) { .row .route small { display: none; } }

@media (min-width: 48rem) {
  .row { grid-template-columns: 6rem 11rem 1fr 10rem 4.5rem; grid-template-areas: "when flight route ac km"; padding: 0.6rem 1rem; }
  .row .when b { display: inline; margin-right: 0.3rem; }
  .row .ac { text-align: left; }
  .row.head { display: grid; border-top: 0; background: var(--ink); color: var(--yellow); font: 600 0.85rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.1em; padding: 0.7rem 1rem; }
  .row.head span:nth-child(1) { grid-area: when; } .row.head span:nth-child(2) { grid-area: flight; }
  .row.head span:nth-child(3) { grid-area: route; } .row.head span:nth-child(4) { grid-area: ac; }
  .row.head span:nth-child(5) { grid-area: km; }
  .row.head .num { text-align: right; }
}

/* ---------- Footer ---------- */
.foot { padding-top: 1rem; padding-bottom: calc(3rem + env(safe-area-inset-bottom)); color: var(--dim); font-size: 0.85rem; }
.foot a { color: var(--dim); }

/* ---------- v2: motion, flags, planes, countries, boarding pass ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .stat, .route-chip, .stamp, .bars li { animation: rise .5s ease-out both; }
  .bars li .fill { transition: width .8s cubic-bezier(.3,.6,.3,1); }
}
.bars li .fill { width: var(--w); }
.tflag { width: 1rem; height: .75rem; border-radius: 2px; vertical-align: -1px; }

.mini-flags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .35rem; }
.mini-flags .flag, .flag { width: 1.1rem; height: .82rem; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); vertical-align: -1px; }
.route-chip { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.route-chip:hover { box-shadow: 0 0 0 2px var(--yellow); }
.route-chip .cities .flag { margin-right: 1px; }
.rflag { width: .95rem; height: .72rem; border-radius: 2px; object-fit: cover; margin-right: .25rem; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* Countries as passport stamps */
#countries-sec { padding-bottom: 3.5rem; }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 40rem) { .stamps { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 60rem) { .stamps { grid-template-columns: repeat(4, 1fr); } }
.stamp { background: var(--panel); border-radius: 6px; box-shadow: 0 1px 0 var(--rule); padding: .8rem .9rem; display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; align-items: center; }
.big-flag { grid-row: span 3; width: 2.6rem; height: 1.95rem; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.cname { font: 700 1.15rem/1.1 var(--display); letter-spacing: .02em; }
.cmeta { font: 600 .85rem/1.3 var(--display); color: var(--dim); letter-spacing: .06em; }
.cfirst { font-size: .78rem; color: var(--dim); }

/* Aircraft rows with renders */
.al-logo { width: 2rem; height: 2rem; object-fit: contain; }
.bars li.ac-row { grid-template-columns: 9.5rem 1fr auto; padding-top: .35rem; padding-bottom: .35rem; }
.ac-pic { display: block; height: 3.2rem; }
.ac-pic .plane-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.plane-img { display: block; }
.row-plane { display: none; }
@media (min-width: 48rem) { .row-plane { display: inline-block; height: 1.15rem; width: auto; vertical-align: middle; margin-right: .45rem; } .row .ac { white-space: nowrap; overflow: hidden; } }

/* Log rows are buttons now */
.row { width: 100%; border: 0; border-top: 1px solid var(--rule); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.row:hover { background: #fbfbf8; }
button.row:hover .route { color: #000; }

/* Boarding pass */
.pass { border: 0; padding: 0; background: transparent; max-width: 30rem; width: calc(100% - 1.5rem); margin: auto; }
.pass::backdrop { background: rgba(22,24,28,.55); }
@media (max-width: 40rem) { .pass { margin: auto 0 0; width: 100%; max-width: none; } .pass-card { border-radius: 14px 14px 0 0; padding-bottom: calc(1.2rem + env(safe-area-inset-bottom)); } }
.pass[open] .pass-card { animation: rise .3s ease-out; }
.pass-card { position: relative; background: var(--panel); border-radius: 12px; padding: 1.2rem 1.2rem 1rem; color: var(--ink); max-height: 92vh; overflow-y: auto; }
.pass-close { position: absolute; top: .6rem; right: .6rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: var(--tile); font: 600 1.4rem/1 var(--body); cursor: pointer; color: var(--ink); }
.pass-top { display: flex; align-items: center; gap: .75rem; padding-right: 2.5rem; }
.pass-logo { width: 2.6rem; height: 2.6rem; object-fit: contain; }
.pass-top b { display: block; font: 700 1.25rem/1.1 var(--display); }
.pass-top span { color: var(--dim); font-size: .9rem; }
.pass-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 1.1rem 0 .6rem; }
.pass-route .end { display: flex; flex-direction: column; align-items: flex-start; }
.pass-route .end.r { align-items: flex-end; }
.pass-route .code { font: 700 3rem/1 var(--display); letter-spacing: .02em; margin-top: .3rem; }
.pass-route .cty { color: var(--dim); font-size: .9rem; }
.pflag { width: 1.6rem; height: 1.2rem; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.pass-route .mid { display: flex; align-items: center; gap: .3rem; color: var(--dim); padding: 0 .4rem; }
.pass-route .dash { width: 1.6rem; border-top: 2px dotted var(--dim); }
.pass-route .pl { font-size: 1.2rem; color: var(--ink); }
.pass-map { width: 100%; height: auto; display: block; background: #f7f7f3; border-radius: 8px; }
.pass-map .land { fill: var(--land); stroke: #fff; stroke-width: .6; }
.pass-map .leg { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.pass-map .apt { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.6; }
.pass-plane { margin: 1rem auto .5rem; }
.pass-plane .plane-img { width: 100%; max-height: 9rem; object-fit: contain; margin: 0 auto; }
.pass-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .4rem 0 0; border-top: 2px dashed var(--rule); padding-top: .8rem; }
.pass-facts dt { font: 600 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.pass-facts dd { margin: .3rem 0 0; font: 700 1.2rem/1.1 var(--display); }

@media (max-width: 30rem) { .pass-facts { grid-template-columns: repeat(2, 1fr); row-gap: .8rem; } }
