/* 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: #c3c8d4; /* lighter than the frost alone needs, for bright patches showing through it */
  --hero-ink: #ffffff; /* text set straight on a photo */

  /* The photo viewer and photo pages: dark in both themes, so the photo reads true */
  --viewer-bg: rgba(6, 7, 10, 0.92);
  --viewer-page: rgb(6, 7, 10);
  --viewer-ink: #eef0f3;
  --viewer-dim: #a8aeb8;
  --viewer-soft: #c9ced6;
  --viewer-line: rgba(255, 255, 255, 0.12);
  --viewer-edge: rgba(255, 255, 255, 0.3);

  /* Country backgrounds before their photo arrives (the preview usually covers these) */
  --bg-day-fill: #7a8a99;
  --bg-night-fill: #070a16;
  --awip-ink: rgba(39, 41, 40, 0.06); /* the motto's letter grid */

  /* Pointing at a photo: it eases about 4% closer inside its still frame while a red underline draws
     under its title, both over the same 0.7s (see "Pointing at a photo" below) */
  --push: 1.04;
  --push-time: 0.7s;
  --push-ease: cubic-bezier(.16, 1, .3, 1);

  /* Type scale: five steps, nothing under 12px. Display sizes are fluid (clamp) where they're used, and
     the wordmark (.owner, .motto) keeps its own proportions. */
  --fs-xs: 0.75rem;   /* 12px: metadata, labels, fine print */
  --fs-sm: 0.875rem;  /* 14px: small interface text, secondary lines */
  --fs-md: 1rem;      /* 16px: body text, links, captions */
  --fs-lg: 1.375rem;  /* 22px: subheadings, list titles */
  --fs-xl: 1.625rem;  /* 26px: card and photo titles */

  /* 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: var(--fs-md); line-height: 1.5; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* Targets of the day/night links and the skip link: focusable so keyboard focus follows, but no ring */
:is(section, main)[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
/* Body copy avoids one-word last lines; headings use balance instead */
p, li { text-wrap: pretty; }
.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 */
/* A tapped tile shows it's working when the viewer is slow to arrive: it pulses gently, after a short
   delay so a quick open shows nothing (and stays still under reduced motion) */
.tile.htmx-request { animation: tile-wait 0.9s ease-in-out 0.15s infinite alternate; }
@keyframes tile-wait { to { opacity: 0.72; } }

/* Lintel has one weight: never let the browser fake a bold */
.owner, .hello, .intro h1, .intro h2, .end a, .place b, .ptitle, .prose h2, .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, .step, .pos, .checkout, .summary, .rm, .back, .status, .draft, .fine, .legal-list a { 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, .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. */
/* The header and footer share it. --chrome-dim is darker than the page's #56605f: over the dark theme
   or a night photo the 75% white works out at about #c7c7c7, where #56605f is only 3.8:1 and this is 5.2:1 */
.bar, .foot, body::before {
  --chrome-bg: rgba(255, 255, 255, 0.75); --chrome-ink: #1e1e20; --chrome-dim: #434c4b;
  --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: var(--fs-md); 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); }
/* The current page is marked by more than colour: a thin red underline, like the header rule */
.top-links > a[aria-current="page"], .photosbtn.on {
  text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 5px;
}

/* 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); }
/* Hit areas bigger than the icons (24px+ tall): the sun's reaches up and the moon's down, so the two
   never overlap, and only a little sideways, short of the neighbouring links */
.halfnav a { position: relative; }
.halfnav a::after { content: ""; position: absolute; inset: -12px -5px -1px; }
.halfnav a + a::after { inset: -1px -5px -12px; }
/* On touch screens, the header's links and buttons get bigger hit areas too (about 44px tall) */
@media (pointer: coarse) {
  .photosbtn, .top-links > a, .cartbtn { position: relative; }
  .photosbtn::after, .top-links > a::after { content: ""; position: absolute; inset: -10px -4px; }
  .cartbtn::after { content: ""; position: absolute; inset: -6px -8px; }
}
/* Always in the header, but greyed out (no link) except on a country page, and for a half the
   country doesn't have */
.halfnav a[aria-disabled] { opacity: 0.35; cursor: default; }
.halfnav a[aria-disabled]::after { content: none; }
/* :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); }

/* 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); }
/* Always in the header; greyed out while the cart is empty */
.cartbtn:disabled { opacity: 0.4; cursor: default; color: var(--chrome-dim); }
.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 var(--fs-xs)/16px var(--font-body); text-align: center; }

/* On phones the links sit at the right, next to the cart. Wherever there is room (above 480px)
   they sit in the centre of the header, between the identity and the cart. */
@media (max-width: 480px) {
  .top-links { margin-left: auto; }
}
@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; }
}
/* With the cart always there, the header just fits on one line at 360px */
@media (max-width: 400px) {
  .bar { column-gap: 8px; }
  .wordmark { gap: 6px; }
  .top-links { gap: 8px; }
}

/* Skip link: the first thing Tab reaches, shown over the header (fixed, so nothing moves) */
.skip {
  position: fixed; z-index: 11; top: calc(8px + env(safe-area-inset-top, 0px));
  left: max(16px, env(safe-area-inset-left, 0px), calc((100% - 1400px) / 2 + 16px));
  padding: 8px 14px; border-radius: 4px 12px; border-bottom: 1px solid var(--red);
  background: rgba(255, 255, 255, 0.96); color: #1e1e20; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  font: var(--fs-md)/1.2 var(--font-display); text-decoration: none;
}
.skip:where(:not(:focus-within, :active)) {
  clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap;
}

/* ---------- 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 {
  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 var(--fs-sm)/1.5 var(--font-body);
  view-transition-name: site-foot;
}
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.foot p { margin: 0; }
/* "small print": the legal pages, in a stack that rises up and to the left */
.footbtn { anchor-name: --foot-btn; background: none; border: 0; padding: 0; font: inherit; color: var(--chrome-dim); cursor: pointer; }
.footbtn:hover, .footbtn[aria-expanded="true"] { color: var(--chrome-ink); }
@media (pointer: coarse) {
  .footbtn { position: relative; }
  .footbtn::after { content: ""; position: absolute; inset: -10px -6px; }
}
.foot .wip { color: var(--red); font-style: normal; font-family: var(--font-display); } /* review-site builds only */
@media (min-width: 761px) and (min-height: 521px) {
  body { padding-bottom: calc(38px + env(safe-area-inset-bottom, 0px)); } /* the footer's height */
  .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. */
/* Countries that don't fit below the button on a short window (site.js) */
.fan-item[data-overflow] { display: none; }
.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: var(--fs-lg); 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: var(--fs-xl); 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: var(--fs-xs); 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: var(--fs-sm); }
.lbl small { font-family: var(--font-body); font-size: var(--fs-xs); color: var(--chrome-dim); }
.lbl small:empty { display: none; }
/* In the stacks the whole card grows a little under the pointer (not the photos' push-in) */
.fan-item:hover .thumb, .fan-item:focus-visible .thumb, .fan-link: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; transform-origin: 100% 50%; }
.cartfan .fan-link { display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
/* Rebuilt while open (after a remove): the items stay put rather than replaying the opening */
.fan[data-instant] .fan-item { transition: none; }
/* Each photo's "−" on its thumbnail's top corner, in the style of the viewer's close button. With a
   mouse it shows on hover or focus; on touch screens it's always there. */
.unfan {
  position: absolute; top: -7px; right: -7px; z-index: 1;
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 2px 7px; background: var(--red); color: var(--red-ink);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3); cursor: pointer;
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.fan-item:hover .unfan, .fan-item:focus-within .unfan { opacity: 1; }
.unfan:hover { transform: scale(1.12); }
@media (pointer: coarse) {
  .unfan { opacity: 1; }
  .unfan::after { content: ""; position: absolute; inset: -8px; } /* a bigger target than it looks */
}
/* 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); }

/* The small print stack rises from its button in the footer, up and to the left, labels only */
.fan.footfan { position-anchor: --foot-btn; top: auto; bottom: anchor(top); left: auto; right: anchor(right); margin: 0 0 12px; }
/* The small print stack: the cart stack's layout (each card on the right, its label to the left),
   rising from the footer instead of dropping */
.footfan .fan-item {
  --closed: translate(0, calc(var(--i) * var(--step) + 30px)) rotate(0deg) scale(0.6);
  --open: translate(var(--x), 0) rotate(calc(var(--i) * -1.5deg)) scale(1);
  top: auto; left: auto; right: 0; bottom: calc(var(--i) * var(--step));
  flex-direction: row-reverse; transform-origin: 100% 50%; font-style: normal;
}
.footfan .fan-item:first-child::before { top: -9px; bottom: -18px; }
.licon { display: block; }

/* 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: var(--bg-day-fill) center / cover no-repeat; }
.bg-night { opacity: 0; background-color: var(--bg-night-fill); }
.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.44), rgba(0,0,0,0.14) 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: var(--fs-sm); 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: var(--fs-md); margin: 0; }
.count { margin-top: 18px; font-family: var(--font-body); font-size: var(--fs-sm); opacity: 0.92; }

.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: var(--fs-xs); 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; }

/* ---------- 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: background var(--push-time) var(--push-ease); }
.day .tile { background: var(--day-frost); }
.night .tile { background: var(--night-frost); }
/* The photo sits in a clipping box inside the frame, so it can ease closer without the frame moving */
.tile .clip { display: block; overflow: hidden; border-radius: 2px 12px; }
.tile img { display: block; width: 100%; height: auto; border-radius: 2px 12px; }

.cap { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; padding: 9px 11px 11px; }
.cap b { font-size: var(--fs-md); }
.cap small { margin-top: 1px; }
.cap small { display: block; font-family: var(--font-body); font-size: var(--fs-xs); }
.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: var(--viewer-bg); color: var(--viewer-ink);
  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; }
/* A photo's own page (/<country>/<id>/) lays out the same as the viewer, under the header */
.photo-page {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px;
  min-height: calc(100dvh - 66px); padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  background: var(--viewer-page); color: var(--viewer-ink);
}
.photo-page .close { position: absolute; top: 12px; }
.photo-page figure img { max-height: calc(100dvh - 160px); }
:is(.viewer, .photo-page) figure { margin: 0; display: grid; place-items: center; min-height: 0; min-width: 0; }
/* A horizontal swipe on the photo steps to the next or previous one (site.js); vertical scrolling stays */
.viewer figure { touch-action: pan-y; }
/* 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. */
:is(.viewer, .photo-page) figure img { width: auto; height: auto; max-height: calc(100dvh - 64px); max-width: 100%; border-radius: 3px 10px; }
/* Close: a small red square with the leaf corners and a thin white cross */
.close {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: var(--red); color: var(--red-ink); border: 0; border-radius: 3px 10px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35); transition: transform 0.15s;
}
.close:hover { transform: scale(1.08); }
.close svg { display: block; }
@media (pointer: coarse) { .close::after { content: ""; position: absolute; inset: -4px; } }
/* The details sit on a faint leaf-cornered panel with the header's red rule along its top */
.panel {
  align-self: center; display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: 18px 20px 20px; border-top: 1px solid var(--red); border-radius: 0 0 4px 14px;
  background: rgba(255, 255, 255, 0.045);
}
/* A night photo's own colours, blurred, tinting the dark around it (the browser's smoothing of the
   few-pixel preview is the blur) */
.vtint { position: fixed; inset: 0; z-index: -1; background: center / cover no-repeat; opacity: 0.4; filter: saturate(1.15); pointer-events: none; }
.photo-page .vtint { position: absolute; }
.ptitle { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.15; letter-spacing: 0; margin: 0; text-wrap: balance; }
.exif { font-family: var(--font-body); font-size: var(--fs-xs); color: var(--viewer-dim); }
.story { font-size: var(--fs-sm); color: var(--viewer-soft); margin: 0; max-width: 40ch; }
/* Previous and next, within the same half of the country */
.pnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 6px; }
.pnav .pos { font-size: var(--fs-xs); color: var(--viewer-dim); text-align: center; font-variant-numeric: lining-nums tabular-nums; }
.step {
  justify-self: start; min-height: 36px; padding: 8px 12px; border: 1px solid var(--viewer-edge); border-radius: 3px 9px;
  background: none; color: var(--viewer-ink); font: var(--fs-sm)/1 var(--font-display); text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.step.next { justify-self: end; }
.step:hover { border-color: #fff; }
span.step { border: 0; }
.own { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--viewer-line); display: grid; gap: 10px; }
.own > span { font-size: var(--fs-xs); color: var(--viewer-dim); }
/* 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: var(--fs-xs); padding: 5px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; cursor: pointer; color: var(--viewer-soft); }
.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: var(--viewer-ink); border: 1px solid var(--viewer-edge); font: var(--fs-sm)/1 var(--font-display); padding: 8px 12px; border-radius: 3px 9px; cursor: pointer; }
.add:hover { border-color: #fff; }
.status { font-size: var(--fs-xs); color: var(--viewer-dim); 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; }
}
@media (max-width: 760px) {
  .photo-page { display: flex; flex-direction: column; padding-top: 60px; }
  .photo-page figure img { max-height: 70dvh; }
}
/* 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; margin-top: 48px; padding-top: 14px; gap: 10px; } /* clear of the close button */
  .ptitle { font-size: var(--fs-lg); }
  .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: var(--fs-md); color: var(--chrome-dim); max-width: 52ch; margin: 0; }
.sub a { color: var(--chrome-ink); }
/* Links in running text on the pages without photos (home, about, small print, not found): the
   header's thin red rule as their underline */
:is(.sub, .prose) a { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- All photos ---------- */
.photos-head { margin-bottom: clamp(32px, 5vw, 56px); }
.tally {
  margin: 0 0 14px; font: var(--fs-xs)/1.4 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--chrome-dim); font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- Home: the intro beside a map of the countries ---------- */
.home .wrap { padding-block: clamp(24px, 5vh, 64px) 72px; }
.home-hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px);
  align-items: center; min-height: calc(100dvh - 190px);
}
.home-intro .hello { font-size: clamp(2.25rem, 1rem + 3.6vw, 4.25rem); }
.home-all { margin: 28px 0 0; }
.home-all .back { font-size: var(--fs-md); color: var(--chrome-ink); }
@media (max-width: 760px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
}

/* The map: Natural Earth's coastlines (cmd/mapgen) on a faint latitude / longitude grid, with the
   water hinted by soft blue along the coasts only. Sizes follow the map's own width (cqi). */
.homemap {
  position: relative; container-type: inline-size; margin-top: clamp(24px, 5vw, 72px); /* room above Europe for its photos */
  --map-water: #8db9d6; --map-land: color-mix(in oklab, var(--chrome-ink) 10%, var(--page));
  --thumb: clamp(40px, 13.7cqi, 110px); --reach: clamp(38px, 13cqi, 100px); /* in proportion down to a 290px map */
}
/* On the dark page a light blue glows, so it is softer there (--water-k scales the strokes) */
@media (prefers-color-scheme: dark) { .homemap { --map-water: #4a7c9c; --water-k: 0.5; } }
.map { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.map .grat { stroke: var(--chrome-line); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.map .eq { stroke: color-mix(in oklab, var(--chrome-dim) 45%, transparent); stroke-dasharray: 3 5; }
.map text { font: 11px var(--font-body); fill: var(--chrome-dim); font-variant-numeric: lining-nums; }
.map .land { fill: var(--map-land); fill-opacity: 0.75; } /* the grid and the motto's letters show faintly through */
.map .coast { fill: none; stroke: var(--map-water); stroke-linejoin: round; stroke-linecap: round; }
/* Three widths stacked, so the blue fades gradually out to sea rather than stopping at an edge */
.map .coast.far { stroke-width: 24; opacity: calc(0.12 * var(--water-k, 1)); }
.map .coast.mid { stroke-width: 13; opacity: calc(0.2 * var(--water-k, 1)); }
.map .coast.near { stroke-width: 5; opacity: calc(0.42 * var(--water-k, 1)); }

/* Each country: a red pin, and a photo beside it on a thin leader line. The pin itself is a point;
   the photo sits --ox / --oy reaches away from it. */
.pin {
  position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; z-index: 2;
  text-decoration: none; color: var(--chrome-ink);
  --dx: calc(var(--ox) * var(--reach)); --dy: calc(var(--oy) * var(--reach));
}
.pin:is(:hover, :focus-visible) { z-index: 3; }
.pin:focus-visible { outline: none; }
.pin:focus-visible .ph { outline: 2px solid var(--red); outline-offset: 2px; }
.pin-dot {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pin-line {
  position: absolute; left: 0; top: 0; height: 1px; transform-origin: 0 50%;
  width: calc(hypot(var(--dx), var(--dy)) - var(--thumb) * 0.4);
  rotate: atan2(var(--dy), var(--dx)); background: var(--chrome-dim); opacity: 0.6;
}
.pin-card { position: absolute; left: var(--dx); top: var(--dy); translate: -50% -50%; display: grid; gap: 4px; justify-items: center; }
/* The photos look and behave like the stacks' thumbnails: no frame, the stacks' corners and shadow,
   and the whole photo grows 8% under the pointer or keyboard focus */
.pin-card .ph {
  display: block; width: var(--thumb); border-radius: 4px 12px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--chrome-line); transition: transform 0.2s;
}
.pin-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.pin:is(:hover, :focus-visible) .ph { transform: scale(1.08); }
.pin-card .nm { font: var(--fs-xs)/1 var(--font-display); white-space: nowrap; padding: 2px 7px 4px; border-radius: 999px; /* Lintel sits low in its line: 1px of padding moves from top to bottom so the name looks centred in this small pill */ background: rgba(255, 255, 255, 0.8); color: #1e1e20; }
/* First visit in a session: the map fades up, the pins drop in turn, and each photo blooms out of its pin */
@media (prefers-reduced-motion: no-preference) {
  html:not(.map-seen) .map { animation: map-in 1.2s ease-out backwards; }
  html:not(.map-seen) .pin-dot { animation: pin-drop 0.6s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 260ms + 500ms); }
  html:not(.map-seen) .pin-line { animation: pin-line 0.5s var(--push-ease) backwards; animation-delay: calc(var(--i) * 260ms + 850ms); }
  html:not(.map-seen) .pin-card { animation: pin-bloom 0.8s var(--push-ease) backwards; animation-delay: calc(var(--i) * 260ms + 950ms); }
}
/* Beside the intro, once the map is wide, there is room around it: photos near an edge pop out past
   it (wideOffsets in map.go) */
@media (min-width: 761px) {
  @container (min-width: 560px) {
    .pin { --dx: calc(var(--wox, var(--ox)) * var(--reach)); --dy: calc(var(--woy, var(--oy)) * var(--reach)); }
  }
}
/* A phone-sized map: smaller names, so the row of European photos keeps its labels apart */
@container (max-width: 540px) {
  .pin-card .nm { font-size: 10px; padding: 1px 5px 3px; }
}
@keyframes map-in { from { opacity: 0; } }
@keyframes pin-drop { from { translate: 0 -60px; opacity: 0; } 40% { opacity: 1; } }
@keyframes pin-line { from { scale: 0 1; } }
@keyframes pin-bloom { from { translate: calc(-50% - var(--dx)) calc(-50% - var(--dy)); scale: 0.1; opacity: 0; } }

/* 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; }
.place > span:last-child { display: block; }
.place b { font-family: var(--font-display); font-size: var(--fs-xl); letter-spacing: 0; }
.place small { font-family: var(--font-body); font-size: var(--fs-xs); 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: var(--fs-md); }
.prose h2 { font-family: var(--font-display); font-size: var(--fs-lg); 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: var(--fs-xs); color: var(--chrome-dim); padding-top: 3px; }
.roles small { display: block; color: var(--chrome-dim); }
.draft { font-size: var(--fs-xs); 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; }
}

/* ---------- Small print ---------- */
.legal { max-width: 68ch; }
.legal .updated { font-size: var(--fs-xs); color: var(--chrome-dim); margin-bottom: 28px; }
.legal ul { padding-left: 1.2em; margin: 0 0 14px; }
.legal li { margin-bottom: 4px; }
.legal-list { list-style: none; padding: 0 !important; display: grid; gap: 18px; margin-top: 24px !important; }
.legal-list a { font-size: var(--fs-lg); color: var(--slate); text-decoration: none; }
.legal-list small { display: block; color: var(--chrome-dim); font-size: var(--fs-sm); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; margin: 0 0 14px; }
.facts dt { font-family: var(--font-display); color: var(--chrome-dim); font-size: var(--fs-sm); padding-top: 2px; }
.facts dd { margin: 0; }
.back-sp { margin-top: 40px !important; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 10px; } }

/* ---------- 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 .pic { display: block; border-radius: 3px 12px; overflow: hidden; }
.items img { width: 168px; height: 112px; object-fit: cover; border-radius: 3px 12px; display: block; }
.items b a { text-decoration: none; }
.items b { font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: 0; display: block; }
.items small { font-size: var(--fs-xs); 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: var(--fs-xs); text-decoration: underline; cursor: pointer; padding: 0; margin-top: 10px; }
.items .amt { font-family: var(--font-body); font-size: var(--fs-md); text-align: right; }
.back { font-size: var(--fs-sm); color: var(--chrome-dim); text-decoration: none; }
.back:hover { color: var(--chrome-ink); }
/* Links that stand on their own ("← keep browsing", the small print list): no underline until the
   pointer arrives, then the red one draws in from the left, as under a photo's title */
.prose :is(.legal-list a, .back) { text-decoration: none; }
:is(.back, .legal-list a) {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 1px;
  transition: background-size var(--push-time) var(--push-ease), color 0.2s;
}
:is(.back, .legal-list a):is(:hover, :focus-visible) { background-size: 100% 1px; }
.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: var(--fs-sm); }
/* Secondary text on the summary's tinted panel, where --chrome-dim is only 4.3:1 (this is 6.6:1) */
.summary .dim { color: color-mix(in oklab, var(--chrome-ink) 80%, transparent); font-size: var(--fs-sm); }
.summary .total { font-family: var(--font-body); font-size: var(--fs-md); 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: var(--fs-md); line-height: 1; padding: 14px 16px; border-radius: 4px 12px; cursor: pointer; }
.checkout:disabled { opacity: 0.4; cursor: default; }
.summary .fine { font-size: var(--fs-xs); color: color-mix(in oklab, var(--chrome-ink) 80%, transparent); 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; }
}

/* ---------- Pointing at a photo ---------- */
/* Tiles, home cards and checkout photos all answer the same way (the stacks keep their own grow).
   Nothing moves its frame (a frame that moves slides out from under the pointer near its edge and
   flickers): the picture eases a little closer inside it, and a thin red underline draws under the
   title from left to right, both over --push-time. Tiles' frosting brightens too. Only with a real
   mouse, so a tap never leaves a photo stuck mid-effect; a keyboard gets the same on focus. Touch
   screens get a quick press instead. */
:is(.tile .clip img, .place .split img, .items .pic img) {
  transition: scale var(--push-time) var(--push-ease);
}
:is(.cap b, .place b, .items b a) {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 1px;
  transition: background-size var(--push-time) var(--push-ease);
}
@media (hover: hover) and (pointer: fine) {
  :is(.tile:hover .clip img, .place:hover .split img, .items li:has(a[data-open]:hover) .pic img) { scale: var(--push); }
  :is(.tile:hover .cap b, .place:hover b, .items li:has(a[data-open]:hover) b a) { background-size: 100% 1px; }
  .day .tile:hover { background: rgba(255, 255, 255, 0.9); }
  .night .tile:hover { background: rgba(30, 30, 32, 0.82); }
}
:is(.tile:focus-visible .clip img, .place:focus-visible .split img) { scale: var(--push); }
:is(.tile:focus-visible .cap b, .place:focus-visible b, .items b a:focus-visible) { background-size: 100% 1px; }
/* The press: a quick, small give as a finger (or mouse button) goes down */
:is(.tile, .place .split, .items .pic) { transition-property: scale, background; transition-duration: 140ms, var(--push-time); transition-timing-function: ease-out, var(--push-ease); }
.tile:active, .items .pic:active, .place:active .split { scale: 0.985; }

/* ---------- 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; }
  .close, .unfan { transition: none; }
  .awip span { animation: none; }
  /* No push-in; the underline and frosting simply appear */
  :is(.tile, .place, .items li) img { scale: 1 !important; transition: none; }
  :is(.cap b, .place b, .items b a, .back, .legal-list a) { transition: none; }
  .tile.htmx-request { animation: none; opacity: 0.8; }
}
