/*
 * Walking with me — bento layout in the palette of Aegea's "Gal" theme.
 * Type follows the Apple HIG scale; spacing is on an 8-point grid.
 */
:root {
  --page: #fbfdfc;
  --tile: #ecf6f4;            /* Gal background */
  --tile-hover: #e2f0ed;
  --accent: #dde9f8;          /* Gal link blue, tinted */
  --accent-ink: #2b5fa3;
  --heading: #142630;         /* Gal headings */
  --text: #3f4f4b;
  --muted: #6b7a76;           /* Gal text */
  --link: #4080d0;            /* Gal link */
  --hover: #cd5055;           /* Gal hover */
  --rule: rgba(20, 38, 48, .08);
  --chip: rgba(20, 38, 48, .06);
  --shadow: 0 1px 2px rgba(20, 38, 48, .04), 0 8px 24px rgba(20, 38, 48, .06);
  --radius: 20px;
  --radius-inner: 12px;
  --gap: 16px;
  --pad: 24px;
  --wide: 1024px;
  --measure: 680px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-night="off"]) {
    --page: #0e1416;
    --tile: #172124;
    --tile-hover: #1d292d;
    --accent: #15263b;
    --accent-ink: #8dbaf2;
    --heading: #eef4f2;
    --text: #bccac6;
    --muted: #8b9b97;
    --link: #7fb0f0;
    --hover: #f08a8e;
    --rule: rgba(238, 244, 242, .08);
    --chip: rgba(238, 244, 242, .08);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--hover); }
h1, h2, h3 { color: var(--heading); margin: 0; text-wrap: balance; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--tile); padding: 8px 12px; border-radius: 8px; z-index: 10; }

.icon {
  width: 1.1em; height: 1.1em; vertical-align: -0.18em;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Top bar ---- */
.topbar {
  max-width: var(--wide); margin: 0 auto; padding: 20px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { color: var(--heading); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topnav > a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.topnav > a:hover { background: var(--tile); color: var(--heading); }
.search { position: relative; margin-left: 8px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  font: inherit; font-size: 15px; color: var(--heading); background: var(--tile);
  border: 0; border-radius: 999px; padding: 8px 14px 8px 36px; width: 180px; min-height: 36px;
  transition: width .2s ease;
}
.search input:focus { width: 240px; outline: 2px solid var(--link); outline-offset: 0; }

main { max-width: var(--wide); margin: 0 auto; }

/* ---- Bento grid ---- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.tile {
  background: var(--tile); border-radius: var(--radius); padding: var(--pad);
  overflow: hidden; position: relative; color: var(--text);
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
a.tile:hover { color: var(--text); background: var(--tile-hover); box-shadow: var(--shadow); transform: translateY(-2px); }
a.tile:active { transform: scale(.99); }
.label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted);
}
.more { margin: 16px 0 0; font-size: 15px; font-weight: 600; color: var(--link); }
.tile:hover .more { color: var(--hover); }
.tile-heading { font-size: 22px; line-height: 28px; letter-spacing: -0.01em; }

/* Intro */
.intro { grid-column: span 2; display: flex; flex-direction: column; justify-content: center; min-height: 300px; }
.intro-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.02em; }
.intro-subtitle { margin: 4px 0 0; font-size: 20px; line-height: 25px; color: var(--heading); opacity: .75; }
.intro-text { margin: 16px 0 0; font-size: 17px; }
.intro-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; background: var(--page); color: var(--heading); font-size: 15px; font-weight: 500;
}
.pill:hover { color: var(--hover); }

/* Stats */
.stats dl { margin: 8px 0 0; display: grid; gap: 14px; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Accent */
.accent { background: var(--accent); display: flex; flex-direction: column; }
a.accent:hover { background: var(--accent); }
.accent .label, .accent .more { color: var(--accent-ink); }
.accent .tile-heading { flex: 1; }

/* Feature: latest story */
.feature { grid-column: span 4; padding: 0; display: grid; grid-template-columns: 3fr 2fr; min-height: 360px; }
.feature-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-text { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
.feature-title { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; margin-top: 4px; }
.feature-excerpt { margin: 12px 0 0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* Album */
.album { grid-column: span 4; padding: 0; }
.album-banner { position: relative; height: 440px; }
.album-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-caption {
  position: absolute; inset: auto 0 0 0; padding: 72px 28px 24px;
  background: linear-gradient(to top, rgba(10, 20, 24, .72), rgba(10, 20, 24, 0));
  color: #fff;
}
.album-caption-top { inset: 0 0 auto 0; padding: 24px 28px 72px; background: linear-gradient(to bottom, rgba(10, 20, 24, .72), rgba(10, 20, 24, 0)); }
.album-caption .label, .album-caption .more { color: rgba(255, 255, 255, .85); }
.album-title { color: #fff; font-size: 28px; line-height: 34px; letter-spacing: -0.02em; }
.album:hover .more { color: #fff; }
.album-strip { list-style: none; margin: 0; padding: 3px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.album-strip img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

/* Story tiles */
.story { padding: 0; display: flex; flex-direction: column; }
.story-wide { grid-column: span 2; }
.story-cover { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--chip); }
.story-wide .story-cover { aspect-ratio: 16 / 9; }
.story-cover-empty { aspect-ratio: 4 / 3; }
.story-text { padding: 16px 20px 20px; }
.story-date { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.story-title { font-size: 17px; line-height: 22px; font-weight: 600; }
.story-wide .story-title { font-size: 20px; line-height: 25px; }
/* A hero takes a whole row: the cover beside the text. */
.story-hero { grid-column: span 4; flex-direction: row; }
.story-hero .story-cover { width: 62%; flex: none; aspect-ratio: 16 / 9; }
.story-hero .story-text { align-self: center; padding: 24px 32px; }
.story-hero .story-title { font-size: 26px; line-height: 32px; }
.story-hero .story-excerpt { -webkit-line-clamp: 4; font-size: 16px; line-height: 22px; }
.story-excerpt { margin: 8px 0 0; font-size: 15px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Places & chips */
.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
  border-radius: 999px; background: var(--page); color: var(--heading); font-size: 15px;
}
.chip span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--hover); }
/* A tag's own colour, set in the admin, tints its chip and its tile. */
.chip-tag { gap: 3px; color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, var(--page)); }
.chip-tag:hover { color: var(--hover); background: color-mix(in srgb, var(--tag) 22%, var(--page)); }
.tag-tinted { box-shadow: inset 0 0 0 3px var(--tag); }

/* Years */
.years { grid-column: span 3; display: flex; flex-direction: column; }
/* Snapping aligns to the scroller's edge, so scroll-padding keeps the first card off it. */
.year-row {
  list-style: none; margin: 4px -24px -24px; padding: 0 24px 24px; display: grid; flex: 1;
  grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 24px; scrollbar-width: none;
}
.year-row li { display: flex; }
.year-row::-webkit-scrollbar { display: none; }
.year-row li { scroll-snap-align: start; }
.year-card { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px; border-radius: var(--radius-inner); background: var(--page); color: var(--heading); }
.year-card:hover { color: var(--hover); }
.year-name { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.year-count { font-size: 13px; color: var(--muted); }
/* Thumbnails are equal squares, three to a row, each rounded. The card shows
   as many whole rows as fit its height: rows are the squares' own size (a
   third of the width), and any that don't fit get no height and are hidden. */
.year-card { container-type: inline-size; } /* cqw below is the card's width */
.year-card .year-thumbs {
  --sq: calc((100cqw - 8px) / 3);
  flex: 1; min-height: 0; margin-top: 10px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  grid-template-rows: repeat(auto-fill, var(--sq)); grid-auto-rows: 0; align-content: start; overflow: hidden;
}
.year-thumbs img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; min-height: 0; }
/* Squares sit in the card's bottom-right corner: the grid is turned half a
   turn, so rows fill from the bottom and from the right, and rows that don't
   fit are cut away at the top. Each picture is turned back upright. */
.year-card .year-thumbs, .year-card .year-thumbs img { transform: rotate(180deg); }

.more-tile, .pager { grid-column: span 4; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; font-weight: 600; color: var(--link); }
.pager { justify-content: space-between; }
.pager-count { color: var(--muted); font-weight: 400; font-size: 15px; }

/* Page heads */
.page-head { grid-column: span 4; padding: 32px; }
.page-title { font-size: 34px; line-height: 41px; letter-spacing: -0.02em; }
.page-text { margin: 8px 0 0; color: var(--muted); }
.empty-tile { grid-column: span 4; }

/* Places page */
.place { padding: 0; aspect-ratio: 1; display: block; }
.place img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.place-text {
  position: absolute; inset: auto 0 0 0; padding: 48px 16px 14px; display: grid;
  background: linear-gradient(to top, rgba(10, 20, 24, .7), rgba(10, 20, 24, 0)); color: #fff;
}
.place-name { font-size: 20px; line-height: 25px; font-weight: 700; }
.place-count { font-size: 13px; opacity: .85; }

/* Places */
.continent-head {
  grid-column: span 4; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 18px 24px; margin-top: 16px; background: transparent; color: var(--heading);
}
a.continent-head:hover { background: var(--tile); transform: none; box-shadow: none; }
.continent-name { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; }
.continent-count { font-size: 15px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.place-head .trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.trail a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.trail a:hover { color: var(--hover); }
.story-place { color: var(--heading); font-weight: 600; }
.chip-place { gap: 4px; }

/* ---- Travel plan: a timeline after soff.es/plan, in the Gal palette ---- */
.plan-page { max-width: 760px; margin: 0 auto; }
.plan-head { padding: 24px 0 8px; }
.tl-blue { --cat: #3a78c9; } .tl-green { --cat: #2e9b5f; } .tl-purple { --cat: #8a55c9; }
.tl-teal { --cat: #1f9aa0; } .tl-orange { --cat: #d9822b; } .tl-pink { --cat: #cf4f8a; } .tl-gray { --cat: #8b9b97; }
.timeline { list-style: none; margin: 24px 0 0; padding: 0 0 0 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--rule); border-radius: 1px; }
.tl-month { position: relative; display: flex; align-items: center; gap: 12px; margin: 28px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tl-month::before { content: ""; position: absolute; left: -26px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--rule); background: var(--page); }
.tl-month::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.tl-month.quiet { margin: 12px 0 6px; opacity: .7; }
.tl-today { position: relative; display: flex; align-items: center; gap: 10px; margin: 18px 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hover); }
.tl-today::before { content: ""; position: absolute; left: -27px; width: 12px; height: 12px; border-radius: 50%; background: var(--hover); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hover) 20%, transparent); }
.tl-today::after { content: ""; flex: 1; height: 2px; background: var(--hover); border-radius: 1px; opacity: .6; }
.tl-item { position: relative; margin: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -25px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
.tl-body { position: relative; }
.tl-item.trip .tl-body { background: var(--tile); border-radius: 16px; padding: 14px 18px 14px 20px; overflow: hidden; }
.tl-item.trip .tl-body::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat); }
.tl-item.trip::before { display: none; }
.tl-item.trip::after { content: ""; position: absolute; left: -26px; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--cat); }
.tl-item.now .tl-body { box-shadow: 0 0 0 2px var(--cat); }
.tl-when { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-when b { color: var(--cat); }
.tl-category {
  position: absolute; top: 0; right: 0; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--cat); background: color-mix(in srgb, var(--cat) 14%, transparent);
}
.tl-item.trip .tl-category { top: 12px; right: 14px; }
.tl-title { margin: 2px 0 0; font-size: 20px; line-height: 25px; letter-spacing: -0.01em; padding-right: 90px; }
.tl-where { display: flex; align-items: center; gap: 4px; margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.tl-note { margin: 8px 0 0; font-size: 15px; line-height: 21px; color: var(--text); }
.tl-note + .tl-note { margin-top: 2px; }

/* Home: Now / Soon and Next adventure */
.soon { display: flex; flex-direction: column; }
.soon .more { margin-top: auto; padding-top: 12px; }
.soon-place { margin: 0; font-size: 20px; line-height: 25px; font-weight: 700; color: var(--heading); letter-spacing: -0.01em; }
.soon-where { margin: 2px 0 12px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.soon-gap { margin-top: 6px; }
.next-adventure { background: color-mix(in srgb, var(--cat) 14%, var(--tile)); }
a.next-adventure:hover { background: color-mix(in srgb, var(--cat) 20%, var(--tile)); }
.next-adventure .label, .next-adventure .more { color: var(--cat); }
.next-adventure .tile-heading { margin-top: 6px; flex: 0; }
.next-adventure .more { margin-top: auto; }
.places-wide { grid-column: span 2; }
.years-wide { grid-column: span 4; }

/* ---- Globe: in the Gal palette, with Apple Maps-style glass controls ---- */
.glass-s {
  background: color-mix(in srgb, var(--page) 62%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid color-mix(in srgb, #fff 55%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 70%, transparent), 0 10px 36px rgba(20, 38, 48, .12), 0 1px 3px rgba(20, 38, 48, .08);
}
.globe-stage {
  --globe-ocean: #a9cde6; --globe-ocean-hi: #e6f3fb; --globe-land: #fbfdfc; --globe-visited: #a9dccd;
  --globe-border: rgba(20, 38, 48, .14); --globe-grat: rgba(20, 38, 48, .06); --globe-glow: rgba(64, 128, 208, .28);
  --globe-arc: #cd5055; --globe-point: #ffffff; --globe-ring: #cd5055; --globe-pending: #8d97a1; --globe-shade: rgba(20, 50, 80, .18);
  position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: calc(100vh - 76px); min-height: 520px;
  overflow: hidden; background: radial-gradient(80% 70% at 50% 45%, color-mix(in srgb, var(--tile) 70%, var(--page)), var(--page));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-night="off"]) .globe-stage {
    --globe-ocean: #08192a; --globe-ocean-hi: #17405e; --globe-land: #2a3d44; --globe-visited: #2f7466;
    --globe-border: rgba(255, 255, 255, .10); --globe-grat: rgba(255, 255, 255, .05); --globe-glow: rgba(110, 165, 235, .38);
    --globe-arc: #f2949a; --globe-point: #ffffff; --globe-ring: #f2949a; --globe-pending: #8d97a1; --globe-shade: rgba(0, 0, 0, .35);
    background: radial-gradient(80% 70% at 50% 45%, var(--tile), var(--page));
  }
  :root:not([data-night="off"]) .glass-s { border-color: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 36px rgba(0, 0, 0, .45); }
}
.globe-stage [hidden] { display: none !important; }
.globe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; opacity: 0; transition: opacity .8s ease; }
.globe-stage canvas:active { cursor: grabbing; }
.globe-stage.ready canvas { opacity: 1; }
.globe-stage canvas:focus-visible { outline: none; }
.globe-card { position: absolute; top: 16px; left: max(16px, calc(50vw - var(--wide) / 2)); padding: 18px 20px; border-radius: 26px; max-width: 320px; }
.globe-card h1 { font-size: 22px; line-height: 28px; letter-spacing: -0.01em; margin: 0; }
.globe-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 18px; margin: 14px 0 0; }
.globe-stats dt { font-size: 12px; color: var(--muted); }
.globe-stats dd { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.globe-now {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 999px;
  font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; animation: chip .4s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes chip { from { transform: translate(-50%, -8px) scale(.9); opacity: 0; } }
.globe-dock { position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px); }
.globe-replay {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--heading); white-space: nowrap;
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.globe-replay:active { transform: scale(.96); }
.globe-replay svg { width: 18px; height: 18px; fill: var(--hover); }
.globe-replay .stop, .globe-replay.playing .play { display: none; }
.globe-replay.playing .stop { display: block; }
.globe-years { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.globe-years::-webkit-scrollbar { display: none; }
.globe-years button {
  position: relative; z-index: 1; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.globe-years button.selected { color: var(--heading); font-weight: 700; }
.globe-years .slider-thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 999px; background: color-mix(in srgb, var(--page) 90%, #fff);
  box-shadow: 0 2px 10px rgba(20, 38, 48, .14); transition: left .35s cubic-bezier(.3, 1.3, .5, 1), width .35s cubic-bezier(.3, 1.3, .5, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-night="off"]) .globe-years .slider-thumb { background: rgba(255, 255, 255, .14); } }
.globe-zoom { position: absolute; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.globe-zoom button {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  font: 400 22px/1 system-ui, sans-serif; color: var(--heading);
}
.globe-tip {
  position: absolute; z-index: 5; transform: translate(-50%, -100%); padding: 6px 12px; border-radius: 999px; pointer-events: none;
  font-size: 13px; font-weight: 600; color: var(--heading); white-space: nowrap;
}
.globe-sheet {
  position: absolute; top: 16px; right: 16px; bottom: 88px; width: min(360px, calc(100vw - 32px)); border-radius: 28px; overflow-y: auto;
  padding: 0 0 18px; animation: sheet .45s cubic-bezier(.3, 1.2, .5, 1);
}
@media (min-width: 641px) { .globe-sheet.sheet-waiting { bottom: auto; } } /* a place still to write about: nothing to list */
@keyframes sheet { from { transform: translateX(40px); opacity: 0; } }
.sheet-close {
  position: sticky; float: right; top: 12px; margin: 12px 12px 0 0; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: color-mix(in srgb, var(--page) 70%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 20px; line-height: 1; color: var(--heading); cursor: pointer;
}
.sheet-cover { display: block; width: calc(100% - 16px); margin: 8px 8px 0; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 20px; }
.sheet-head { padding: 14px 20px 6px; clear: both; }
.sheet-cover:not([hidden]) + .sheet-head { clear: none; }
.sheet-title { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; margin: 0; }
.sheet-where { margin: 2px 0 0; color: var(--muted); }
.sheet-planned { margin: 8px 0 0; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--link); background: color-mix(in srgb, var(--link) 14%, transparent); }
.sheet-stories { list-style: none; margin: 8px 0 0; padding: 0 8px; }
.sheet-stories a { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 16px; color: var(--heading); }
.sheet-stories a:hover { background: color-mix(in srgb, var(--tile) 80%, transparent); color: var(--heading); }
.sheet-thumb { width: 52px; height: 52px; border-radius: 12px; flex: none; background: var(--tile) center / cover no-repeat; }
.sheet-text { display: grid; gap: 2px; min-width: 0; }
.sheet-story { font-weight: 600; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-date { font-size: 13px; color: var(--muted); }
.sheet-link { display: block; padding: 4px 20px 0; }
.globe-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.globe-stage.failed::after { content: "The globe could not be loaded."; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
body:has(.globe-stage) .footer { margin-top: 0; }

@media (max-width: 640px) {
  .globe-stage { height: calc(100svh - 120px); }
  .globe-card { left: 12px; right: 12px; top: 12px; max-width: none; padding: 12px 16px; border-radius: 22px; }
  .globe-card h1 { font-size: 17px; line-height: 22px; }
  .globe-card .label { display: none; }
  .globe-stats { margin-top: 8px; gap: 12px; }
  .globe-stats dd { font-size: 18px; line-height: 22px; }
  .globe-now { top: auto; bottom: 132px; }
  .globe-dock { flex-direction: column; left: 12px; right: 76px; transform: none; align-items: stretch; bottom: max(16px, env(safe-area-inset-bottom)); }
  .globe-replay { justify-content: center; }
  .globe-zoom { right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .globe-sheet { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 52%; animation-name: sheet-up; z-index: 6; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
}

/* Archive */
.year-tile { grid-column: span 2; display: grid; gap: 12px; align-content: start; }
.year-tile-head { display: flex; align-items: baseline; justify-content: space-between; color: var(--heading); }
.year-tile .year-name { font-size: 28px; line-height: 34px; }
.year-tile .year-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0; padding: 0; }
.months { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Story page ---- */
.preview-banner { max-width: var(--measure); margin: 0 auto 16px; padding: 10px 16px; border-radius: var(--radius-inner); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.note { max-width: var(--measure); margin: 24px auto 0; }
.note-meta { display: flex; gap: 12px; margin: 0 0 8px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note-title { font-size: clamp(30px, 5vw, 40px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 700; }
.note-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.note-tags .chip { background: var(--tile); }
.note-body { margin-top: 32px; font-size: 18px; line-height: 1.65; color: var(--text); }
.note-body p { margin: 0 0 1.1em; }
.note-body h2 { font-size: 24px; line-height: 30px; margin: 1.8em 0 .5em; letter-spacing: -0.01em; }
.note-body h3 { font-size: 20px; line-height: 25px; margin: 1.6em 0 .4em; }
.note-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: .18em; }
.note-body blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--tile); color: var(--heading); }
.note-body ul, .note-body ol { padding-left: 1.3em; }
.note-body figure { margin: 0; }
.note-body figcaption { color: var(--muted); font-size: 14px; line-height: 19px; padding: 8px 4px 0; }
.note-body picture { display: contents; }
.note-body img { display: block; height: auto; border-radius: var(--radius-inner); background: var(--tile); }
.note-body .picture, .note-body .gallery, .note-body .video, .note-body .embed { margin: 2em 0; }
.note-body .picture img { width: 100%; }
@media (min-width: 900px) {
  .note-body .picture, .note-body .gallery { margin-left: -96px; margin-right: -96px; }
}
/* A gallery: the first frame full width, the rest as thumbnails beneath. */
.note-body .gallery { display: grid; gap: 6px; }
.note-body .gallery .lead img { width: 100%; }
.note-body .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 150px), 1fr)); gap: 6px; }
.note-body .thumbs img, .note-body .thumbs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.note-body .thumbs figcaption { display: none; }
.note-body figure[data-kind] a { display: block; position: relative; cursor: zoom-in; border-radius: var(--radius-inner); overflow: hidden; }
.note-body .thumbs figure a { border-radius: 8px; }
.note-body figure[data-kind] a:hover img { filter: brightness(1.04); }
.note-body video { display: block; width: 100%; background: #000; border-radius: var(--radius-inner); }
.note-body .lead video { aspect-ratio: 16 / 9; object-fit: cover; }
/* Three or four: squares beside a landscape first picture, or beneath a portrait one. */
.note-body .side { display: grid; gap: 6px; }
.note-body .side-column { align-items: stretch; }
/* The column takes the first picture's height and never its own: contain
   keeps the thumbnails' sizes out of the row, and each fills its cell
   absolutely, so a very tall or very wide one is cropped, not stretched out. */
.note-body .side-column .thumbs { display: grid; grid-template-columns: 1fr; gap: 6px; min-height: 0; contain: size; }
.note-body .side-column .thumbs figure { position: relative; min-height: 0; overflow: hidden; border-radius: 8px; }
.note-body .side-column .thumbs a { position: absolute; inset: 0; }
.note-body .side-column .thumbs img, .note-body .side-column .thumbs video { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.note-body .side-row .thumbs { display: grid; gap: 6px; }
.note-body .side-row .thumbs img, .note-body .side-row .thumbs video { aspect-ratio: 1; }
.note-body .side .lead img { width: 100%; height: auto; }
.note-body .gallery-caption { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; line-height: 19px; padding: 2px 4px 0; }

/* Two pictures: the second lies under the first, a corner showing. */
.note-body .pair { margin-top: 2.6em; }
.note-body .pair .stack { position: relative; isolation: isolate; }
.note-body .pair .stack > a { position: relative; z-index: 2; box-shadow: 0 18px 40px rgba(20, 38, 48, .18); }
.note-body .pair .peek { position: absolute; inset: 0; z-index: 1; margin: 0; transform: translate(18px, -18px) rotate(2.2deg); transform-origin: 30% 70%;
  transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.note-body .pair .peek a { height: 100%; border-radius: var(--radius-inner); }
.note-body .pair .peek img, .note-body .pair .peek video { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) brightness(.92); }
.note-body .pair .peek:hover { transform: translate(28px, -26px) rotate(3.4deg); }
.note-body .pair .peek:hover img { filter: none; }
@media (max-width: 640px) {
  .note-body .pair .peek { transform: translate(10px, -10px) rotate(1.8deg); }
}

/* A play badge on videos; they play in the lightbox. */
.note-body figure[data-kind="video"] a { cursor: pointer; }
.note-body figure[data-kind="video"] a::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(20, 24, 28, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='white'/%3E%3C/svg%3E") 55% 50% / 26px no-repeat;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.note-body .thumbs figure[data-kind="video"] a::after { width: 36px; height: 36px; margin: -18px 0 0 -18px; background-size: 18px; }
.note-body figure[data-kind="video"] a:hover::after { transform: scale(1.08); }
.note-body .embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-inner); }

.neighbours { max-width: var(--wide); margin: 64px auto 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.neighbour { padding: 0; display: grid; grid-template-columns: 112px 1fr; align-items: center; min-height: 112px; }
.neighbour img { width: 112px; height: 100%; object-fit: cover; }
.neighbour-text { padding: 16px 20px; display: grid; gap: 4px; }
.neighbour .label { margin: 0; }
.neighbour-title { color: var(--heading); font-weight: 600; line-height: 22px; }

.footer {
  max-width: var(--wide); margin: 64px auto 0; padding: 24px 0 calc(40px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: 15px;
}
.footer p { margin: 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--hover); }

/* ---- Tablet: two columns ---- */
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro, .feature, .album, .years, .page-head, .more-tile, .pager, .empty-tile, .year-tile, .continent-head { grid-column: span 2; }
  .story-wide { grid-column: span 2; }
  .story-hero { grid-column: span 2; flex-direction: column; }
  .story-hero .story-cover { width: 100%; }
  .story-hero .story-text { align-self: stretch; padding: 16px 20px 20px; }
  .stats, .accent, .places, .soon { grid-column: span 1; }
  /* Rows of four become rows of two: a lone small tile pulls the next one up. */
  .bento { grid-auto-flow: row dense; }
  .places-wide, .years-wide { grid-column: span 2; }
}

/* ---- Phone: one column ---- */
@media (max-width: 640px) {
  :root { --pad: 20px; --radius: 18px; --gap: 12px; }
  body { font-size: 17px; }
  .topbar { padding-top: 12px; }
  .topnav { width: 100%; justify-content: space-between; }
  .topnav > a { padding: 8px 10px; }
  .search { margin-left: 0; flex: 1 1 100%; order: 2; }
  .search input, .search input:focus { width: 100%; min-height: 44px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento > * { grid-column: 1 / -1 !important; }
  .intro { min-height: 0; }
  .stats dl { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats dd { font-size: 22px; line-height: 28px; }
  .intro-title, .page-title { font-size: 28px; line-height: 34px; }
  .feature { grid-template-columns: 1fr; min-height: 0; }
  .feature-cover { aspect-ratio: 4 / 3; height: auto; }
  .feature-text { padding: 20px; }
  .feature-title, .album-title { font-size: 22px; line-height: 28px; }
  .album-banner { height: 260px; }
  /* A cover with lettering is too narrow here to share with the caption: the
     caption goes under it, and the picture shows more of itself. */
  .album-lettered .album-banner { height: auto; }
  .album-lettered .album-img { height: auto; aspect-ratio: 4 / 3; }
  .album-lettered .album-caption { position: static; padding: 20px 20px 16px; background: none; color: var(--text); }
  .album-lettered .album-caption .label, .album-lettered .album-caption .more { color: var(--muted); }
  .album-lettered .album-title { color: var(--heading); }
  .album-lettered:hover .more { color: var(--heading); }
  .album-strip { grid-template-columns: repeat(2, 1fr); }
  .place { aspect-ratio: 16 / 9; }
  .page-head { padding: 24px 20px; }
  .note-body { font-size: 17px; }
  .timeline { padding-left: 24px; }
  .tl-title { font-size: 18px; padding-right: 0; }
  .tl-category { position: static; display: inline-block; margin: 4px 0 2px; }
  .neighbours { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  a.tile:hover { transform: none; }
}

/* ---- Icons in motion: they draw in as they scroll into view (site.js),
   bounce when pressed; arrows lean ahead and the flame flickers. Uses
   "scale" and "translate", so an icon's own transform stays as it is. ---- */
.icon-in { animation: icon-in .7s cubic-bezier(.3, 1.4, .5, 1) var(--icon-delay, 0s) both; }
.icon-in > * { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: icon-draw .7s cubic-bezier(.4, 0, .2, 1) var(--icon-delay, 0s) forwards; }
@keyframes icon-in { from { opacity: 0; scale: .55; } }
@keyframes icon-draw { to { stroke-dashoffset: 0; } }
.icon-press { animation: icon-press .5s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes icon-press { 35% { scale: .72; } 70% { scale: 1.14; } }
.icon[data-icon="arrow"] { transition: translate .25s cubic-bezier(.3, 1.5, .5, 1); }
a:hover .icon[data-icon="arrow"] { translate: 4px 0; }
.icon[data-icon="flame"] { transform-origin: 50% 90%; }
.icon[data-icon="flame"]:not(.icon-in, .icon-press) { animation: icon-flicker 2.6s ease-in-out infinite; }
@keyframes icon-flicker { 30% { scale: 1.06 .95; rotate: -3deg; } 60% { scale: .95 1.06; rotate: 2deg; } }
.icon[data-icon="sparkle"], .icon[data-icon="pin"] { transition: scale .25s cubic-bezier(.3, 1.6, .5, 1); }
a:hover .icon[data-icon="sparkle"], a:hover .icon[data-icon="pin"] { scale: 1.2; }
@media (prefers-reduced-motion: reduce) {
  .icon-in, .icon-in > *, .icon-press, .icon[data-icon="flame"]:not(.icon-in, .icon-press) { animation: none; stroke-dasharray: none; }
  .icon { transition: none !important; }
}

/* ---- Modules ---- */
.module { margin-top: var(--gap); }
.module-title { margin: 24px 4px 14px; font-size: 22px; line-height: 28px; font-weight: 700; color: var(--heading); }
.module-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--gap); }
.module-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: inherit; }
.module-cover { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--chip); }
.module-text { display: grid; gap: 4px; padding: 14px 16px 16px; }
.module-name { font-size: 16px; line-height: 21px; font-weight: 600; color: var(--heading); }
.module-note { font-size: 13px; line-height: 18px; color: var(--muted); }

/* I've been here before: the stories of a place, in order. */
.been-here { padding: 4px; }
.been-place { margin: -8px 4px 12px; font-weight: 600; }
.been-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; background: var(--tile); border-radius: var(--radius); padding: 8px; }
.been-entry { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr); gap: 4px 14px; padding: 10px 12px; border-radius: calc(var(--radius) - 8px); color: inherit; }
a.been-entry:hover { background: var(--tile-hover); }
.been-date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.been-name { font-weight: 500; color: var(--heading); }
.been-current .been-name { font-weight: 700; }
.been-current .been-entry { background: var(--tile-hover); }

/* Stories / Photos */
.view-toggle { display: inline-flex; gap: 2px; margin-top: 12px; padding: 3px; border-radius: 999px; background: var(--chip); }
.view-toggle a { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.view-toggle a.selected { background: var(--page); color: var(--heading); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.contact { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 190px), 1fr)); gap: 8px; }
.contact-frame { position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--chip); }
.contact-img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .35s cubic-bezier(.3, 1.2, .5, 1); }
.contact-frame:hover .contact-img { transform: scale(1.03); }
.contact-frame[aria-expanded="true"] { outline: 3px solid var(--link); outline-offset: 2px; }
.contact-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.contact-open { grid-column: 1 / -1; padding: 12px; border-radius: 14px; background: var(--tile); animation: contact-open .3s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes contact-open { from { opacity: 0; transform: translateY(-6px); } }
.contact-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 120px), 1fr)); gap: 6px; }
.contact-strip button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: none; cursor: zoom-in; }
.contact-strip img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.contact-foot { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
.contact-title { font-weight: 600; color: var(--heading); }
.contact-story { font-weight: 600; }

/* Search that finds the scene */
.scenes { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
.scene { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 12px; color: inherit; align-items: start; }
.scene-img { width: 120px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.scene-text { display: grid; gap: 4px; min-width: 0; }
.scene-title { font-size: 17px; font-weight: 600; color: var(--heading); }
.scene-place { font-size: 13px; color: var(--muted); }
.scene-snippet { font-size: 15px; line-height: 21px; }
.scene-snippet mark { padding: 0 2px; border-radius: 3px; color: inherit; background: color-mix(in srgb, #ffcc00 45%, transparent); }
.note-body :target { scroll-margin-top: 24px; border-radius: 6px; animation: passage-found 3s ease-out; }
@keyframes passage-found { 0%, 40% { background: color-mix(in srgb, #ffcc00 40%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, #ffcc00 40%, transparent); } }

/* Blocks written into posts: tiles like the rest of the site. */
.note-body .ext { margin: 2em 0; padding: 20px; border-radius: var(--radius); background: var(--tile); font-size: 17px; line-height: 1.5; }
.note-body .ext-title { margin: 0 0 14px; }
.note-body .ext p:last-child { margin-bottom: 0; }
}

/* A detour: the way it went, stop by stop. */
.ext dl { margin: 0; display: grid; }
.ext dl > div { position: relative; padding: 0 0 16px 24px; }
.ext dl > div:last-child { padding-bottom: 0; }
.ext dl > div::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.ext dl > div:last-child::before { background: var(--link); box-shadow: 0 0 0 4px color-mix(in srgb, var(--link) 20%, transparent); }
.ext dl > div:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: -3px; width: 1px; background: var(--muted); opacity: .5; }
.ext dt { font-size: 13px; line-height: 18px; color: var(--muted); }
.ext dd { margin: 2px 0 0; font-weight: 600; color: var(--heading); }
.note-body .ext .picture, .note-body .ext .gallery { margin: 18px 0 0; }
/* What I'd do again: numbered steps. */
.note-body .ext ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.note-body .ext ol li { position: relative; margin: 0; padding-left: 34px; counter-increment: step; color: var(--heading); }
.note-body .ext ol li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--page);
  font-size: 13px; line-height: 24px; font-weight: 600; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums;
}
.note-body .ext .ext-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 13px; line-height: 18px; color: var(--muted); }
/* A note on a place: the name, and a tile that opens beside it. */
.place-note { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted var(--link) 2px; text-underline-offset: 3px; transition: color .15s ease; }
.place-note:hover { color: var(--hover); text-decoration-color: var(--hover); }
.place-pop { position: fixed; width: min(340px, calc(100vw - 32px)); margin: 0; padding: 14px 16px; border: 0; border-radius: var(--radius); font-size: 15px; line-height: 21px; color: var(--text); background: var(--tile); box-shadow: var(--shadow), 0 16px 50px rgba(0, 0, 0, .18); }
.place-pop b { color: var(--heading); }
.place-pop a { font-size: 13px; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
  .scene { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .scene-img { width: 72px; }
  .been-entry { grid-template-columns: minmax(0, 1fr); }
  .module-cards { grid-template-columns: 1fr 1fr; }
  .module-text { padding: 10px 12px 12px; }
  .module-name { font-size: 15px; line-height: 19px; }
}

/* Between pages the colours fade from the last page's to this one's (theme-fade.js). */
@property --page { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --tile { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --tile-hover { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --accent-ink { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --heading { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --text { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --link { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --hover { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --rule { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --chip { syntax: "<color>"; inherits: true; initial-value: transparent; }
html.theme-fading {
  transition: --page .6s ease, --tile .6s ease, --tile-hover .6s ease, --accent .6s ease, --accent-ink .6s ease, --heading .6s ease,
    --text .6s ease, --muted .6s ease, --link .6s ease, --hover .6s ease, --rule .6s ease, --chip .6s ease;
}
/* An element's own colour transition would restart on every frame and lag. */
html.theme-fading body, html.theme-fading body *, html.theme-fading body *::before, html.theme-fading body *::after { transition: none !important; }
/* The globe's colours fade too; globe.js reads them each frame meanwhile. */
@property --globe-visited { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --globe-arc { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --globe-ring { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --globe-glow { syntax: "<color>"; inherits: true; initial-value: transparent; }
html.theme-fading .globe-stage { transition: --globe-visited .6s ease, --globe-arc .6s ease, --globe-ring .6s ease, --globe-glow .6s ease !important; }

/* ---- Page not found: a lost compass and a departures board.
   Painted only in the theme's colours, so every scheme and the night suit it. ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lost-hero, .lost-board { grid-column: span 2; }
.lost-hero { display: flex; flex-direction: column; justify-content: center; padding: 32px; }
.lost-code {
  display: flex; align-items: center; gap: .06em; margin: 0 0 20px;
  font-size: clamp(76px, 11vw, 128px); line-height: 1; font-weight: 800; letter-spacing: -0.04em;
  color: var(--heading); font-variant-numeric: tabular-nums;
}
.compass {
  flex: none; width: .86em; height: .86em; margin: 0 .04em; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; font: inherit; color: inherit; touch-action: manipulation;
  transition: scale .3s cubic-bezier(.3, 1.6, .5, 1);
  filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--heading) 12%, transparent));
}
.compass:hover { scale: 1.05; }
.compass:active { scale: .94; }
.compass svg { display: block; width: 100%; height: 100%; overflow: visible; }
.compass-face { fill: var(--page); stroke: color-mix(in srgb, var(--heading) 14%, transparent); stroke-width: 2.5; }
.compass-ticks { fill: none; stroke: var(--muted); stroke-width: 5; stroke-dasharray: .35 2.65; stroke-dashoffset: .175; opacity: .55; }
.compass-ticks-major { stroke: var(--heading); stroke-width: 8; stroke-dasharray: .7 17.3; stroke-dashoffset: .35; opacity: 1; }
.compass-letters text { font: 700 12px/1 system-ui, -apple-system, sans-serif; letter-spacing: 0; fill: var(--muted); text-anchor: middle; }
.compass-letters text:first-child { fill: var(--hover); }
.compass-needle { transform-box: view-box; transform-origin: 60px 60px; transform: rotate(32deg); }
.needle-north { fill: var(--hover); }
.needle-south { fill: color-mix(in srgb, var(--muted) 55%, var(--page)); }
.needle-pin { fill: var(--page); stroke: var(--heading); stroke-width: 2.5; }
.lost-hero .page-text { max-width: 46ch; color: var(--text); }

.lost-search { position: relative; display: flex; gap: 8px; margin: 24px 0 0; max-width: 440px; }
.lost-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lost-search input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 16px 10px 40px; border: 0; border-radius: 999px;
  font: inherit; font-size: 16px; color: var(--heading); background: var(--page);
}
.lost-search input:focus { outline: 2px solid var(--link); outline-offset: 0; }
.lost-search button, .board-shuffle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px;
  border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--accent-ink); background: var(--accent);
  transition: background-color .2s ease, color .2s ease, scale .2s cubic-bezier(.3, 1.6, .5, 1);
}
.lost-search button:hover, .board-shuffle:hover { color: var(--hover); }
.lost-search button:active, .board-shuffle:active { scale: .96; }
.lost-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }

.lost-board { display: flex; flex-direction: column; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.board-head .label { margin: 0; }
.board-clock, .board-time, .board-gate {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums;
}
.board-clock { font-size: 15px; font-weight: 600; color: var(--heading); }
.board-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; align-content: start; }
.board-row a {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; min-height: 64px;
  border-radius: var(--radius-inner); background: var(--page); color: var(--heading);
  transition: translate .2s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s ease;
}
.board-row a:hover { color: var(--heading); translate: 4px 0; box-shadow: var(--shadow); }
.board-row a:hover .board-title { color: var(--hover); }
.board-row.board-in { animation: board-in .45s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: var(--row-delay, 0s); }
@keyframes board-in { from { opacity: 0; translate: 0 8px; } }
.board-thumb { flex: none; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--tile); }
.board-where { flex: 1; min-width: 0; display: grid; gap: 4px; }
.board-flaps {
  display: flex; gap: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  -webkit-mask-image: linear-gradient(to left, transparent, #000 24px); mask-image: linear-gradient(to left, transparent, #000 24px);
  font: 700 15px/1.2 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .02em;
}
.flap {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 1.05em; height: 1.5em;
  border-radius: 4px; background: var(--tile); color: var(--heading); font-size: 14px;
}
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--page); opacity: .9; }
.flap.flip { animation: flap .09s ease-in; }
@keyframes flap { from { transform: perspective(60px) rotateX(-70deg); opacity: .5; } }
.flap-space { background: none; width: .5em; }
.flap-space::after { display: none; }
.board-title { font-size: 13px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s ease; }
.board-time { flex: none; font-size: 15px; font-weight: 600; }
.board-time:empty { display: none; }
.board-gate { flex: none; display: grid; justify-items: center; font-size: 15px; font-weight: 600; color: var(--heading); }
.board-small { font-family: system-ui, -apple-system, sans-serif; font-size: 10px; line-height: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.board-status {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; min-width: 88px; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent);
}
.board-status.is-boarding { color: var(--hover); background: color-mix(in srgb, var(--hover) 14%, var(--page)); }
.board-status.is-boarding::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: board-blink 1.2s steps(2, jump-none) infinite; }
.board-status.is-delayed { color: var(--muted); background: var(--chip); }
@keyframes board-blink { 50% { opacity: .2; } }
.board-shuffle { align-self: flex-start; margin: 16px 0 0; }
.board-shuffle .icon { transition: rotate .4s cubic-bezier(.3, 1.4, .5, 1); }
.board-shuffle:hover .icon { rotate: 20deg; }

@media (max-width: 640px) {
  .lost-hero { padding: 28px 20px; }
  .lost-code { font-size: clamp(72px, 26vw, 112px); justify-content: center; margin-bottom: 16px; }
  .lost-search button { padding: 8px 16px; }
  .board-row a { gap: 10px; padding-right: 10px; }
  .board-thumb { width: 44px; height: 44px; }
  .board-gate { display: none; }
  .board-status { min-width: 0; padding: 4px 8px; font-size: 10px; }
  .board-shuffle { align-self: stretch; }
}
@media (max-width: 380px) {
  .board-time { display: none; }
}
@media (hover: none) {
  .compass:hover { scale: 1; }
  .board-row a:hover { translate: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .board-row.board-in, .flap.flip, .board-status.is-boarding::before { animation: none; }
  .compass, .board-row a { transition: none; }
}
