/* trevor fawcett: site styles.
   One country per page: two fixed backgrounds (a day shot and a night shot) crossfade at the dusk band
   as you scroll, and the photo tiles flow over them in a loose masonry. The day half is light and the
   night half dark, whatever the viewer's theme; the theme changes the home, about and checkout pages.
   The header is always light. Names and values match the "trevor fawcett" design system. */

@font-face {
  font-family: "Lintel";
  src: url("/static/fonts/lintel-regular.woff2") format("woff2"), url("/static/fonts/lintel-regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: block; /* preloaded; blocking briefly avoids a visible swap from Georgia */
}

/* ---------- Tokens ---------- */
:root {
  --red: #dc3522;     /* brand red, always at full strength: the mark, the header rule, focus rings, buy actions */
  --red-ink: #ffffff; /* text on red */
  --page: #ebebeb;
  --chrome-ink: #1e1e20;
  --chrome-dim: #56605f;
  --chrome-line: rgba(30, 30, 32, 0.12);
  --slate: #3c4746;

  --day-frost: rgba(255, 255, 255, 0.74);
  --day-ink: #1e1e20;
  --day-dim: #3c4746;
  --night-frost: rgba(30, 30, 32, 0.66);
  --night-ink: #ebebeb;
  --night-dim: #a7adbd;
  --hero-ink: #ffffff; /* text set straight on a photo */
  --awip-ink: rgba(39, 41, 40, 0.06); /* the motto's letter grid */

  /* Two faces only: Lintel (one weight) for display type and small interface text, Georgia for reading and data */
  --font-display: "Lintel", Georgia, "Times New Roman", serif;
  --font-body: Georgia, "Times New Roman", Times, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #1e1e20; --chrome-ink: #ebebeb; --chrome-dim: #a3abaa; --chrome-line: rgba(235, 235, 235, 0.14); --slate: #c9d1d0;
    --awip-ink: rgba(235, 235, 235, 0.06);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; } /* the day / night jump links */
  /* Page-to-page crossfade where supported; the header stays put rather than fading */
  @view-transition { navigation: auto; }
}
body { margin: 0; background: var(--page); color: var(--day-ink); font-family: var(--font-body); font-size: 0.9375rem; line-height: 1.5; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
section[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.htmx-request, .htmx-request * { cursor: progress; } /* htmx marks the tile while its photo loads */

/* Lintel has one weight: never let the browser fake a bold */
.owner, .hello, .intro h1, .intro h2, .end a, .place b, .panel h3, .prose h3, .items b, .portrait, .thumb.count, .cap b, .lbl b, .checkout {
  font-weight: 400; font-synthesis: none;
}
/* Small interface text is Lintel too */
.bar, .cap, .lbl, .pick, .add, .checkout, .summary, .rm, .back, .status, .label, .draft, .fine { font-family: var(--font-display); }
/* Georgia's figures are old-style by default; line them up where numbers sit together */
.eyebrow, .count, .cap small, .dusk .line, .exif, .pick em, .label, .place small, .roles time,
.badge, .items small, .items .amt, .summary .total, .thumb.count small, .lbl small { font-variant-numeric: lining-nums tabular-nums; }

main { position: relative; z-index: 1; }
.wrap { max-width: 1400px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- Header ---------- */
/* Always translucent white with the red rule, whatever the theme. Redefining the chrome tokens here
   keeps the stacks that drop from it in the same light style. */
.bar, body::before {
  --chrome-bg: rgba(255, 255, 255, 0.75); --chrome-ink: #1e1e20; --chrome-dim: #56605f;
  --chrome-line: rgba(30, 30, 32, 0.12); --page: #ebebeb; --slate: #3c4746;
  color-scheme: light;
}
/* Fills the safe area above the header on notched phones */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--chrome-bg); }
/* The white band and red rule run the full width of the window; the logo, links and cart line up with
   the 1400px content column. */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  view-transition-name: site-bar;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px), calc((100% - 1400px) / 2 + 16px));
  padding-right: max(16px, env(safe-area-inset-right, 0px), calc((100% - 1400px) / 2 + 16px));
  background: var(--chrome-bg); color: var(--chrome-ink);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--red);
}
/* The identity, as on the original site: the mark as tall as the name and motto together, the motto
   in Georgia at 0.65 of the name's size */
.wordmark { display: flex; align-items: center; gap: 10px; letter-spacing: 0; color: var(--slate); text-decoration: none; }
.wordmark svg { width: 44px; height: 44px; fill: var(--red); flex: none; }
.identity { display: grid; }
.owner { font-family: var(--font-display); font-size: 1.3125rem; line-height: 1; }
.motto { font-family: var(--font-body); font-style: italic; font-size: 0.875rem; line-height: 1.6; }

.top-links { display: flex; gap: 14px; font-size: 0.9375rem; align-items: center; }
.top-links a { text-decoration: none; color: var(--chrome-dim); }
.top-links a[aria-current="page"], .top-links a:hover { color: var(--chrome-ink); }

/* Day / night switch: a small sun above a small moon between photos and about me, jumping to each half
   of a country page */
.halfnav { display: flex; flex-direction: column; gap: 1px; scroll-target-group: auto; }
.halfnav a { display: grid; place-items: center; text-decoration: none; padding: 2px 5px; border-radius: 4px; color: var(--chrome-dim); line-height: 0; transition: color 0.3s, background 0.3s; }
.halfnav a:hover { color: var(--chrome-ink); }
/* :target-current where the browser tracks it; site.js adds .target-current elsewhere */
.halfnav a:is(:target-current, .target-current) { color: var(--chrome-ink); background: var(--chrome-line); }

.photosbtn { anchor-name: --photos-btn; display: inline-block; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--chrome-dim); cursor: pointer; }
.photosbtn.on, .photosbtn:hover, .photosbtn[aria-expanded="true"] { color: var(--chrome-ink); }

.cartwrap { margin-left: auto; }
/* The cart: a shopping bag in the link colour, with the number of photos in a red bubble */
.cartbtn { anchor-name: --cart-btn; position: relative; display: grid; place-items: center; width: 28px; height: 32px; padding: 0; background: none; border: 0; color: var(--chrome-dim); cursor: pointer; }
.cartbtn:hover, .cartbtn[aria-expanded="true"] { color: var(--chrome-ink); }
.cartbtn .bag { display: block; }
.badge { position: absolute; top: 0; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: var(--red-ink); font: 400 0.6875rem/16px var(--font-body); text-align: center; }

/* Wherever there is room (above 480px), the links sit in the centre of the header, between the
   identity and the cart */
@media (min-width: 481px) {
  .bar { display: grid; grid-template-columns: 1fr auto 1fr; }
  .wordmark { justify-self: start; }
  .cartwrap { grid-column: 3; justify-self: end; }
}
@media (max-width: 760px) {
  .bar { gap: 8px 10px; }
  .wordmark svg { width: 34px; height: 34px; }
  .owner { font-size: 1rem; }
  .motto { font-size: 0.6875rem; }
  .top-links { gap: 10px; }
  .halfnav a { padding-inline: 3px; }
}
@media (max-width: 400px) {
  .wordmark { gap: 6px; }
}

/* ---------- Footer ---------- */
/* The copyright line, styled like the header: 75% white with the red rule along its top, in both
   themes, lined up with the content column. Fixed to the bottom of the window on desktop (the body
   keeps room for it), and simply at the end of the page on phones and short landscape screens. */
.foot {
  --chrome-bg: rgba(255, 255, 255, 0.75); --chrome-dim: #56605f; color-scheme: light;
  position: relative; z-index: 8;
  padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px), calc((100% - 1400px) / 2 + 16px));
  padding-right: max(16px, env(safe-area-inset-right, 0px), calc((100% - 1400px) / 2 + 16px));
  background: var(--chrome-bg); color: var(--chrome-dim);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--red);
  font: italic 0.8125rem/1.5 var(--font-body);
  view-transition-name: site-foot;
}
.foot p { margin: 0; }
@media (min-width: 761px) and (min-height: 521px) {
  body { padding-bottom: calc(37px + env(safe-area-inset-bottom, 0px)); }
  .foot { position: fixed; inset: auto 0 0; }
}

/* ---------- Photos and cart stacks ---------- */
/* Each stack drops from its button like a macOS Dock stack. It is a native popover (top layer, Esc,
   click-outside, one open at a time); the popover itself is a zero-size point under its button and
   the items hang off it. CSS anchor positioning places it, and site.js sets top/left/right where that
   is missing. */
.fanwrap { position: relative; }
.fan {
  position: fixed; inset: auto; width: 0; height: 0; margin: 14px 0 0 -12px; padding: 0; border: 0;
  background: none; color: inherit; overflow: visible;
  position-anchor: --photos-btn; top: anchor(bottom); left: anchor(left);
  /* keep the popover on screen while its items animate out */
  transition-property: display, overlay; transition-duration: 0.42s; transition-behavior: allow-discrete;
}
.fan-item {
  --i: 0; /* each item's position in the stack; the markup and site.js set it inline */
  --x: calc(var(--i) * var(--i) * -3px - var(--i) * 3px);
  --step: 74px;
  --closed: translate(0, calc(var(--i) * var(--step) * -1 - 30px)) rotate(0deg) scale(0.6);
  --open: translate(var(--x), 0) rotate(calc(var(--i) * 1.5deg)) scale(1);
  position: absolute; left: 0; top: calc(var(--i) * var(--step));
  display: flex; align-items: center; gap: 12px; text-decoration: none; width: max-content;
  opacity: 0; transform-origin: 0 50%;
  transform: var(--closed);
  transition: transform 0.42s cubic-bezier(.2,.9,.25,1.15), opacity 0.25s ease;
  transition-delay: calc(var(--i) * 45ms);
}
/* [data-closing] is site.js's exit animation for browsers that cannot transition display */
.fan:popover-open:not([data-closing]) .fan-item { opacity: 1; transform: var(--open); }
/* Same selector as the open rule above: @starting-style rules cascade normally, so a less specific
   selector here would lose to it and the stack would appear without animating. */
@starting-style { .fan:popover-open:not([data-closing]) .fan-item { opacity: 0; transform: var(--closed); } }
/* Hover bridge: stretch each item's hit area over the gaps between items, and the first one up to
   its button, so a pointer moving slowly down the stack never counts as leaving it. */
.fan-item::before { content: ""; position: absolute; inset: -9px -28px; } /* wide: lower rows bend and tilt sideways */
.fan-item:first-child::before { top: -18px; }

.thumb {
  width: 96px; height: 63px; border-radius: 4px 12px; overflow: hidden; display: grid; place-items: center;
  background: var(--chrome-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), 0 0 0 1px var(--chrome-line); color: var(--chrome-ink); font-size: 1.375rem; transition: transform 0.2s;
}
.thumb img, .thumb .split img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.count { font-family: var(--font-display); font-size: 1.625rem; letter-spacing: 0; flex-direction: column; display: flex; justify-content: center; align-items: center; line-height: 1; gap: 3px; }
.thumb.count small { font-family: var(--font-body); font-weight: 400; font-size: 0.625rem; letter-spacing: 0.04em; color: var(--chrome-dim); }
.lbl {
  background: var(--chrome-bg); color: var(--chrome-ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 5px 10px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,0.2); display: flex; gap: 8px; align-items: baseline;
}
.lbl b { font-size: 0.8125rem; }
.lbl small { font-family: var(--font-body); font-size: 0.625rem; color: var(--chrome-dim); }
.lbl small:empty { display: none; }
.fan-item:hover .thumb, .fan-item:focus-visible .thumb { transform: scale(1.08); }
.fan-item[aria-current] .lbl { background: var(--chrome-ink); }
.fan-item[aria-current] .lbl b { color: var(--page); }
.fan-item[aria-current] .lbl small { color: var(--page); opacity: 0.7; }

/* The cart stack hangs from the cart icon: each thumbnail under the icon, its label to the left,
   curving down and to the left like the photos stack */
.fan.cartfan { position-anchor: --cart-btn; left: auto; right: anchor(right); margin-left: 0; }
.cartfan .fan-item {
  left: auto; right: 0; flex-direction: row-reverse; transform-origin: 100% 50%;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
}
/* The way to checkout, last in the cart stack */
.thumb.go { background: var(--red); color: var(--red-ink); }
.thumb.go small { color: var(--red-ink); opacity: 0.85; }
.lbl.go { background: var(--red); }
.lbl.go b, .lbl.go small { color: var(--red-ink); }

/* Both stacks always drop down and to the left of their button, at every width. On the narrowest
   phones the photos stack can run off the left edge: a known gap, to revisit with a phone layout
   for the stacks. */
@media (max-width: 760px) {
  .lbl small { display: none; }
  .cartfan .lbl b { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Country backgrounds ---------- */
.bg { position: fixed; inset: 0; z-index: 0; background: #7a8a99 center / cover no-repeat; }
.bg-night { opacity: 0; background-color: #070a16; }
.bg-night.bg-only { opacity: 1; }
/* The night background fades in as the dusk band scrolls through, from its top entering the
   viewport to 20vh after it is fully in view. Browsers without scroll-driven animations get the
   same fade from site.js. */
@keyframes nightfall { from { opacity: 0; } to { opacity: 1; } }
/* The 0% is deliberate: it filters out browsers with only partial support */
/*noinspection CssRedundantUnit*/
@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  html { timeline-scope: --dusk; }
  .dusk { view-timeline: --dusk block; }
  .bg-night:not(.bg-only) {
    animation: nightfall auto linear both;
    animation-timeline: --dusk;
    /* Valid (CSS Scroll-driven Animations); the IDE's CSS grammar doesn't know timeline range names yet */
    /*noinspection CssInvalidPropertyValue*/
    animation-range-start: entry 0%;
    /*noinspection CssInvalidPropertyValue*/
    animation-range-end: contain 20vh;
  }
}
/* The wash: the photo's own tiny preview laid over it, so its detail softens but its colours stay
   its own. Shaped by a mask: strongest behind the intro text on the left and towards the edges, with
   a clearer window in the middle. Its strength is 50% times --wash-scroll, which site.js raises from
   0.45 (the photo as hero, at the intro and the sunset band) to 1 as the tiles cover the screen. */
.bg::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--pv, none) center / cover no-repeat; filter: saturate(0.85) brightness(0.9);
  opacity: calc(0.5 * var(--wash-scroll, 0.45));
  transition: opacity 0.3s linear;
  mask-image:
    linear-gradient(105deg, #000 0%, #000 28%, transparent 66%),
    radial-gradient(ellipse 70% 65% at 62% 48%, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.45) 55%, #000 100%);
  mask-composite: add;
}
/* Over the wash, a gentle darkening behind the text: strongest at the top left, where the intro sits.
   The wash softens the photo but hardly darkens it, so this keeps white text readable on bright
   skies (measured: about 4:1 or better behind every intro). */
.bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.38), rgba(0,0,0,0.12) 45%, rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.1) 45%, rgba(0,0,0,0.05) 70%, rgba(0,0,0,0.25));
}

/* ---------- Country intros, dusk band and end ---------- */
/* Text over photos: a tight shadow for crisp edges plus a soft halo */
.intro, .dusk, .end a { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 16px rgba(0, 0, 0, 0.45); }
.intro .eyebrow, .intro p, .intro .count { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5); }

.intro { padding-block: clamp(72px, 18vh, 200px) 40px; color: var(--hero-ink); }
.eyebrow { font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.92; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.intro h1, .intro h2 {
  font-family: var(--font-display); letter-spacing: -0.02em; line-height: 0.92;
  font-size: clamp(4rem, 15vw, 13.125rem); margin: 14px 0 18px; text-wrap: balance;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.45), 0 4px 28px rgba(0, 0, 0, 0.4);
}
.intro p { max-width: 46ch; font-size: 1.0625rem; margin: 0; }
.count { margin-top: 18px; font-family: var(--font-body); font-size: 0.75rem; opacity: 0.9; }

.dusk { padding-block: 22vh; color: #fff; text-align: center; }
.dusk .line { display: flex; align-items: center; gap: 16px; font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.dusk .line::before, .dusk .line::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.55); }

.end { padding-block: 40px 64px; color: var(--night-ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: baseline; }
.end a { font-family: var(--font-display); font-size: clamp(1.75rem, 1rem + 3.2vw, 3.5rem); letter-spacing: 0; text-decoration: none; }
.end a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.note { font-size: 0.75rem; color: var(--night-dim); max-width: 52ch; }

/* ---------- Photo tiles (masonry) ---------- */
.grid { columns: 3 300px; column-gap: 18px; padding-block: 8px 48px; }
/* A 3px frosted leaf frame around the photo, with the caption below */
.tile { text-decoration: none; break-inside: avoid; margin: 0 0 18px; border-radius: 4px 14px; overflow: hidden; cursor: pointer; position: relative; display: block; width: 100%; padding: 3px 3px 0; border: 0; text-align: left; font: inherit; background: none; color: inherit; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.4s cubic-bezier(.2,.7,.2,1), box-shadow 0.4s; }
.day .tile { background: var(--day-frost); }
.night .tile { background: var(--night-frost); }
.tile img { display: block; width: 100%; height: auto; border-radius: 2px 12px; transition: filter 0.4s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.22); }
.tile:hover img { filter: brightness(1.04); }

.cap { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; padding: 9px 11px 11px; }
.cap b { display: block; font-size: 0.9375rem; }
.cap small { display: block; font-family: var(--font-body); font-size: 0.6875rem; }
.day .cap { color: var(--day-ink); }
.day .cap small { color: var(--day-dim); }
.night .cap { color: var(--night-ink); }
.night .cap small { color: var(--night-dim); }

/* ---------- Photo viewer ---------- */
/* A native modal <dialog> covering the window: the browser makes the page inert, keeps focus inside,
   closes on Esc or the back gesture and returns focus afterwards. */
.viewer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0;
  background: rgba(6, 7, 10, 0.92); color: #eef0f3;
  grid-template-columns: minmax(0, 1fr) 320px; gap: 24px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  opacity: 0;
  transition-property: opacity, display, overlay;
  transition-duration: 0.2s;
  transition-behavior: allow-discrete;
}
.viewer[open] { display: grid; opacity: 1; }
@starting-style { .viewer[open] { opacity: 0; } }
/* Keep scrolling inside the viewer from moving the page behind it */
.viewer:modal { overscroll-behavior: contain; }
.viewer::backdrop { background: transparent; overflow: hidden; overscroll-behavior: contain; }
.viewer figure { margin: 0; display: grid; place-items: center; min-height: 0; min-width: 0; }
/* The image box is the photo itself: sized from its own proportions (the width and height
   attributes) within the space available, never stretched to the attributes' height and letterboxed.
   So the preview behind it lines up with the photo, before and after it loads, in any orientation. */
.viewer figure img { width: auto; height: auto; max-height: calc(100dvh - 64px); max-width: 100%; border-radius: 3px 10px; }
.close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); background: rgba(255,255,255,0.1); color: #fff; border: 0; border-radius: 999px; width: 40px; height: 40px; font-size: 1.25rem; cursor: pointer; }
.panel { align-self: center; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h3 { font-family: var(--font-display); font-size: 1.625rem; letter-spacing: 0; margin: 0; text-wrap: balance; }
.exif { font-family: var(--font-body); font-size: 0.75rem; color: #a8aeb8; }
.story { font-size: 0.875rem; color: #c9ced6; margin: 0; max-width: 40ch; }
.own { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); display: grid; gap: 10px; }
.own > span { font-size: 0.75rem; color: #a8aeb8; }
/* Download choices as pills (also on the checkout page) */
.pick { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.pick label { font-size: 0.75rem; padding: 5px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; cursor: pointer; color: #c9ced6; }
.pick label:has(input:checked) { border-color: #fff; color: #fff; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.pick em { font-style: normal; font-family: var(--font-body); margin-left: 4px; }
.add { justify-self: start; background: none; color: #eef0f3; border: 1px solid rgba(255,255,255,0.3); font: 500 0.8125rem/1 var(--font-display); padding: 8px 12px; border-radius: 3px 9px; cursor: pointer; }
.add:hover { border-color: #fff; }
.status { font-size: 0.75rem; color: #a8aeb8; min-height: 1.5em; margin: 0; }
.status button { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; }
.status a { color: #fff; }
/* A phone held upright: the photo above its details, the whole view scrolling. A plain column rather
   than a grid, which Firefox for Android overlapped. */
@media (max-width: 760px) and (orientation: portrait) {
  .viewer[open] { display: flex; flex-direction: column; gap: 24px; overflow-y: auto; padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
  .viewer figure { flex: none; }
  .viewer figure img { max-height: 60dvh; }
  .panel { align-self: stretch; }
}
/* A phone on its side (or any short landscape screen): photo and details side by side, the photo as
   tall as the screen allows, the details scrolling on their own if they need to. */
@media (orientation: landscape) and (max-height: 520px) {
  .viewer { grid-template-columns: minmax(0, 1fr) minmax(200px, 38%); grid-template-rows: minmax(0, 1fr); gap: 20px; padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)); }
  .viewer figure img { max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .panel { align-self: stretch; overflow-y: auto; padding-top: 48px; gap: 10px; } /* clear of the close button */
  .panel h3 { font-size: 1.375rem; }
  .own { margin-top: 8px; }
}

/* ---------- Home, about and not found ---------- */
.page { position: relative; z-index: 1; background: var(--page); color: var(--chrome-ink); min-height: 100dvh; }
.page .wrap { padding-block: clamp(48px, 10vh, 120px) 72px; }
.hello { font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.08; font-size: clamp(2.25rem, 1rem + 4.5vw, 5rem); margin: 0 0 20px; max-width: 16ch; text-wrap: balance; color: var(--slate); }
.hello b { font-weight: 400; color: var(--red); }
.hello-sm { font-size: clamp(2rem, 1.25rem + 2.6vw, 3.5rem); }
.sub { font-size: 1.0625rem; color: var(--chrome-dim); max-width: 52ch; margin: 0; }
.sub a { color: var(--chrome-ink); }
.label { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--chrome-dim); margin: 64px 0 16px; }

/* The motto, "a work in progress", one Georgia letter per cell behind the page, across the whole
   window: 6 x 3, or 3 x 6 on phones and on screens taller than they are wide.
   Letters size to their cell so they never overlap. They pop in on the first page that shows them in
   a session (see the head script in layout.templ) and are simply there after that. */
.page > .wrap { position: relative; z-index: 1; }
.awip {
  position: fixed; inset: 0; z-index: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(3, 1fr);
  container-type: size; pointer-events: none; user-select: none;
  color: var(--awip-ink); font-family: var(--font-body);
  view-transition-name: awip; /* stays put while home and about crossfade */
}
.awip span {
  display: grid; place-items: center; line-height: 1;
  font-size: min(26.6cqh, 15cqi);
  animation: awip-pop 0.4s ease-in backwards; animation-delay: calc(var(--i) * 80ms);
}
.awip-seen .awip span { animation: none; }
@keyframes awip-pop {
  0% { transform: scale(0.1); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}
@media (max-width: 760px), (orientation: portrait) {
  .awip { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(6, 1fr); }
  .awip span { font-size: min(13.3cqh, 30cqi); }
}

/* Country cards: the day and night heroes cut on a diagonal */
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.place { text-decoration: none; display: grid; gap: 10px; }
.place .split { aspect-ratio: 640 / 420; border-radius: 4px 14px; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.place:hover .split { transform: translateY(-3px); }
.place > span:last-child { display: block; }
.place b { font-family: var(--font-display); font-size: 1.625rem; letter-spacing: 0; }
.place small { font-family: var(--font-body); font-size: 0.6875rem; color: var(--chrome-dim); margin-left: 8px; }
.split { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.split img { display: block; width: 100%; height: 100%; object-fit: cover; }
.split .split-night { position: absolute; inset: 0; clip-path: polygon(62% 0, 100% 0, 100% 100%, 38% 100%); }

.about-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.portrait { aspect-ratio: 4 / 5; max-width: 100%; border-radius: 4px 16px; background: var(--chrome-line); display: grid; place-items: center; letter-spacing: 0; }
.portrait svg { width: 45%; height: auto; }
.prose { max-width: 62ch; min-width: 0; }
.prose p { margin: 0 0 14px; font-size: 1rem; }
.prose h3 { font-family: var(--font-display); font-size: 1.375rem; letter-spacing: 0; margin: 40px 0 12px; color: var(--slate); }
.roles { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.roles li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
.roles time { font-family: var(--font-body); font-size: 0.75rem; color: var(--chrome-dim); padding-top: 3px; }
.roles small { display: block; color: var(--chrome-dim); }
.draft { font-size: 0.75rem; color: var(--chrome-dim); border: 1px dashed var(--chrome-line); border-radius: 4px 12px; padding: 10px 12px; margin-bottom: 28px; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .portrait { max-width: 180px; }
  .roles li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Checkout ---------- */
.co { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; margin-top: 12px; }
.co-list { min-width: 0; display: grid; gap: 24px; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.items li { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding-block: 18px; border-bottom: 1px solid var(--chrome-line); }
.items li:first-child { border-top: 1px solid var(--chrome-line); }
.items li.empty { display: block; color: var(--chrome-dim); }
.items img { width: 168px; height: 112px; object-fit: cover; border-radius: 3px 12px; display: block; }
.items b { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0; display: block; }
.items small { font-size: 0.75rem; color: var(--chrome-dim); display: block; font-family: var(--font-body); margin: 2px 0 10px; }
.items .pick label { color: var(--chrome-dim); border-color: var(--chrome-line); }
.items .pick label:has(input:checked) { color: var(--chrome-ink); border-color: var(--chrome-ink); }
.items .rm { background: none; border: 0; color: var(--chrome-dim); font-size: 0.75rem; text-decoration: underline; cursor: pointer; padding: 0; margin-top: 10px; }
.items .amt { font-family: var(--font-body); font-size: 0.9375rem; text-align: right; }
.back { font-size: 0.875rem; color: var(--chrome-dim); text-decoration: none; }
.back:hover { color: var(--chrome-ink); }
.summary { position: sticky; top: calc(88px + env(safe-area-inset-top, 0px)); /* header height + 24px */ display: grid; gap: 12px; padding: 20px; border-radius: 4px 16px; background: var(--chrome-line); }
.summary .row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; }
.summary .dim { color: var(--chrome-dim); font-size: 0.8125rem; }
.summary .total { font-family: var(--font-body); font-size: 1rem; border-top: 1px solid var(--chrome-line); padding-top: 12px; }
/* The one red fill on the page */
.checkout { background: var(--red); color: var(--red-ink); border: 0; font-size: 0.9375rem; line-height: 1; padding: 14px 16px; border-radius: 4px 12px; cursor: pointer; }
.checkout:disabled { opacity: 0.4; cursor: default; }
.summary .fine { font-size: 0.75rem; color: var(--chrome-dim); margin: 0; }
@media (max-width: 760px) {
  .co { grid-template-columns: 1fr; gap: 28px; }
  .summary { position: static; }
  .items li { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .items img { width: 96px; height: 64px; }
  .items .amt { grid-column: 2; text-align: left; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fan-item { --closed: var(--open); transition: opacity 0.15s; transition-delay: 0s; }
  .fan { transition-duration: 0.15s; }
  .viewer { transition-duration: 0.1s; }
  .tile, .tile img, .place .split { transition: none; }
  .awip span { animation: none; }
  .tile:hover { transform: none; }
}
