:root {
  --paper: #F2F5F7;
  --ink: #12233A;
  --muted: #586A80;
  --line: #CDD7E1;
  --red: #C33A2F;
  --blue: #1E3E8C;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1623;
    --ink: #E6ECF3;
    --muted: #97A7BA;
    --line: #233349;
    --red: #E8594D;
    --blue: #86A4F2;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* The one loud thing: an airmail envelope edge */
.airmail {
  height: 12px;
  background: repeating-linear-gradient(-45deg,
    var(--red) 0 16px, var(--paper) 16px 24px,
    var(--blue) 24px 40px, var(--paper) 40px 48px);
}

main {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 3rem;
}

.who h1 {
  font: 600 1.25rem/1.2 var(--display);
  margin: 0;
}
.who p { margin: .25rem 0 0; color: var(--muted); }

.now { margin: 2.75rem 0 2.5rem; }
.now .lede { margin: 0; color: var(--muted); }
.now .place {
  margin: 0;
  font: 800 clamp(3rem, 15vw, 5.25rem)/0.95 var(--display);
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
  overflow-wrap: anywhere;
}
.now .sub { margin: .75rem 0 0; font-size: 1.125rem; }
.now .status {
  margin: 1rem 0 0;
  padding-left: .75rem;
  border-left: 3px solid var(--red);
}
.now .next { margin: 1.25rem 0 0; color: var(--muted); }

.route {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1.25rem;
}
.route .code { font: 600 1.375rem/1 var(--display); letter-spacing: .02em; }
.route .track { position: relative; flex: 1; height: 2px; background: var(--line); }
.route .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--blue); }
.route .plane {
  position: absolute; top: 50%; left: 0;
  transform: translate(-50%, -54%);
  color: var(--blue); font-size: 1.1rem; line-height: 1;
}

/* Links: plain, large, easy to hit */
.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .125rem 1rem;
  padding: 1.05rem .25rem;
  color: inherit; text-decoration: none;
}
.links .label { font: 600 1.375rem/1.25 var(--display); }
.links .note { color: var(--muted); font-size: .95rem; }
.links a:hover .label { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

h2 {
  font: 600 1.0625rem/1.3 var(--display);
  margin: 3rem 0 .75rem;
  color: var(--muted);
}

.trips, .legs, .events { list-style: none; margin: 0; padding: 0; }
.trip {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.trip .when { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.trip .where { margin: 0; font: 600 1.25rem/1.25 var(--display); }
.legs { margin-top: .4rem; }
.legs li {
  display: flex; flex-wrap: wrap; gap: 0 .75rem;
  font-size: .9375rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.legs .pair { color: var(--ink); font-weight: 500; }
.legs sup { font-size: .7em; margin-left: .1em; }

.events li {
  display: grid; grid-template-columns: 11.5rem 1fr; gap: 1rem;
  padding: .75rem 0; border-top: 1px solid var(--line);
}
.events .when { color: var(--muted); font-variant-numeric: tabular-nums; }

footer { margin-top: 3.5rem; color: var(--muted); font-size: .875rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 30rem) {
  main { padding-top: 2rem; }
  .trip, .events li { grid-template-columns: 1fr; gap: .25rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .route .fill, .route .plane { transition: width 1s linear, left 1s linear; }
}

/* ── Photo as a postage stamp ── */
:root { --stamp-paper: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root { --stamp-paper: #E9EEF4; } }
.who.has-photo { display: flex; align-items: center; gap: 1.25rem; }
.stamp {
  position: relative; flex: none;
  width: 108px; height: 132px;
  transform: rotate(-3deg);
  filter: drop-shadow(0 1px 1.5px rgba(18, 35, 58, .25));
}
.stamp::before {
  content: ""; position: absolute; inset: 0;
  background: var(--stamp-paper);
  -webkit-mask: radial-gradient(circle 4px at center, #0000 95%, #000) -6px -6px / 12px 12px;
          mask: radial-gradient(circle 4px at center, #0000 95%, #000) -6px -6px / 12px 12px;
}
.stamp img {
  position: absolute; inset: 9px;
  width: calc(100% - 18px); height: calc(100% - 18px);
  object-fit: cover; display: block;
}
.stamp.empty::after {
  content: ""; position: absolute; inset: 9px;
  border: 1.5px dashed var(--line);
}

/* ── Recommendations link + page ── */
.links .feature .label { color: var(--red); }
.back { margin: 0 0 2rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--ink); text-decoration: underline; }
.page-title { font: 800 clamp(2.25rem, 9vw, 3.25rem)/1 var(--display); letter-spacing: -0.03em; margin: 0; }
.intro { color: var(--muted); margin: .75rem 0 0; }
.empty { margin-top: 2rem; }
.recs { list-style: none; margin: 0; padding: 0; }
.recs li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.recs .rec-title {
  font: 600 1.375rem/1.25 var(--display); color: inherit;
  text-decoration: underline; text-decoration-color: var(--line);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.recs .rec-title:hover { text-decoration-color: var(--red); }
.recs p { margin: .35rem 0 0; max-width: 60ch; }
.recs .rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; color: var(--muted); font-size: .9375rem; }
.code-btn {
  font: 600 .9375rem/1 var(--body); letter-spacing: .04em;
  color: var(--ink); background: transparent;
  border: 1.5px dashed var(--blue); border-radius: 4px;
  padding: .35rem .55rem; cursor: pointer;
}
.code-btn:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.code-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.aff { font-size: .875rem; }
