/* ==========================================================================
   Andrew Thomson Photography
   "Field & Feather" — a field-guide plate crossed with a gallery wall.

   1.  Tokens
   2.  Reset & base
   3.  Typography
   4.  Layout primitives
   5.  Motion primitives
   6.  Header & navigation
   7.  Hero
   8.  Gallery
   9.  Lightbox
   10. Photograph page
   11. Commerce (cart, checkout, download, confirmation)
   12. Forms & buttons
   13. Footer
   14. Overlays (toast, viewfinder cursor)
   15. Reduced motion
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..800&family=Inter:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Surfaces — warm paper, like a museum plate, never clinical white */
  --paper:        #f6f2ea;
  --paper-raised: #fffdf8;
  --paper-sunk:   #ece6da;
  --paper-deep:   #e2dbcc;

  /* Ink */
  --ink:       #16140f;
  --ink-soft:  #4a443c;
  --ink-muted: #7d7566;

  /* Hairlines */
  --line:        rgba(22, 20, 15, 0.13);
  --line-strong: rgba(22, 20, 15, 0.28);

  /* Accents drawn from the birds themselves: kestrel ochre, eucalypt leaf */
  --ochre:      #a95c1c;
  --ochre-lift: #c2762f;
  --ochre-wash: rgba(169, 92, 28, 0.09);
  --euc:        #4c6146;
  --euc-wash:   rgba(76, 97, 70, 0.1);

  /* Semantic */
  --good:   #3f6b45;
  --warn:   #8a6512;
  --bad:    #9d3221;
  --good-wash: rgba(63, 107, 69, 0.1);
  --warn-wash: rgba(138, 101, 18, 0.1);
  --bad-wash:  rgba(157, 50, 33, 0.09);

  /* Shadow — soft, warm, low; prints don't float */
  --shadow-sm: 0 1px 2px rgba(30, 24, 12, 0.05), 0 2px 8px rgba(30, 24, 12, 0.04);
  --shadow-md: 0 2px 6px rgba(30, 24, 12, 0.06), 0 12px 32px rgba(30, 24, 12, 0.07);
  --shadow-lg: 0 4px 12px rgba(30, 24, 12, 0.08), 0 28px 64px rgba(30, 24, 12, 0.12);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 68ch;
  --shell: 1600px;
  --shell-narrow: 940px;
  --radius: 3px;
  --radius-lg: 6px;

  /* Motion — everything glides and settles, nothing snaps or bounces */
  --ease-glide:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 220ms;
  --dur:      420ms;
  --dur-slow: 780ms;

  --header-h: 84px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper:        #100f0c;
  --paper-raised: #1a1814;
  --paper-sunk:   #0a0908;
  --paper-deep:   #24211b;

  --ink:       #f2ede3;
  --ink-soft:  #c5bdaf;
  --ink-muted: #928a7b;

  --line:        rgba(242, 237, 227, 0.14);
  --line-strong: rgba(242, 237, 227, 0.3);

  --ochre:      #dda162;
  --ochre-lift: #ecb87c;
  --ochre-wash: rgba(221, 161, 98, 0.12);
  --euc:        #92ab86;
  --euc-wash:   rgba(146, 171, 134, 0.12);

  --good:   #8fbe93;
  --warn:   #d8b45f;
  --bad:    #e08a76;
  --good-wash: rgba(143, 190, 147, 0.12);
  --warn-wash: rgba(216, 180, 95, 0.12);
  --bad-wash:  rgba(224, 138, 118, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.5), 0 32px 72px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(0.975rem, 0.94rem + 0.16vw, 1.0625rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease-soft), color var(--dur) var(--ease-soft);
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

/* The UA's [hidden] rule loses to any class that sets `display`, and plenty of
   components here do. Scripts toggle `.hidden = true` all over the commerce
   pages, so make the attribute authoritative. */
[hidden] {
  display: none !important;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; cursor: pointer; }

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--ochre);
  color: var(--paper-raised);
}

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-settle);
}
.skip-link:focus-visible { transform: translateY(0); }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper-sunk); }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--paper-sunk);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ochre); }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* The display classes are used on headings and on plain elements alike, so
   they carry the family themselves rather than relying on the h1–h4 rule. */
.display-xl,
.display-lg,
.display-md,
.display-sm {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
}

.display-xl {
  font-size: clamp(2.85rem, 1.4rem + 6.4vw, 7.5rem);
  font-variation-settings: "opsz" 144, "wght" 380;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.display-lg {
  font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4.4rem);
  font-variation-settings: "opsz" 96, "wght" 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.display-md {
  font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.9rem);
  font-variation-settings: "opsz" 60, "wght" 420;
  letter-spacing: -0.022em;
}

.display-sm {
  font-size: clamp(1.25rem, 1.08rem + 0.72vw, 1.7rem);
  font-variation-settings: "opsz" 36, "wght" 450;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

/* The field-notes voice: catalogue numbers, dates, section markers */
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-feature-settings: "tnum";
}

.label--ochre { color: var(--ochre); }

.lede {
  font-size: clamp(1.05rem, 0.98rem + 0.42vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
  text-wrap: pretty;
}

.prose { max-width: var(--measure); }
.prose p { margin-bottom: 1.35em; color: var(--ink-soft); text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--ochre);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease-soft);
}
.prose a:hover { color: var(--ink); }

.drop-cap::first-letter {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "wght" 340;
  font-size: 3.9em;
  line-height: 0.78;
  float: left;
  padding: 0.06em 0.1em 0 0;
  color: var(--ochre);
}

/* Section heading with a rule that draws itself across on reveal */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: clamp(1.75rem, 3vw, 3rem);
}
.section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease-settle) 120ms;
}
.is-revealed .section-head__rule,
.section-head.is-revealed .section-head__rule { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow { max-width: var(--shell-narrow); }
.shell--mid { max-width: 1200px; }

.section { padding-block: clamp(3.5rem, 8vw, 8rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4.5rem); }

.page-head {
  padding-top: clamp(2.5rem, 6vw, 5.5rem);
  padding-bottom: clamp(1.75rem, 4vw, 3rem);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

.stack > * + * { margin-top: var(--stack-gap, 1rem); }

/* A hairline grid backdrop — like the faint ruling on a specimen card */
.ruled {
  position: relative;
  isolation: isolate;
}
.ruled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 78%);
  opacity: 0.55;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. Motion primitives
   -------------------------------------------------------------------------- */

@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-out 240ms var(--ease-soft) both;
}
::view-transition-new(root) {
  animation: vt-in 460ms var(--ease-settle) both;
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Scroll-reveal: content lifts and focuses, the way a bird resolves in a lens */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition:
    opacity var(--dur-slow) var(--ease-settle),
    transform var(--dur-slow) var(--ease-settle),
    filter var(--dur-slow) var(--ease-settle);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* Line-by-line mask reveal for display headings */
.reveal-lines { display: block; }
.reveal-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.reveal-line > span {
  display: block;
  transform: translateY(115%);
  transition: transform 1.05s var(--ease-settle);
  transition-delay: var(--line-delay, 0ms);
}
.is-revealed .reveal-line > span,
.reveal-lines.is-revealed .reveal-line > span { transform: translateY(0); }

/* Reading progress hairline */
.progress-rail {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.progress-rail__fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--ochre), var(--ochre-lift));
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(2vw, -1.6vh, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes glide-across {
  from { transform: translate3d(-14vw, 0, 0); }
  to   { transform: translate3d(114vw, 0, 0); }
}

@keyframes wingbeat {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50%      { transform: scaleY(0.42) translateY(-0.35em); }
}

@keyframes pop {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.42); }
  100% { transform: scale(1); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer {
  from { background-position: -160% 0; }
  to   { background-position: 260% 0; }
}

/* --------------------------------------------------------------------------
   6. Header & navigation
   -------------------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition:
    background-color var(--dur) var(--ease-soft),
    border-color var(--dur) var(--ease-soft),
    backdrop-filter var(--dur) var(--ease-soft);
  border-bottom: 1px solid transparent;
}

.header.is-stuck {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
  transition: min-height var(--dur) var(--ease-soft);
}
.header.is-stuck .header__inner { min-height: 66px; }

/* Over a full-bleed hero the header rides on the photograph, so it switches
   to light type until the visitor scrolls and the bar solidifies. */
[data-hero="true"] .header:not(.is-stuck) .wordmark__name,
[data-hero="true"] .header:not(.is-stuck) .nav__link,
[data-hero="true"] .header:not(.is-stuck) .icon-btn {
  color: rgba(255, 255, 255, 0.92);
}
[data-hero="true"] .header:not(.is-stuck) .wordmark__role {
  color: rgba(255, 255, 255, 0.62);
}
[data-hero="true"] .header:not(.is-stuck) .nav__link[aria-current="page"] {
  color: #fff;
}
[data-hero="true"] .header:not(.is-stuck) .icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
[data-hero="true"] .header:not(.is-stuck) .cart-btn__count {
  border-color: transparent;
}
[data-hero="true"] .header:not(.is-stuck) .wordmark:hover .wordmark__name {
  color: var(--ochre-lift);
}

/* Wordmark: name in the display face, role beneath in field-notes mono */
.wordmark {
  display: grid;
  gap: 0.14em;
  margin-right: auto;
  line-height: 1;
}
.wordmark__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wght" 460;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  letter-spacing: -0.02em;
  transition: color var(--dur-fast) var(--ease-soft);
}
.wordmark__role {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.wordmark:hover .wordmark__name { color: var(--ochre); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
}
@media (max-width: 860px) { .nav { display: none; } }

.nav__link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-block: 0.4rem;
  transition: color var(--dur-fast) var(--ease-soft);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease-settle);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after,
.nav__link:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current="page"] { color: var(--ochre); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.header__tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink-soft);
  position: relative;
  transition:
    background-color var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft),
    transform var(--dur-fast) var(--ease-settle);
}
.icon-btn:hover {
  background: var(--ochre-wash);
  color: var(--ochre);
  transform: translateY(-1px);
}
.icon-btn svg { width: 20px; height: 20px; }

/* Theme toggle — sun and moon trade places on a rotation */
.theme-toggle__icons {
  position: relative;
  width: 20px;
  height: 20px;
}
.theme-toggle__icons svg {
  position: absolute;
  inset: 0;
  transition:
    opacity var(--dur) var(--ease-settle),
    transform var(--dur) var(--ease-settle);
}
.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-75deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(75deg) scale(0.5); }

.cart-btn__count {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  display: grid;
  place-items: center;
  background: var(--ochre);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 99px;
  border: 2px solid var(--paper);
  transition: opacity var(--dur-fast) var(--ease-soft), transform var(--dur-fast) var(--ease-soft);
}
.header.is-stuck .cart-btn__count { border-color: transparent; }
.cart-btn__count[data-empty="true"] { opacity: 0; transform: scale(0.4); }
.cart-btn__count.is-bumping { animation: pop 520ms var(--ease-settle); }

/* Mobile menu */
.menu-btn { display: none; }
@media (max-width: 860px) { .menu-btn { display: grid; } }

.menu-btn__bars {
  width: 20px;
  height: 12px;
  position: relative;
}
.menu-btn__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease-settle), opacity var(--dur-fast) var(--ease-soft);
}
.menu-btn__bars span:nth-child(1) { top: 0; }
.menu-btn__bars span:nth-child(2) { top: 5px; }
.menu-btn__bars span:nth-child(3) { top: 10px; }
[data-menu-open="true"] .menu-btn__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
[data-menu-open="true"] .menu-btn__bars span:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
[data-menu-open="true"] .menu-btn__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--paper);
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition:
    opacity var(--dur) var(--ease-soft),
    transform var(--dur) var(--ease-settle),
    visibility 0s linear var(--dur);
}
[data-menu-open="true"] .drawer {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.drawer__link {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wght" 380;
  font-size: clamp(2.1rem, 9vw, 3.4rem);
  letter-spacing: -0.03em;
  padding-block: 0.36em;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 520ms var(--ease-settle), transform 620ms var(--ease-settle);
  transition-delay: var(--i-delay, 0ms);
}
[data-menu-open="true"] .drawer__link { opacity: 1; transform: none; }
.drawer__link .label { font-size: 0.62rem; }
.drawer__link:hover { color: var(--ochre); }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(96svh, 900px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  margin-top: calc(var(--header-h) * -1);
  padding-top: var(--header-h);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.hero__media img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  object-position: center 38%;
  transform: translate3d(0, var(--parallax, 0px), 0) scale(1.04);
  animation: hero-bloom 2.4s var(--ease-settle) both;
}
@keyframes hero-bloom {
  from { opacity: 0; transform: scale(1.14); filter: blur(18px); }
  to   { opacity: 1; }
}

/* Just enough shading to carry white type on the left and to hand the page
   off cleanly at the bottom — the photograph itself stays the subject. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--paper) 0%, transparent 20%),
    linear-gradient(100deg, rgba(12, 9, 4, 0.66) 0%, rgba(12, 9, 4, 0.3) 32%, transparent 58%),
    linear-gradient(to bottom, rgba(12, 9, 4, 0.34) 0%, transparent 22%);
}
[data-theme="dark"] .hero__scrim {
  background:
    linear-gradient(to top, var(--paper) 0%, transparent 24%),
    linear-gradient(100deg, rgba(6, 5, 3, 0.74) 0%, rgba(6, 5, 3, 0.36) 34%, transparent 60%),
    linear-gradient(to bottom, rgba(6, 5, 3, 0.42) 0%, transparent 24%);
}

/* Narrow screens crop the photograph tighter, so the headline needs a real
   base under it rather than a side wash. */
@media (max-width: 900px) {
  .hero__scrim {
    background:
      linear-gradient(to top, var(--paper) 0%, rgba(12, 9, 4, 0.72) 14%, rgba(12, 9, 4, 0.5) 38%, transparent 66%),
      linear-gradient(to bottom, rgba(12, 9, 4, 0.4) 0%, transparent 26%);
  }
  [data-theme="dark"] .hero__scrim {
    background:
      linear-gradient(to top, var(--paper) 0%, rgba(6, 5, 3, 0.78) 14%, rgba(6, 5, 3, 0.55) 40%, transparent 68%),
      linear-gradient(to bottom, rgba(6, 5, 3, 0.46) 0%, transparent 28%);
  }
}

.hero__body {
  position: relative;
  width: 100%;
  padding-bottom: clamp(3rem, 7vw, 6rem);
  padding-top: clamp(6rem, 16vw, 12rem);
}

.hero__title {
  color: #fff;
  mix-blend-mode: normal;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
  max-width: 15ch;
}
.hero__title em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 340;
  color: var(--ochre-lift);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.hero__meta .label { color: rgba(255, 255, 255, 0.78); }
.hero__meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ochre-lift);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* The credit plate for the hero photograph, bottom-right like a gallery card */
.hero__plate {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(3rem, 7vw, 6rem);
  text-align: right;
  color: rgba(255, 255, 255, 0.8);
  display: grid;
  gap: 0.3rem;
}
@media (max-width: 860px) { .hero__plate { display: none; } }
.hero__plate .label { color: rgba(255, 255, 255, 0.62); }
.hero__plate__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "wght" 400;
  font-style: italic;
  font-size: 1.05rem;
  color: #fff;
}

/* Silhouettes drifting through the hero — slow, distant, never busy */
.flock {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.flock__bird {
  position: absolute;
  color: rgba(255, 255, 255, 0.34);
  animation: glide-across linear infinite;
  will-change: transform;
}
.flock__bird svg { width: 100%; height: auto; }
.flock__bird .wing { transform-origin: center; animation: wingbeat ease-in-out infinite; }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
}
@media (max-width: 860px) { .scroll-cue { display: none; } }
.scroll-cue__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, transparent, currentColor);
  transform-origin: top;
  animation: cue 2.6s var(--ease-soft) infinite;
}
@keyframes cue {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(46px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   8. Gallery
   -------------------------------------------------------------------------- */

/* A slow field-log ticker of every species in the collection */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 0.9rem;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  user-select: none;
}
.ticker__track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  animation: ticker-slide 90s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ticker__item::after {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ochre);
  opacity: 0.6;
}
@keyframes ticker-slide { to { transform: translateX(-50%); } }

/* Filter bar */
.gallery-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: calc(var(--header-h) - 18px);
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper-raised);
  transition: border-color var(--dur-fast) var(--ease-soft), box-shadow var(--dur-fast) var(--ease-soft);
}
.search:focus-within {
  border-color: var(--ochre);
  box-shadow: 0 0 0 3px var(--ochre-wash);
}
.search svg { width: 15px; height: 15px; color: var(--ink-muted); flex-shrink: 0; }
.search input {
  border: 0;
  background: none;
  outline: none;
  width: 100%;
  font-size: 0.85rem;
}
.search input::placeholder { color: var(--ink-muted); }
.search__clear {
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-soft);
}
.search.has-value .search__clear { opacity: 1; pointer-events: auto; }
.search__clear svg { width: 9px; height: 9px; color: inherit; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-right: auto;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  transition:
    color var(--dur-fast) var(--ease-soft),
    border-color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft);
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] {
  color: var(--paper-raised);
  background: var(--ink);
  border-color: var(--ink);
}
[data-theme="dark"] .chip[aria-pressed="true"] { color: var(--paper); }

.gallery-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-feature-settings: "tnum";
}

/* Masonry via CSS columns — varied heights sit naturally, like a plate wall */
.gallery {
  columns: 3;
  column-gap: clamp(0.75rem, 1.6vw, 1.5rem);
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}
@media (max-width: 1100px) { .gallery { columns: 2; } }
@media (max-width: 620px)  { .gallery { columns: 1; } }

.gallery__empty {
  display: none;
  padding-block: clamp(4rem, 10vw, 8rem);
  text-align: center;
}
.gallery__empty svg {
  width: 46px; height: 46px;
  margin: 0 auto 1.25rem;
  color: var(--ink-muted);
  opacity: 0.5;
}
.gallery.is-empty + .gallery__empty { display: block; }

/* Plate = one photograph and its specimen label */
.plate {
  break-inside: avoid;
  margin-bottom: clamp(0.75rem, 1.6vw, 1.5rem);
  position: relative;
}
.plate[hidden] { display: none; }

.plate__frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-sunk);
  border-radius: var(--radius);
  cursor: pointer;
}
.plate__frame img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio, 3 / 2);
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 1.15s var(--ease-settle), filter var(--dur) var(--ease-soft);
  backface-visibility: hidden;
}
.plate:hover .plate__frame img { transform: scale(1.055); }

/* Blur-up: the low-res placeholder dissolves once the real file lands */
.plate__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--lqip);
  background-size: cover;
  background-position: center;
  filter: blur(14px);
  transform: scale(1.15);
  opacity: 1;
  transition: opacity 620ms var(--ease-soft);
  pointer-events: none;
}
.plate__frame.is-loaded::after { opacity: 0; }

/* Corner brackets closing in — a viewfinder acquiring focus */
.plate__brackets {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-soft), inset var(--dur) var(--ease-settle);
}
.plate:hover .plate__brackets { opacity: 1; inset: 14px; }
.plate__brackets span {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  /* No scrim behind them any more, so they carry their own contrast */
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.55));
}
.plate__brackets span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.plate__brackets span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.plate__brackets span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.plate__brackets span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* The specimen label: species in the display face, catalogue data in mono */
.plate__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.15rem 0;
}
.plate__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "wght" 440;
  font-size: 1.02rem;
  letter-spacing: -0.012em;
  line-height: 1.25;
  transition: color var(--dur-fast) var(--ease-soft);
}
.plate:hover .plate__name { color: var(--ochre); }
.plate__cat {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  white-space: nowrap;
  font-feature-settings: "tnum";
}
.plate__price { color: var(--ink-soft); }

/* Show-more */
.more-wrap {
  display: flex;
  justify-content: center;
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   9. Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: color-mix(in srgb, var(--paper-sunk) 92%, transparent);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease-soft), visibility 0s linear var(--dur);
}
[data-theme="dark"] .lightbox { background: rgba(6, 6, 5, 0.94); }
.lightbox.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--gutter);
}
.lightbox__bar--foot { justify-content: center; gap: 1.5rem; }

.lightbox__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wght" 420;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.4rem);
  margin-right: auto;
}
.lightbox__title small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  padding-inline: var(--gutter);
  min-height: 0;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.965);
  transition: opacity 480ms var(--ease-settle), transform 620ms var(--ease-settle);
}
.lightbox__img.is-ready { opacity: 1; transform: none; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-raised) 70%, transparent);
  color: var(--ink);
  border: 1px solid var(--line);
  transition: background-color var(--dur-fast) var(--ease-soft), transform var(--dur-fast) var(--ease-settle);
}
.lightbox__nav:hover { background: var(--paper-raised); }
.lightbox__nav--prev { left: calc(var(--gutter) * 0.4); }
.lightbox__nav--next { right: calc(var(--gutter) * 0.4); }
.lightbox__nav--prev:hover { transform: translateX(-3px) translateY(-50%); }
.lightbox__nav--next:hover { transform: translateX(3px) translateY(-50%); }
.lightbox__nav svg { width: 18px; height: 18px; }
@media (max-width: 620px) {
  .lightbox__nav { width: 42px; height: 42px; }
}

.lightbox__counter {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  font-feature-settings: "tnum";
}

/* --------------------------------------------------------------------------
   10. Photograph page
   -------------------------------------------------------------------------- */

.photo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 1000px) { .photo-layout { grid-template-columns: 1fr; } }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  margin-top: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 900px) {
  .about-layout { grid-template-columns: 1fr; }
  /* Portrait first on narrow screens, then the writing */
  .about-layout > figure { order: -1; position: static !important; max-width: 420px; }
}

.photo-stage {
  position: relative;
  background: var(--paper-sunk);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
}
.photo-stage img { width: 100%; height: auto; }
.photo-stage__zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--paper-raised) 88%, transparent);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease-soft), transform var(--dur) var(--ease-settle);
}
.photo-stage:hover .photo-stage__zoom { opacity: 1; transform: none; }
.photo-stage__zoom svg { width: 12px; height: 12px; }

/* The buy panel sticks alongside the photograph on wide screens */
.buy-panel {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: grid;
  gap: 1.5rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.spec-table th,
.spec-table td {
  text-align: left;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  width: 42%;
}
.spec-table td { color: var(--ink-soft); }

/* Licence chooser */
.licence {
  display: grid;
  gap: 0.5rem;
}
.licence__option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft),
    transform var(--dur-fast) var(--ease-settle);
}
.licence__option:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.licence__option input { position: absolute; opacity: 0; pointer-events: none; }
.licence__option:has(input:checked) {
  border-color: var(--ochre);
  background: var(--ochre-wash);
}
.licence__option:has(input:focus-visible) {
  outline: 2px solid var(--ochre);
  outline-offset: 2px;
}
.licence__mark {
  width: 15px;
  height: 15px;
  margin-top: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: border-color var(--dur-fast) var(--ease-soft);
}
.licence__mark::after {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ochre);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-settle);
}
.licence__option:has(input:checked) .licence__mark { border-color: var(--ochre); }
.licence__option:has(input:checked) .licence__mark::after { transform: scale(1); }
.licence__body { flex: 1; min-width: 0; }
.licence__name { font-weight: 500; font-size: 0.92rem; }
.licence__desc { font-size: 0.8rem; color: var(--ink-muted); margin-top: 0.15rem; }
.licence__price {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  font-feature-settings: "tnum";
}

/* --------------------------------------------------------------------------
   11. Commerce
   -------------------------------------------------------------------------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.card--sunk { background: var(--paper-sunk); }
.card--flush { padding: 0; overflow: hidden; }

.note {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--paper-sunk);
  font-size: 0.875rem;
}
.note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--ochre); }
.note__title { font-weight: 600; margin-bottom: 0.15rem; }
.note__body { color: var(--ink-soft); }
.note--good { background: var(--good-wash); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.note--good svg { color: var(--good); }
.note--warn { background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.note--warn svg { color: var(--warn); }
.note--bad  { background: var(--bad-wash);  border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.note--bad svg { color: var(--bad); }

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 940px) { .cart-layout { grid-template-columns: 1fr; } }

.summary { position: sticky; top: calc(var(--header-h) + 1.5rem); }

.line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.45rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.line span:last-child { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.line--total {
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.line--total span:last-child { font-size: 1.15rem; }

/* Cart row */
.cart-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  animation: row-in 520ms var(--ease-settle) both;
}
.cart-row:last-child { border-bottom: 0; }
@keyframes row-in {
  from { opacity: 0; transform: translateY(14px); }
}
.cart-row.is-leaving {
  animation: row-out 320ms var(--ease-soft) forwards;
}
@keyframes row-out {
  to { opacity: 0; transform: translateX(28px); }
}
.cart-row__thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-sunk);
}
.cart-row__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "wght" 450;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.cart-row__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.cart-row__end {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
}
.cart-row__amount {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  font-feature-settings: "tnum";
}
@media (max-width: 560px) {
  .cart-row { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-row__thumb { width: 64px; height: 64px; }
  .cart-row__end { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; align-items: center; justify-content: space-between; width: 100%; }
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.stepper button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1;
  transition: background-color var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}
.stepper button:hover { background: var(--ochre-wash); color: var(--ochre); }
.stepper output {
  min-width: 30px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-feature-settings: "tnum";
}

.icon-remove {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease-soft), background-color var(--dur-fast) var(--ease-soft);
}
.icon-remove:hover { color: var(--bad); background: var(--bad-wash); }
.icon-remove svg { width: 15px; height: 15px; }

/* Order summary rows on checkout/confirmation/download */
.mini-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row__thumb {
  width: 54px; height: 54px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-sunk);
  flex-shrink: 0;
}
.mini-row__body { flex: 1; min-width: 0; }
.mini-row__name { font-weight: 500; }
.mini-row__meta { font-size: 0.78rem; color: var(--ink-muted); font-family: var(--font-mono); letter-spacing: 0.04em; }
.mini-row__amount { font-family: var(--font-mono); font-weight: 500; font-feature-settings: "tnum"; }

/* Empty states */
.empty {
  text-align: center;
  padding-block: clamp(3.5rem, 9vw, 7rem);
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.empty__icon {
  width: 56px; height: 56px;
  color: var(--ink-muted);
  opacity: 0.45;
  animation: drift 7s var(--ease-soft) infinite;
}

/* Progress through checkout */
.steps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.steps__item { display: flex; align-items: center; gap: 0.5rem; }
.steps__num {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.6rem;
}
.steps__item[data-state="done"] { color: var(--ochre); }
.steps__item[data-state="done"] .steps__num { border-color: var(--ochre); background: var(--ochre-wash); }
.steps__item[data-state="now"] { color: var(--ink); }
.steps__item[data-state="now"] .steps__num { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.steps__sep { width: 22px; height: 1px; background: var(--line-strong); }

/* Countdown */
.countdown {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  font-feature-settings: "tnum";
  letter-spacing: 0.06em;
}
.countdown[data-urgency="low"]  { color: var(--good); }
.countdown[data-urgency="mid"]  { color: var(--warn); }
.countdown[data-urgency="high"] { color: var(--bad); }

/* Download tile */
.dl-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  transition: border-color var(--dur-fast) var(--ease-soft), transform var(--dur-fast) var(--ease-settle);
}
.dl-row:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.dl-row__thumb {
  width: 76px; height: 76px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-sunk);
}
.dl-row__body { flex: 1; min-width: 180px; }

/* --------------------------------------------------------------------------
   12. Forms & buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid transparent;
  transition:
    transform var(--dur-fast) var(--ease-settle),
    background-color var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft),
    border-color var(--dur-fast) var(--ease-soft),
    box-shadow var(--dur-fast) var(--ease-soft);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* A light sweeps across on hover, like sun catching a wing */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.22) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 720ms var(--ease-glide);
}
.btn:hover::before { transform: translateX(120%); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--ochre); color: #fff; box-shadow: var(--shadow-md); }

.btn--ochre { background: var(--ochre); color: #fff; box-shadow: var(--shadow-sm); }
.btn--ochre:hover { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-md); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.btn--light {
  background: rgba(255, 255, 255, 0.94);
  color: #16140f;
}
.btn--light:hover { background: var(--ochre-lift); color: #16140f; }

.btn--outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.btn--outline-light:hover { background: rgba(255, 255, 255, 0.95); color: #16140f; border-color: transparent; }

.btn--block { width: 100%; }
.btn--sm { padding: 0.6rem 1.1rem; font-size: 0.64rem; }

.field { display: grid; gap: 0.45rem; }
.field__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.field__label .req { color: var(--bad); }
.field__hint { font-size: 0.78rem; color: var(--ink-muted); }

.input,
.select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-soft), box-shadow var(--dur-fast) var(--ease-soft);
}
.input:hover,
.select:hover { border-color: var(--line-strong); }
.input:focus,
.select:focus {
  border-color: var(--ochre);
  box-shadow: 0 0 0 3px var(--ochre-wash);
}
.input::placeholder { color: var(--ink-muted); }
.input--mono { font-family: var(--font-mono); letter-spacing: 0.06em; }

.select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%237d7566' stroke-width='1.4'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 11px;
  cursor: pointer;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23928a7b' stroke-width='1.4'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}
.select--sm { padding: 0.45rem 2.2rem 0.45rem 0.75rem; font-size: 0.8rem; border-radius: 99px; background-position: right 0.8rem center; }

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ochre);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: color-mix(in srgb, var(--paper-sunk) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade-in var(--dur) var(--ease-soft) both;
}
[data-theme="dark"] .overlay { background: rgba(6, 6, 5, 0.86); }
@keyframes fade-in { from { opacity: 0; } }
.overlay__card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: card-in var(--dur) var(--ease-settle) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 8vw, 7rem);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  background: var(--paper-sunk);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr; } }

.footer__mark {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72, "wght" 380;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  letter-spacing: -0.028em;
  line-height: 1.05;
}
.footer__list { display: grid; gap: 0.6rem; list-style: none; padding: 0; }
.footer__list a,
.footer__list span {
  font-size: 0.875rem;
  color: var(--ink-soft);
  transition: color var(--dur-fast) var(--ease-soft);
}
.footer__list a:hover { color: var(--ochre); }

.socials { display: flex; gap: 0.5rem; margin-top: 1rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: all var(--dur-fast) var(--ease-soft);
}
.socials a:hover { border-color: var(--ochre); color: var(--ochre); transform: translateY(-2px); }
.socials svg { width: 16px; height: 16px; }

.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.footer__base a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.footer__base a:hover { color: var(--ochre); }

/* --------------------------------------------------------------------------
   14. Overlays — toast, viewfinder cursor
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 210;
  display: grid;
  gap: 0.5rem;
  justify-items: end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.15rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 99px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  max-width: min(90vw, 400px);
  animation: toast-in 520ms var(--ease-settle) both;
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--ochre-lift); }
.toast.is-leaving { animation: toast-out 320ms var(--ease-soft) forwards; }
.toast--bad svg { color: var(--bad); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* A focus reticle that follows the pointer across the gallery */
.reticle {
  position: fixed;
  top: 0; left: 0;
  z-index: 150;
  width: 54px;
  height: 54px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.6);
  transition: opacity 260ms var(--ease-soft), transform 320ms var(--ease-settle);
  mix-blend-mode: difference;
}
.reticle.is-active { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); }
.reticle__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
.reticle__cross::before,
.reticle__cross::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
}
.reticle__cross::before { left: 50%; top: 42%; width: 1px; height: 16%; }
.reticle__cross::after { top: 50%; left: 42%; height: 1px; width: 16%; }
.reticle__label {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  translate: 0 -50%;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
@media (hover: none), (pointer: coarse) {
  .reticle { display: none; }
}

/* Image protection: a transparent pane over each plate defeats drag-save */
.no-save { -webkit-user-drag: none; user-select: none; }

/* --------------------------------------------------------------------------
   15. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .reveal-line > span { transform: none; }
  .section-head__rule { transform: scaleX(1); }
  .hero__media img { animation: none; transform: none; }
  .flock, .scroll-cue, .reticle { display: none; }
  .ticker__track { animation: none; }
  @view-transition { navigation: none; }
}
