:root {
  --bg: #0b0b0b url('background-texture.jpg') repeat fixed center;
  --fg: #eaeaea;
  --fg-dim: #eee; /* muted gray for labels */
  --muted: #a7a7a7;
  --link: #e3e3e3;
  --card: #141414;
  --card2: #1a1a1a;
  --border: #262626;
  --maxw: clamp(960px, 92dvw, 1800px);
  --pad: 16px;
  --radius: 14px;
  /* Marquee padding (gallery) */
  --marquee-pad-top: 0px;
  --marquee-pad-bottom: 30px;
  /* About background visible padding (top/bottom), not text padding */
  --about-card-offset: 15px;
  --footer-size: clamp(0.9rem, 0.78rem + 0.2vw, 1rem);
  --link-color: #b4b4b4; /* soft silver-gray, visible but quiet */
  --link-hover: #e5e5e5; /* gentle brightening on hover */
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font:
    16px/1.5 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto; /* Page scrolling: hide vertical scrollbar by default */
}

body.route-about {
  overflow-y: auto; /* enable scrollbar on About route */
}

/* Home page: allow vertical scrollbar when needed */
body.route-home {
  overflow-y: auto;
}

/* Legal page: allow vertical scrollbar when needed */
body.route-legal {
  overflow-y: auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

.header-inner {
  max-width: none; /* was var(--maxw) */
  width: 100%;
  margin: 0; /* was 0 auto */
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-left: 4px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.nav a {
  color: #e3e3e3; /* greyscale */
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px; /* was 999px */
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  box-sizing: border-box;
  border-width: 2px; /* constant thickness for all states */
  border-style: solid;
  border-color: transparent; /* invisible by default, preserves size */
}

.nav a:hover {
  color: #ffffff; /* greyscale white */
}

.nav a.active {
  color: #ffffff;
  border-color: #ffffff !important; /* brighter white ring */
  border-width: 2px; /* thicker ring */
  background: transparent !important;
  box-shadow: none !important;
}

.nav a.active:hover {
  border-color: #ffffff !important; /* keep bright on hover */
  background: transparent !important;
}

.wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 0px var(--pad) 0px;
  flex: 1 0 auto;
}

:is(.prior-era-link),
:is(.prior-era-link:visited) {
  color: rgb(102, 179, 255);
}
:is(.prior-era-link:hover) {
  color: rgb(128, 193, 255);
}

/* ==================================
   SPA Banner (non-phone) — :where()
   ================================== */

/* Wrapper + layout */
:where(.spaBanner-wrap) {
  position: relative; /* containing block for centered title */
  padding: 0px 10px 0; /* top/right/bottom/left */
  display: grid;
  grid-template-columns: 1fr auto; /* left info + right buttons */
  align-items: center;
  width: 100%;
}

/* Full-bleed support */
:where(.spaBanner-wrap).full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

@supports (width: 100dvw) {
  :where(.spaBanner-wrap).full-bleed {
    width: 100dvw;
    margin-left: calc(50% - 50dvw);
    margin-right: calc(50% - 50dvw);
  }
}

/* Centered title/meta (absolute to viewport center) */
:where(.spaBanner) {
  position: static;
  transform: none;
  z-index: 1;
  text-align: center;
  left: auto;
  top: auto;
  max-width: 100%;
  grid-column: 2;
}

/* Left: title + count (kept in grid flow) */
:where(.spaBanner-left) {
  grid-column: 1;
  justify-self: start;
  z-index: 2;
  padding-left: 4px;
}

/* Stable numeric width for the counter, non-wrapping */
:where(.spaBanner-count) {
  margin-left: 5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Text/counter shouldn’t push buttons off */
:where(.spaBanner) strong,
:where(.spaBanner) span,
:where(.spaBanner) #spaCount {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Button base (usable both inside .spaBanner and its buttons cluster) */
:where(.spaBanner .btn, .spaBanner-buttons .btn) {
  appearance: none;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1;
  cursor: pointer;
}

/* Button states */
:where(.spaBanner .btn:hover) {
  background: var(--card2);
  border-color: #333;
}

:where(.spaBanner .btn:active) {
  transform: translateY(1px);
}

/* Toggle “on” visual (snap etc.) */
:where(.spaBanner-buttons .btn.toggle.is-on) {
  background: var(--card2);
  border-color: #666;
  font-weight: 600;
}

/* Suppress mouse focus ring but keep keyboard focus */
:where(.spaBanner-buttons .btn:focus:not(:focus-visible)) {
  outline: none;
  box-shadow: none;
}

/* --- Small-screen tweak carried over (keep title/counter; show only Grid) --- */
@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  :where(.spaBanner-buttons) .btn {
    display: none;
  }
  :where(.spaBanner-buttons) #spaGridBtn {
    display: inline-flex;
  }
}

.full-bleed {
  box-sizing: border-box;
  /* fallback for browsers without dvw */
  width: calc(100vw - 2 * var(--pad));
  margin-left: calc(50% - 50vw + var(--pad));
  margin-right: calc(50% - 50vw + var(--pad));
}

/* Prefer dvw to avoid the scrollbar-bleed in Chrome */
@supports (width: 100dvw) {
  .full-bleed {
    width: calc(100dvw - 2 * var(--pad));
    margin-left: calc(50% - 50dvw + var(--pad));
    margin-right: calc(50% - 50dvw + var(--pad));
  }
}

/* optional: if anything still sneaks past due to subpixel rounding */
html {
  scrollbar-gutter: stable;
  overflow-x: clip;
} /* trims any 0.5px rounding artifacts */

/* Fallback for older browsers that ignore scrollbar-gutter */
@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

.cards {
  display: grid;
  /* Two columns with a generous min width to ensure visibly larger cards */
  grid-template-columns: repeat(2, minmax(560px, 1fr));
  padding-top: 18px;
  padding-bottom: 18px; /* match top padding for equal bottom gap */
  gap: 18px;
}

.cards.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, minmax(360px, 1fr));
  }
}

@media (max-width: 700px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

/* Card media wrapper for nudge/zoom */
.card-media {
  position: relative;
  width: 100%;
  /* lock 4:3 shape reliably across browsers */
  height: 0;
  padding-bottom: calc(75% * var(--home-card-h-scale, 1));
  overflow: hidden; /* clip zoom */
  background-color: #111;
}

.card-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--card-bg);
  background-size: cover; /* fill and crop like object-fit: cover */
  background-repeat: no-repeat;
  background-position: calc(50% + var(--nudge-x, 0px))
    calc(50% + var(--nudge-y, 0px));
  /* Only apply scale when zoom > 1, otherwise keep 1 to allow natural shrink */
  transform: scale(var(--nudge-zoom, 1)) scaleX(var(--img-stretch-x, 1))
    scaleY(var(--img-stretch-y, 1));
  transform-origin: center center;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card img {
  background: #111;
}

.card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  padding: 14px 16px 12px; /* +1px top breathing room */
}

.card .title {
  font-weight: 600;
  font-size: clamp(1.08rem, 0.7rem + 0.55vw, 1.36rem);
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.card .hint {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 0.6rem + 0.4vw, 1.18rem);
  letter-spacing: 0.05px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.thumb {
  position: relative;
  background: #121212;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 6px 0 16px;
}

.section-title h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.4px;
}

.crumbs {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .controls .btn {
    padding: 10px 14px;
  } /* bigger tap targets */
}

/* About card: default to a fluid, bounded offset.
   If images.json sets --about-card-offset, that wins. */
.about {
  max-width: 660px;
  margin: var(--about-card-offset, 0) auto 20px;
  padding: 10px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  position: relative;
  filter: brightness(1.05);
}

/* ===== About (vertical stack) ===== */
.about-vert {
  max-width: 860px; /* text + 2-up images feel roomier */
  margin: 16px auto 28px;
  padding: 0 8px;
}
.about-paragraph {
  max-width: 780px; /* keep lines comfortable */
  margin: 0 auto 16px;
}
.about-img-row {
  display: grid;
  gap: 10px;
  margin: 12px auto 20px;
}
.about-img-row.count-1 {
  grid-template-columns: 1fr;
  max-width: 820px;
}
.about-img-row.count-2 {
  grid-template-columns: 1fr 1fr;
  max-width: 860px;
}
.about-img-row img.about-img {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.about-img-link {
  display: block;
}

@media (max-width: 720px) {
  .about-vert {
    max-width: 94vw;
  }
  .about-paragraph {
    max-width: 92vw;
  }
  .about-img-row.count-2 {
    grid-template-columns: 1fr;
  } /* two-up collapses to single */
}

.muted {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex; /* can be flex; hidden attribute will suppress */
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
/* === Site footer (concise, original tone, subtle hover) === */
.site-footer {
  position: relative; /* above bg/vignette */
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0; /* spacing comes from separators */
  text-align: center;
  flex-shrink: 0;

  font-size: var(--footer-size, clamp(0.9rem, 0.78rem + 0.2vw, 1rem));
  line-height: 1.35;
  letter-spacing: 0.1px;
  color: var(--muted);
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

/* Links: keep muted; tiny brighten on hover, no underline */
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer a:hover {
  /* slight lift vs base; no “glow” */
  color: var(--muted-hover, color-mix(in oklab, var(--muted), #fff 86%));
  text-decoration: none;
}

/* Separator between top-level blocks (text block ↔ link group) */
.site-footer > * + *::before {
  content: '·';
  display: inline-block;
  margin-inline: 0.7ch; /* equal space on both sides */
  color: var(--muted);
  opacity: 0.8; /* stays subtle */
  pointer-events: none;
}

/* Link group: Subscribe · Legal (separator stays neutral on hover) */
.foot-links {
  display: flex;
  align-items: center;
  gap: 0;
}
.foot-links a + a::before {
  content: '·';
  display: inline-block;
  margin-inline: 0.7ch;
  color: var(--muted);
  opacity: 0.8;
  pointer-events: none;
}
.foot-links a:hover::before {
  color: var(--muted);
  opacity: 0.8; /* lock separator appearance */
}

/* SPA gallery polish */
#spaThumbs {
  -webkit-overflow-scrolling: touch;
}

.wrap {
  overflow: visible;
}

main.wrap {
  overflow: visible !important;
}

#app,
.wrap {
  transform: none !important;
  contain: none !important;
  filter: none !important;
  will-change: auto !important;
}

.spaThumb {
  flex: 0 0 auto;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.spaThumb img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  display: block;
  background: #000;
  border: 1px solid #333;
  border-radius: 6px;
  opacity: 0.75;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.spaThumb:hover img {
  opacity: 0.95;
  border-color: #555;
}

.spaThumb.current img {
  opacity: 1;
  border-width: 2px;
  border-color: #e3e3e3;
}

.spaThumb:focus-visible img {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}

/* Overlay grid tiles */
.spaTile {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.spaTile img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  display: block;
  background: #000;
  border: 1px solid #333;
  border-radius: 6px;
  opacity: 0.85;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.spaTile:hover img {
  opacity: 0.98;
  border-color: #555;
}

.spaTile.current img {
  opacity: 1;
  border-width: 2px;
  border-color: #e3e3e3;
}

.spaTile:focus,
.spaTile:focus-visible {
  outline: none;
}

.spaTile:focus-visible img {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
  border-color: transparent;
}

/* (Optional) When focused, also treat it as 'current' so visuals match mouse */
.spaTile:focus-visible img {
  outline: none;
  border-color: #e3e3e3;
  border-width: 2px;
}

.spaTile.current img {
  opacity: 1;
  border-width: 2px;
}

/* SPA multi-slide marquee */
.spaGallery {
  position: relative;
  display: block;
  overflow: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  border-top: none;
  border-bottom: 0px solid var(--border);
  padding-top: 0px;
  min-height: 0px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.spaGallery::-webkit-scrollbar {
  display: none;
}

.spaGallery.init-hide {
  opacity: 0;
  visibility: hidden;
}

.spaGutter {
  display: inline-block;
  width: 1px;
  height: 1px;
}

.spaGutter.left {
  margin-right: 8px;
}

.spaGutter.right {
  margin-left: 8px;
}

.spaSlide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 10px;
  margin: 0;
  box-sizing: border-box;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.spaSlide .spaArt {
  max-height: calc(85vh - var(--marquee-pad-top) - var(--marquee-pad-bottom));
  max-width: 88vw;
  height: auto;
  width: auto;
  display: block;
  background: #000;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.6),
    0 4px 18px rgba(0, 0, 0, 0.5);

  max-height: calc(
    var(--vvh, 100svh) /* visible viewport height */ - var(--header-h, 110px)
      /* sticky header (fallback 52px) */ - var(--banner-h, 56px)
      /* title/count row (fallback 56px) */ - 12px /* small cushion */
  );
  height: auto;
  width: auto;
  object-fit: contain; /* just in case any width/height combos slip through */
}

.spaSlide.dimmed {
  opacity: 0.15;
}

.spaSlide.centered {
  opacity: 1;
  padding-top: 8px;
}

/* Banner wrapper + layout */
:where(.spaBanner-wrap) {
  position: relative;
  padding: 8px 10px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
}

:where(.spaBanner-left) {
  grid-column: 1;
  justify-self: start;
  z-index: 2;
  padding-left: 4px;
}

:where(.spaBanner-count) {
  margin-left: 5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Button base */
:where(.spaBanner-buttons .btn, .spaBanner .btn) {
  appearance: none;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1;
  cursor: pointer;
}

/* Button states */
:where(.spaBanner .btn:hover) {
  background: var(--card2);
  border-color: #333;
}
:where(.spaBanner .btn:active) {
  transform: translateY(1px);
}
:where(.spaBanner-buttons .btn.toggle.is-on) {
  background: var(--card2);
  border-color: #666;
  font-weight: 600;
}

/* Ensure text/counter don’t push buttons off */
:where(.spaBanner strong, .spaBanner span, .spaBanner #spaCount) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@supports (width: 100dvw) {
  .spaBanner-wrap.full-bleed {
    width: 100dvw;
    margin-left: calc(50% - 50dvw);
    margin-right: calc(50% - 50dvw);
  }
}

/* Optional helpers used above */
.spaImageWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0px;
  padding: 16px 12px 8px;
}

.spaImage {
  max-width: 88vw;
  max-height: 74vh;
  object-fit: contain;
  display: block;
  background: #000;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.6),
    0 4px 18px rgba(0, 0, 0, 0.5);
}

.spaThumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px 16px;
  margin: 0 4px;
}

#spaOverlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
}

#spaGrid {
  width: min(1200px, 92vw);
  max-height: min(78vh, 820px);
  overflow: auto;

  display: grid;
  grid-template-columns: repeat(auto-fill, 140px);
  gap: 12px;
  padding: 16px;

  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #222;
  border-radius: 12px;
}

/* Nav: greyscale focus ring */
.nav a:focus-visible {
  outline-color: #bdbdbd; /* was blue */
}

/* Nav: focus ring around text only */
.nav a:focus-visible {
  outline: none;
}
.nav .nav-label {
  display: inline-block;
}
.nav a:focus-visible .nav-label {
  outline: 2px solid #bdbdbd;
  outline-offset: 0;
  border-radius: 2px;
}

/* === Bigger SPA overlay tiles: exactly 3 per row === */
#spaGrid {
  /* was: repeat(auto-fill, 140px) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; /* a bit roomier than 12px */
}

/* Let images fill their grid cell rather than fixed px */
#spaGrid .spaTile img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3; /* uniform tiles; change if you prefer 1/1 */
  object-fit: cover;
  display: block;
  border: 1px solid #333; /* keep the subtle frame */
  border-radius: 8px;
  /* remove any earlier fixed 120x90 sizing */
}

/* Keep the “selected/hover” ring without shifting layout */
#spaGrid .spaTile:hover img {
  box-shadow: inset 0 0 0 2px #555;
}

#spaGrid .spaTile.current img {
  box-shadow: inset 0 0 0 2px #e3e3e3;
}

/* Responsive fallback: 2 cols then 1 col on narrow screens */
@media (max-width: 980px) {
  #spaGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #spaGrid {
    grid-template-columns: 1fr;
  }
}

/* SPA marquee: no default smooth scroll to avoid initial spin */
.spaGallery {
  scroll-behavior: auto !important;
}

/* SPA marquee: remove focus ring on mouse click only; keep keyboard focus */
.spaGallery:focus:not(:focus-visible),
.spaSlide:focus:not(:focus-visible),
.spaSlide .spaArt:focus:not(:focus-visible) {
  outline: none;
}

/* SPA marquee buttons: suppress mouse-focus ring only */
.spaBanner-buttons .btn:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* SPA help popup */
.spaHelpPopup {
  position: fixed;
  z-index: 160; /* above banner */
  background: #000;
  color: var(--fg);
  border: 2px solid #666;
  border-radius: 8px;
  padding: 10px 12px;
  max-width: min(92vw, 380px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.spaHelpPopup .spaHelpTitle {
  font-weight: 600;
  margin: 0 0 6px 0;
}
.spaHelpPopup ul {
  margin: 0;
  padding-left: 18px; /* bullets */
}
.spaHelpPopup li {
  margin: 4px 0;
}

/* Nav: uniform spacing and stable size regardless of active ring */
.nav {
  gap: 10px;
}
.nav a {
  margin: 0;
  border-width: 2px;
} /* constant thickness; active just changes color */

/* Add somewhere in CSS */
.booting * {
  transition: none !important;
}

/* About layout with optional side image stacks */
.about-layout {
  --about-side-w: 300px;
  --about-side-gap: 1px;
  display: grid;
  align-items: start;
  justify-content: center;
  column-gap: 0;
  width: max-content; /* shrink to track content width */
  margin: 20px auto; /* center within page */
  justify-content: initial; /* avoid stretching to container */
}

/* Base */
.nl-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}
.nl-modal[aria-hidden='false'] {
  display: block;
}

.nl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6); /* adjust to taste */
  backdrop-filter: blur(5px);
}

.nl-dialog {
  position: relative;
  width: min(640px, 92vw);
  margin: 8vh auto 0;
  padding: 1.25rem;
  border: 1px solid currentColor;
  border-radius: 12px;
  background: transparent; /* inherits your site bg */
  color: inherit;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(8px);
  animation: nl-in 140ms ease-out;
  filter: brightness(1.1);
}

@keyframes nl-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(8px);
  }
}

.nl-title {
  margin: 0 2rem 0.5rem 0;
  font-size: 1.125rem;
  opacity: 1;
}

.nl-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
}
.nl-close:hover {
  opacity: 1;
}

/* Form */
.newsletter-form {
  font-family: inherit;
  color: inherit;
}
.nl-tagline {
  margin: 0 0 0.9rem 0;
  font-size: 0.95rem;
  opacity: 1;
}

.newsletter-fields {
  display: flex;
  gap: 0.6rem;
}
.newsletter-fields input[type='email'] {
  flex: 1;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
}
.newsletter-fields input[type='email']::placeholder {
  opacity: 0.8;
}

:where(.home-sep) {
  /* Visuals */
  border-top: 1px solid #444;
  border-top-width: 8px;
  height: 0; /* line only */
  margin: 1.25rem auto;

  /* Layout: works for both Grid and Flex containers */
  grid-column: 1 / -1; /* full-width in CSS Grid */
  width: 50%; /* make sure it’s full width */
  flex-basis: 100%; /* force a new line in Flexbox with wrap */
}

.nl-submit {
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.nl-submit:hover {
  background: currentColor;
  color: #000;
} /* flip if your site is light */

.newsletter-credit {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
  text-align: right;
}
.newsletter-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.newsletter-credit a:hover {
  opacity: 0.9;
}

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

/* Marquee mobile mode: only show grid button; keep title/counter */
@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .spaBanner-buttons .btn {
    display: none;
  }
  .spaBanner-buttons #spaGridBtn {
    display: inline-flex;
  }
}

/* Base layout */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0rem 0rem;
  position: sticky;
  top: 0;
  background: #0a0a0a;
  color: #f5f5f5;
  z-index: 50;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

.nav a {
  color: inherit;
  text-decoration: none;
  padding: 0.25rem 0.1rem;
}
.nav .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav .about {
  margin-left: auto;
} /* keeps “About” on the right */

/* ===================================
   NAVIGATION
   =================================== */

/* Shell */
:where(.nav-dropdown) {
  position: relative;
  border: none;
}

/* Summary trigger */
:where(.nav-dropdown) summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.25rem 0.1rem;
  border-radius: 6px;
  background: none;
  outline: none;
}

:where(.nav-dropdown) summary::-webkit-details-marker {
  display: none;
}

/* Bits inside the summary */
:where(.nav-dropdown) .dash {
  opacity: 0.5;
}

:where(.nav-dropdown) .current {
  opacity: 0.85;
}

:where(.nav-dropdown) .chev {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  fill: currentColor;
  opacity: 0.7;
  transform: translateY(1px) rotate(0deg);
  transition: transform 0.15s ease;
}

:where(.nav-dropdown[open]) .chev {
  transform: translateY(1px) rotate(180deg);
}

/* Menu panel */
:where(.nav-dropdown) .menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #0f0f0f;
  border: 1px solid #262626;
  border-radius: 10px;
  padding: 6px;
  margin-top: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-bottom: none;
}

:where(.nav-dropdown) .menu li {
  list-style: none;
}

:where(.nav-dropdown) .menu a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
}

:where(.nav-dropdown) .menu a:hover,
:where(.nav-dropdown) .menu a:focus {
  background: #1c1c1c;
  outline: none;
}

:where(.nav-dropdown) .menu .sep {
  height: 1px;
  background: #222;
  margin: 0.35rem 0.25rem;
  border-radius: 1px;
}

/* Desktop “open on hover”, still clickable on mobile */
@media (hover: hover) and (pointer: fine) {
  :where(.nav-dropdown:hover) > .menu {
    display: block;
  }
  :where(.nav-dropdown) .menu {
    display: none;
  }
  :where(.nav-dropdown[open]) .menu {
    display: block;
  } /* if clicked */

  :where(.brand-mobile) {
    display: none !important;
  }

  /* make the left block a 2-column grid: title left, count right */
  :where(.spaBanner-left) {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    row-gap: 2px;
    column-gap: 8px;
  }

  /* gallery name spans full width, tiny gap below it */
  :where(#spaGalleryName) {
    grid-column: 1 / -1;
    line-height: 1;
    margin-bottom: 3px; /* try 1px or 2px */
    margin: 0;
  }

  /* title on the left, count on the right */
  :where(#spaTitle) {
    grid-column: 1;
    line-height: 2.1;
  }

  :where(.spaBanner-count) {
    grid-column: 2;
    white-space: nowrap;
  }

  /* Header brand: show the chip as a text trigger on desktop */
  .site-header .brand .brand-fab {
    display: inline-flex !important; /* override desktop "hide" */
    position: relative; /* anchor for the dropdown */
    top: 0;
    left: 0; /* no fixed positioning in header */
    padding: 0; /* look like a normal brand link */
    border: none;
    background: none;
    backdrop-filter: none;
    color: inherit;
    font-weight: 700;
    letter-spacing: 0.6px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
  }

  /* Desktop dropdown under the brand */
  .site-header .brand .brand-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    width: max-content;
    min-width: 220px;
    max-width: 360px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    background: #0f0f0f;
    border: 4px solid var(--border);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition:
      opacity 160ms ease,
      transform 160ms ease;
    pointer-events: none;
  }

  .site-header .brand .brand-menu[data-open='true'] {
    opacity: 1;
    transform: translate(30px, 10px);
    pointer-events: auto;
  }

  /* 1) Make the brand wrapper the containing block */
  .site-header .brand {
    position: relative !important; /* new */
  }

  /* Remove bullets from the nav dropdown (desktop + everywhere) */
  .brand-menu ul,
  .brand-menu li,
  #brandMenu ul,
  #brandMenu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .brand-menu,
  #brandMenu {
    background: rgba(12, 12, 12, 0.92) !important; /* darker, more opaque */
    backdrop-filter: saturate(160%) blur(8px) !important;
    -webkit-backdrop-filter: saturate(160%) blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .brand-menu,
  #brandMenu {
    background: rgba(12, 12, 12, 0.92) !important;
    backdrop-filter: saturate(160%) blur(8px) !important;
    -webkit-backdrop-filter: saturate(160%) blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;

    /* new offsets */
    top: calc(100% - 4px) !important; /* raises it slightly */
    left: 6px !important; /* shifts it a bit right */
  }

  .site-header .brand .brand-menu {
    top: calc(100% - 4px) !important; /* a bit higher than default */
    left: 8px !important; /* nudge to the right */
  }

  .site-header .brand .brand-menu {
    background: color-mix(in srgb, #0c0c0c 10%, #000 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border: 4px solid rgba(255, 255, 255, 0.05);
    z-index: 300 !important; /* sits above banner text */
  }

  .site-header .brand .brand-menu,
  .brand-menu,
  #brandMenu {
    border-width: 3px !important; /* ← thickness */
    border-style: solid !important;
    border-color: rgba(255, 255, 255, 0.5) !important; /* more visible tone */
    padding: 8px !important; /* more breathing room */
  }
}

/* Mobile sizing */
@media (max-width: 720px) {
  :where(.nav) {
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    justify-content: space-between;
  }
  :where(.nav .about) {
    margin-left: 0;
  }
  :where(.nav-dropdown) .menu {
    min-width: 70vw;
  }
  :where(.nav-dropdown) summary {
    padding: 0.25rem 0;
  }
}

/* Reduced motion nicety */
@media (prefers-reduced-motion: reduce) {
  :where(.nav-dropdown) .chev {
    transition: none;
  }
}

/* Desktop hover open (still clickable on mobile) */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover > .menu {
    display: block;
  }
  .nav-dropdown .menu {
    display: none;
  }
  .nav-dropdown[open] .menu {
    display: block;
  } /* if clicked */
}

/* Mobile sizing */
@media (max-width: 720px) {
  .nav {
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }
  .nav .about {
    margin-left: 0;
  } /* reset flow */
  .nav {
    justify-content: space-between;
  } /* brand | galleries | about */
  .nav-dropdown .menu {
    min-width: 70vw; /* bigger tap target */
  }
  .nav-dropdown summary {
    padding: 0.25rem 0;
  }
}

/* Reduced motion nicety */
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown .chev {
    transition: none;
  }
}

/* =========================================
   SPA Banner under-image: universal (desktop + phone)
   ========================================= */

/* 1) Shell stacks gallery then banner */
:where(.marquee-shell) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 2) Banner as a real bar below the image (not overlay) */
:where(.spaBanner-wrap) {
  position: static; /* ensure it's in flow under the image */
  padding: 8px 10px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | center | right */
  align-items: center;
  width: 100%;
}

/* Left cluster: title + count */
:where(.spaBanner-left) {
  grid-column: 1;
  justify-self: start;
  z-index: 2;
  padding-left: 4px;
}

/* Give the image a tiny breathing room above the bar */
:where(.spaGallery) {
  margin-bottom: 4px;
}

/* =========================================
   PHONE polish (applies to both portrait & landscape)
   ========================================= */

@media (orientation: landscape) and (max-width: 720px),
  (hover: none) and (pointer: coarse) {
  :root {
    --banner-h: 48px;
  }

  @media (hover: none) and (pointer: coarse) {
    :where(.brand-fab, .brand-menu) {
      display: none !important;
    }
  }

  /* adjust if your banner row is taller */
  :where(body:has(.spaGallery) .site-header) {
    display: none;
  }

  :where(.spaBanner-gallery) {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
    text-transform: none; /* or uppercase if you prefer */
  }

  /* If you want it smaller on portrait phones */
  @media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    :where(.spaBanner-gallery) {
      font-size: 0.85rem;
    }
  }

  :where(.brand-sub) {
    position: fixed; /* was absolute — now immune to scroll */
    left: 14px;
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
    pointer-events: none;
    z-index: 39; /* below menu (41) and chip (40), above art */
  }

  /* Hide the label when the menu is open to avoid overlaps (Safari supports :has) */
  :where(.marquee-shell:has(.brand-menu[data-open='true']) .brand-sub) {
    display: none;
  }

  /* Landscape can sit a touch tighter to the chip */
  @media (orientation: landscape) {
    :where(.brand-sub) {
      top: calc(env(safe-area-inset-top, 0px) + 46px);
      font-size: 0.88rem;
    }
  }

  /* Optional: hide while the dropdown menu is open so there’s no visual collision */
  :where(.brand-menu[data-open='true']) ~ .brand-sub {
    display: none;
  }

  /* Optional: keep only Grid button on phones (like before) */
  /* Comment these two lines out if you want all buttons visible */
  :where(.spaBanner-buttons) .btn {
    display: none;
  }
  :where(.spaBanner-buttons) #spaGridBtn {
    display: inline-flex;
  }

  :where(.spaGallery) {
    transform: none !important;
    transition: none !important;
  }

  :where(.spaSlide) {
    padding: 8px 8px;
  } /* a little side breathing room */
  :where(.spaSlide .spaArt) {
    margin-top: 0; /* no extra top gap */
    max-width: 92vw;
    /* Height = viewport minus banner + safe area */
    max-height: calc(100dvh - var(--banner-h) - env(safe-area-inset-bottom));
    height: auto;
    object-fit: contain;
  }

  /* ===========================
   PHONE: brand menu dropdown
   (portrait & landscape)
   =========================== */

  .spaBanner-gallery {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 2px;
    line-height: 1.1;
  }

  /* keep title over count on phone */
  .spaBanner-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .spaBanner {
    display: none !important;
  }

  /* Respect reduced motion */
  @media (prefers-reduced-motion: reduce) {
    :where(.brand-menu) {
      transition: none;
    }
  }
}

/* Stack gallery then banner everywhere */
:where(.marquee-shell) {
  display: flex;
  flex-direction: column;
}

/* Put banner below image (and kill old absolute/overlay rules) */
:where(.spaBanner-wrap) {
  position: static !important;
  padding: 0px 10px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | center | right */
  align-items: center;
  width: 100%;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: none !important;
  transition: none !important;
}

:where(.spaBanner-left) {
  grid-column: 1;
  justify-self: start;

  padding-left: 0.45em;
  font-size: 1.1rem;
}

/* Let banner buttons inherit typography from their container */
:where(.spaBanner-buttons .btn, .spaBanner .btn) {
  font: inherit; /* inherits size, family, weight, etc. */
  /* or, if you only want size: font-size: inherit; */
}

:where(.spaBanner-buttons) {
  grid-column: 3;
  justify-self: end;
  z-index: 2;
  margin: 0;
  font-size: 0.7rem;
  padding: 0.45em 0.65em;
}

/* Breathing room under image */
:where(.spaGallery) {
  margin-bottom: 0px;
}

/* Optional: on big desktops the chip is redundant—just hide it */
@media (hover: hover) and (pointer: fine) {
  :where(.brand-fab) {
    position: fixed;
    top: max(8px, calc(env(safe-area-inset-top) + 6px));
    left: max(8px, calc(env(safe-area-inset-left) + 8px));
    z-index: 90;

    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.6px;
    font-size: 16px;
    line-height: 1;
    color: var(--fg);
    text-decoration: none;

    background: rgba(11, 11, 11, 0.6);
    backdrop-filter: saturate(160%) blur(6px);
    border: 1px solid var(--border);

    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
      opacity 0.18s ease,
      transform 0.18s ease;
  }

  :where(.brand-fab) {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none; /* optional—prevents flicker */
  }

  .brand-fab {
    display: none;
  }

  :where(.brand-sub) {
    position: fixed; /* pin to viewport */
    left: 14px;
    top: calc(
      var(--header-h, 52px) + 6px
    ); /* sit just under the sticky header */
    z-index: 60; /* above art, below any modals */
    pointer-events: none; /* purely informational label */
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
  }
}

/* Desktop: normalize banner row metrics so bigger buttons don't add "blank" above */
@media (hover: hover) and (pointer: fine) {
  /* Kill any overlay-ish position remnants */
  .spaBanner-wrap {
    position: static;
    top: auto;
    height: auto;
  }

  /* Hide the floating chip on desktop */
  @media (hover: hover) and (pointer: fine) {
    :where(.brand-fab) {
      display: none;
    }
  }

  /* Remove the little top cushion on desktop */
  .spaBanner-wrap {
    padding-top: 6px;
  } /* or 0px if you want it tight */

  .spaBanner {
    font-size: 1.4rem;
    padding-bottom: 5px;
  }

  .spaBanner-left {
    padding-top: 8px;
  }

  .spaBanner-buttons {
    padding-top: 4px;
  }

  /* Make the row height come from content, not leading */
  .spaBanner-wrap,
  .spaBanner,
  .spaBanner-left,
  .spaBanner-buttons {
    line-height: 1;
    padding-top: 6px !important;
  }

  /* Buttons: slightly bigger, but keep vertical centering crisp */
  .spaBanner-buttons {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  .spaBanner-buttons .btn {
    padding: 8px 12px;
    line-height: 1;
  }

  /* If any text element inside has default margins (e.g., <h*>), nuke them */
  .spaBanner :is(h1, h2, h3, p) {
    margin: 0;
  }

  /* Tighten the space between the image and bar on desktop */
  .spaGallery {
    margin-bottom: 0;
  } /* was 4px earlier */
}

/* Fallback if a browser doesn’t support svh (rare now): keep your old behavior */
@supports not (height: 100svh) {
  @media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .marquee-shell {
      height: 100dvh;
      min-height: 100dvh;
    }
    .spaSlide .spaArt {
      max-height: calc(100dvh - var(--banner-h) - env(safe-area-inset-bottom));
    }
  }
}

/* iPhone LANDSCAPE: use the visible 'small' viewport and keep banner under image */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* one place for phone landscape sizing */
  :root {
    --header-h: 52px; /* sticky header height on phone */
    --banner-h: 44px; /* banner row height; adjust if yours is taller */
  }

  :where(.spaSlide) {
    padding: 8px 8px;
  }

  /* image sizing: never covered by iOS chrome or banner */
  :where(.spaSlide .spaArt) {
    margin-top: 0;
    max-width: 92vw;
    max-height: calc(100svh - var(--banner-h) - env(safe-area-inset-bottom));
    object-fit: contain;
  }

  /* only show Grid and Snap on phones; larger tap targets + order */
  :where(.spaBanner-buttons .btn) {
    display: none;
  }

  :where(.spaBanner-buttons) {
    display: inline-flex;
    padding-right: 0.2em;
  }

  :where(.spaBanner-buttons) :is(#spaGridBtn, #spaSnap) {
    display: inline-flex;
    padding: 8px 12px;
    gap: 8px;
    font-size: 0.95rem;
    padding: 0.45em 0.9em;
  }

  :where(#spaGridBtn) {
    order: 1;
  }

  :where(#spaSnap) {
    order: 2;
  }

  /* footer pinned on phones */
  :where(.site-footer) {
    display: none;
  }

  /* kill any earlier vh caps for this mode */
  .spaSlide .spaArt {
    max-height: none !important;
  }

  /* make HEIGHT the controlling dimension (so changing the calc has effect) */
  .spaSlide .spaArt {
    height: calc(100svh - var(--banner-h) - env(safe-area-inset-bottom));
    /* if you prefer dvh breathing, swap 100svh -> 100dvh */
    width: auto; /* keep aspect ratio */
    max-width: 92vw; /* still don’t let it overflow horizontally */
    object-fit: contain;
    display: block;
    margin-top: 0;
  }

  /* pack the gallery content to the bottom of its area */
  .spaGallery {
    margin: 0;
    padding: 0;
    /* you likely already have display:grid */
    padding-bottom: 0;
    margin-bottom: 0;
    row-gap: 0;
    min-height: auto; /* neutralize any earlier min-height */
    height: 100%;

    display: block; /* not grid */
    overflow-x: auto; /* keep the scroller */
    overflow-y: visible;
    white-space: nowrap; /* keep slides in one row */
    scroll-behavior: auto;
    touch-action: pan-x; /* you already set this – ok to keep */
    transform: none;
    transition: none;
    will-change: auto;
    /* remove grid-only alignment props that have no effect on block scroller */
    align-content: normal;
    place-items: normal;
  }

  /* make sure the image itself doesn't add a baseline gap */
  .spaSlide :is(img.spaArt, .spaArt img) {
    display: block;
  }

  /* Let the gallery row size to its content; put leftover space *after* the banner */
  .marquee-shell {
    display: grid;
    grid-template-rows: 1fr auto; /* gallery | banner */
    align-content: start; /* pack rows at the top of the viewport */
    height: 100svh;
    min-height: 100svh;
    height: 100dvh;
    min-height: 100dvh; /* if you want it to breathe with URL bar */
  }

  /* Make sure the slide doesn’t add space below the image */
  .spaSlide {
    display: inline-flex;
    vertical-align: top;
    padding: 8px 8px;
  }

  /* Image height cap you’re using — keeps banner visible */
  .spaSlide :is(img.spaArt, .spaArt img) {
    max-height: none;
    height: calc(100svh - var(--banner-h) - env(safe-area-inset-bottom));
    height: calc(100svh - var(--banner-h) - env(safe-area-inset-bottom));
    width: auto;
    max-width: 92vw;
    object-fit: contain;
    display: block; /* removes inline-image baseline gap */
  }

  /* Count row */
  :where(.spaBanner-left) {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding-left: 0.4em;
  }

  /* Banner keeps its lane directly under the image */
  .spaBanner-wrap {
    position: static;
    background: none;
    opacity: 1;
    pointer-events: auto;
    z-index: 60;
    font-size: 1.2rem;
    font-weight: 500;

    min-height: var(--banner-h);
    padding: 10px 8px 0;
  }

  .is-snap .spaGallery {
    -webkit-overflow-scrolling: auto;
  }

  .brand-menu ul {
    columns: 2; /* start with 2 columns on small phones */
    column-gap: 14px;
    margin: 0;
    padding: 8px 10px;
    list-style: none;
  }

  .brand-menu li {
    break-inside: avoid;
  }

  .brand-menu-list {
    display: block; /* override the earlier display:grid */
    columns: 2; /* start with 2 columns */
    column-gap: 14px;
    padding: 8px 10px; /* keep your padding */
    list-style: none;
    margin: 0;
  }

  .brand-menu-list a {
    display: block;
    padding: 8px 10px;
    line-height: 1.2;
  }

  .brand-menu .brand-menu-list {
    -webkit-column-fill: auto !important; /* Safari/iOS */
    column-fill: auto !important; /* others */
  }
}

@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
  /* also cap the image height so the whole stack fits comfortably */
  :root {
    --phone-meta-h: 110px;
  }

  :where(body) {
    min-height: 100dvh;
  }

  :where(.marquee-shell) {
    padding-bottom: calc(env(safe-area-inset-bottom) + 20px) !important;
  }

  /* Let the gallery hug its content (kill the 68vh floor) */
  :where(.spaGallery) {
    margin-top: 100px;
    padding-top: 40px;
    min-height: 0 !important; /* was clamp(..., 68vh, ...) */
    margin-bottom: 40px !important; /* hairline cushion under image */
    padding-bottom: 0 !important;
  }

  :where(.spaBanner-wrap) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-auto-flow: row !important;
    justify-items: center !important;
    align-items: center !important;
    padding-bottom: 0 !important;
    row-gap: 6px !important; /* breathing between rows */
    padding-top: 4px !important; /* hairline cushion under image */
  }

  /* Title row */
  :where(.spaBanner) {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: center;
    text-align: center !important;
    margin: 0 !important;
    line-height: 1.15;
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 10px;
  }

  /* Count row */
  :where(.spaBanner-left) {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: center;
    align-self: center;
    margin: 0 !important;
    line-height: 1.2;
    padding-top: 4px;
    padding-right: 10px;
    padding-bottom: 5px;
    font-weight: 500;
    place-self: center !important; /* center horizontally & vertically */
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 0.25rem; /* tighter gap before buttons */
  }

  /* Buttons row */
  :where(.spaBanner-buttons) {
    grid-column: 1 !important;
    grid-row: 3 !important;
    display: inline-flex;
    gap: 10px; /* normal space between Grid + Snap */
    justify-self: center;
    align-self: center;
    margin: 0;
    padding-top: 10px;
    font-size: 1.5rem;
    padding-left: 4px;
    place-self: center !important;
  }

  /* Only show Grid + Snap */
  :where(.spaBanner-buttons .btn) {
    display: none !important;
  }

  :where(.spaBanner-buttons #spaGridBtn),
  :where(.spaBanner-buttons #spaSnap) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 1.1rem;
    margin: 0;
    transform: none; /* remove prior baseline nudges */
  }

  :where(.spaBanner-buttons) {
    margin-top: 0; /* remove extra spacing above buttons */
  }
  :where(.spaBanner-buttons button) {
    font-size: 0.9rem;
  }

  /* Trim the slide’s bottom padding so it doesn’t add space */
  :where(.spaSlide) {
    padding-bottom: 4px !important; /* was 10px */
  }

  /* title + count + buttons approx */
  :where(.spaSlide .spaArt) {
    max-height: calc(
      100svh - var(--phone-meta-h) - env(safe-area-inset-bottom) - 40px
    ) !important;
  }

  .home-section .cards {
    --home-card-h-scale: 1.25; /* try 1.25–1.45 to taste */
  }

  .card .title {
    font-size: 1.2rem;
  }

  .card .hint {
    font-size: 1rem;
  }
}

/* Optional: bleed cards a touch wider edge-to-edge on very narrow screens */
@media (orientation: portrait) and (max-width: 700px) {
  .home-section > .cards {
    width: calc(100vw - 2 * var(--pad));
    margin-left: calc(50% - 50vw + var(--pad));
    margin-right: calc(50% - 50vw + var(--pad));
  }
}

/* ===== Footer base (desktop + landscape default: single line) ===== */
:where(.site-footer) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: center;
  white-space: nowrap; /* keep one line by default */
}

/* Inline separators only when links sit on the same line */
:where(.foot-links a + a)::before {
  content: ' | ';
  margin: 0 0.45em 0 0.35em;
  opacity: 0.9;
}

/* ===== Phone PORTRAIT: intentional two rows ===== */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  :where(.site-footer) {
    flex-wrap: wrap; /* allow 2 rows */
    row-gap: 0.25rem;
    white-space: normal; /* allow wrapping now */
    font-size: clamp(13px, 3.6vw, 15px);
    justify-content: center; /* center items per row */
    align-content: center; /* center the two rows as a block */
    column-gap: 0; /* separators handle spacing */
  }

  :where(.foot-left),
  :where(.foot-links) {
    flex-basis: 100%;
  }

  :where(.foot-links) {
    gap: 0;
    display: inline-flex;
    justify-content: center;
    width: 100%;
  }

  :where(.foot-links a + a)::before {
    content: '·';
    margin: 0 0.35em;
    opacity: 0.9;
  }

  :where(.foot-links a)::before {
    content: none;
  }

  /* remove the top-level separator dot before the second block */
  :where(.site-footer > * + *)::before {
    content: none !important;
  }

  :where(#spaGalleryName) {
    display: none !important;
  }
}

:where(.foot-links a + a)::before {
  content: '·';
  margin: 0 0.35em;
  opacity: 0.9;
}

/* iPhone LANDSCAPE: use the visible 'small' viewport and keep banner under image */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Flatten the banner’s left cluster into one row */
  :where(.spaBanner-left) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap; /* allows graceful wrap if text is too long */
    align-items: baseline;
    gap: 6px; /* spacing between gallery, title, count */
    margin-top: 4px;
  }

  :where(.spaBanner-gallery) {
    font-weight: 600;
    opacity: 0.85;
  }

  :where(#spaTitle) {
    font-weight: 600;
    line-height: 1.2;
  }

  :where(.spaBanner-count) {
    opacity: 0.75;
    white-space: nowrap;
  }

  /* Ensure the banner stays just below the chip */
  :where(.spaBanner-wrap) {
    margin-top: calc(env(safe-area-inset-top, 0px) + 50px) !important;
    padding-top: 4px !important;
  }

  /* hide floating desktop label on phones */
  :where(#spaGalleryName) {
    display: none !important;
  }

  /* Adjust image height so the banner no longer steals space */
  :where(.spaSlide .spaArt) {
    max-height: calc(100svh - 110px - env(safe-area-inset-bottom));
    object-fit: contain;
  }
}
/* PHONE LANDSCAPE: chip bottom-left + spaced row for gallery/title/count */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* compact info bar */
  :where(.spaBanner-wrap) {
    margin-top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    padding-top: 0;
    max-width: 100vw !important;
  }

  :where(.spaBanner-left) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px !important; /* ← your 10px of space between items */
    max-width: 90vw !important; /* ← widen the usable horizontal space */
  }

  :where(.spaBanner-gallery),
  :where(#spaTitle),
  :where(.spaBanner-count) {
    margin: 0;
  }
}

/* PORTRAIT: left-align the banner stack under the chip */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  /* make the banner a left-aligned column */
  :where(.marquee-shell .spaBanner-wrap) {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 40px) !important;
    left: 6px !important;
    right: auto !important;
    width: auto !important;

    display: flex !important; /* override grid */
    flex-direction: column !important;
    align-items: flex-start !important; /* ← left-align contents */
    justify-content: flex-start !important;
    text-align: left !important;
    background: none !important;
    padding: 0 !important;
    z-index: 50 !important;
  }

  /* un-center the children that were forced to center */
  :where(.spaBanner, .spaBanner-left, .spaBanner-buttons) {
    justify-self: start !important;
    align-self: flex-start !important;
    text-align: left !important;
    margin-left: 0 !important;
  }

  /* small spacing + tone */
  :where(.spaBanner-gallery) {
    margin-bottom: 2px !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
  }

  :where(.spaBanner-count) {
    color: var(--muted) !important;
    font-size: 0.9rem !important;
  }

  :where(.spaBanner-buttons) {
    margin-top: 8px !important;
  }
}

#app,
.wrap {
  transform: none !important;
}

/* ================================
   PHONE BRAND: inline above gallery title
   ================================ */

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  :where(.brand-mobile) {
    position: relative;
    display: inline-block;
    margin-left: 6px;
    margin-bottom: 6px;
  }

  :where(.brand-mobile .brand-fab) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    color: #fff;
    background: rgba(11, 11, 11, 0.6);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: saturate(160%) blur(6px);
    padding: 6px 10px;
    text-decoration: none;
    cursor: pointer;
  }

  :where(.brand-mobile .brand-menu) {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    width: max-content;
    max-width: min(86vw, 360px);
    background: rgba(18, 18, 18, 0.92);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  :where(.brand-mobile .brand-menu[data-open='true']) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  :where(.brand-mobile .brand-menu-list) {
    list-style: none;
    margin: 0;
    padding: 6px;
    display: grid;
    gap: 2px;
  }

  :where(.brand-mobile .brand-menu-list a[role='menuitem']) {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #f2f2f2;
    text-decoration: none;
  }

  :where(
    .brand-mobile .brand-menu-list a[role='menuitem']:hover,
    .brand-mobile .brand-menu-list a[role='menuitem']:focus-visible
  ) {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .brand-mobile {
    position: relative;
    display: inline-block;
    margin-left: 6px;
    margin-bottom: 6px;
  }

  .brand-fab-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    color: #fff;
    background: rgba(11, 11, 11, 0.6);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: saturate(160%) blur(6px);
    padding: 6px 10px;
    text-decoration: none;
    cursor: pointer;
  }

  .brand-menu-phone {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    width: max-content;
    max-width: min(86vw, 360px);
    background: rgba(18, 18, 18, 0.92);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  .brand-menu-phone[data-open='true'] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* PHONE: brand chip inside gallery banner */
@media (hover: none) and (pointer: coarse) {
  .brand-mobile {
    position: relative;
    display: inline-block;
    margin-left: 6px;
    margin-bottom: 6px;
  }

  .brand-fab-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    color: #fff;
    background: rgba(11, 11, 11, 0.6);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: saturate(160%) blur(6px);
    padding: 6px 10px;
    text-decoration: none;
    cursor: pointer;
  }

  .brand-menu-phone {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    width: max-content;
    max-width: min(86vw, 360px);
    background: rgba(18, 18, 18, 0.92);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  .brand-menu-phone[data-open='true'] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* ——— PHONE PORTRAIT: unpin chip + banner; keep marquee untouched ——— */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  /* If the little sub-label under the chip was fixed */
  :where(.brand-sub) {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    z-index: auto !important;
    margin: 8px 10px 4px !important;
    pointer-events: auto !important;
  }

  /* If the banner (title + count + buttons) was fixed */
  :where(.marquee-shell .spaBanner-wrap) {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    z-index: auto !important;

    /* stack the three rows cleanly */
    display: grid !important;
    grid-auto-flow: row !important;
    row-gap: 6px !important;
    justify-items: start !important;
    text-align: left !important;
    width: 100% !important;
    padding: 0 10px !important;
    margin: 6px 0 10px !important;
    background: none !important;
  }
}

/* ——— PHONE PORTRAIT ——— */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  /* Chip */
  :where(.brand-mobile .brand-fab-phone) {
    padding: 6px 10px !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    border-radius: 14px !important;
    margin: 10px 10px 6px !important; /* L/R pad + small gap below */
  }

  /* “Dark Street” / title / count / buttons wrapper */
  :where(.marquee-shell .spaBanner-wrap) {
    /* already unpinned from earlier step */
    row-gap: 4px !important;
    padding: 0 12px !important;
    margin: 4px 0 8px !important; /* small gap below block (above image) */
    width: 100% !important;
    justify-items: start !important;
    text-align: left !important;
  }

  /* Gallery name (e.g., Dark Street) */
  :where(
    .spaBanner-wrap .gallery-name,
    .spaBanner-wrap [data-role='gallery-name']
  ) {
    font-size: clamp(0.95rem, 3.4vw, 1.05rem) !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    opacity: 0.9;
  }

  /* Title (e.g., Untitled #16) */
  :where(
    .spaBanner-wrap h1,
    .spaBanner-wrap .title,
    .spaBanner-wrap [data-role='title']
  ) {
    font-size: clamp(1.05rem, 5vw, 1.35rem) !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    letter-spacing: 0.1px;
  }

  /* Count (e.g., 6 / 21) */
  :where(
    .spaBanner-wrap .count,
    .spaBanner-wrap [data-role='count'],
    .spaBanner-wrap .meta
  ) {
    font-size: clamp(0.8rem, 3.2vw, 0.9rem) !important;
    line-height: 1.1 !important;
    margin: 2px 0 0 !important;
    color: var(--muted);
  }

  /* Buttons row */
  :where(.spaBanner-wrap .spaBanner-buttons, .spaBanner-buttons) {
    display: flex !important;
    gap: 10px !important;
    margin-top: 6px !important;
  }

  /* Individual buttons (Grid / Snap) */
  :where(
    .spaBanner-buttons button,
    .spaBanner-buttons .btn,
    .spaBanner-buttons a[role='button']
  ) {
    padding: 6px 12px !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    border-radius: 12px !important;
  }

  /* Trim the gap above the image without touching marquee behavior */
  :where(.spaBanner-wrap + *) {
    margin-top: 8px !important;
  }
}

/* === PHONE LANDSCAPE: two-tier banner; title on its own line, flush-left === */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Make the banner a 2-row grid:
     row 1: [gallery name]    [buttons]
     row 2: [image title ...] [count]   */
  :where(.spaBanner-wrap) {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    column-gap: 12px !important;
    row-gap: 2px !important;
    align-items: center !important;
    /* keep whatever vertical offset you want */
  }

  /* Let the children of .spaBanner-left participate in the parent grid */
  :where(.spaBanner-left) {
    display: contents !important; /* cancels the earlier flex wrap */
    padding-left: 4px !important;
    margin: 0 !important;
  }

  /* Row 1, left: gallery title (e.g., “Dark Street”) */
  :where(#spaBannerGallery) {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
    align-self: end !important;
    justify-self: start !important;
  }

  /* Row 1, right: buttons */
  :where(.spaBanner-buttons) {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
    justify-self: end !important;
    align-self: start !important;
    display: inline-flex !important;
    gap: 8px !important;
  }

  /* Row 2, left: image title (flush-left, can be long) */
  :where(#spaTitle) {
    grid-column: 1 / 2 !important;
    grid-row: 2 / 3 !important;
    justify-self: start !important;
    align-self: start !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    min-width: 0 !important; /* allow ellipsis */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Row 2, right: count “1 / 21” */
  :where(.spaBanner-count) {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    justify-self: end !important;
    align-self: start !important;
    white-space: nowrap !important;
    margin: 0 !important;
    opacity: 0.8 !important;
  }
}

/* === PHONE LANDSCAPE: tighten vertical spacing at top === */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Nudge entire banner upward */
  :where(.spaBanner-wrap) {
    margin-top: -40px !important; /* pull closer to top edge */
    row-gap: 1px !important; /* compress the grid a bit */
  }

  /* Lift the gallery name slightly and close its gap below */
  :where(#spaBannerGallery) {
    transform: translateY(-2px) !important;
    margin-bottom: 0 !important;
    line-height: 1.05 !important;
  }

  /* Optional: slightly tighten the title spacing below */
  :where(#spaTitle) {
    margin-top: 0 !important;
    line-height: 1.1 !important;
  }
}

/* === PHONE LANDSCAPE: move brand chip to lower-left; align gallery name top with buttons === */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Move the phone version of the brand chip down-left */
  :where(.brand-mobile) {
    position: fixed !important;
    bottom: 10px !important;
    left: 10px !important;
    top: auto !important;
    transform: none !important;
    z-index: 30 !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    border-radius: 14px !important;
  }

  /* Tighten the banner and align gallery name with buttons */
  :where(.spaBanner-wrap) {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    align-items: start !important;
    column-gap: 12px !important;
    row-gap: 2px !important;
    padding: 0 12px !important;
    margin-top: 0 !important;
  }

  /* Gallery name (top-left, flush with buttons) */
  :where(#spaBannerGallery) {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
    align-self: start !important;
    justify-self: start !important;
    margin: 0 !important;
    transform: translateY(-2px) !important;
  }

  /* Buttons (top-right) */
  :where(.spaBanner-buttons) {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
    align-self: start !important;
    justify-self: end !important;
    display: inline-flex !important;
    gap: 8px !important;
  }

  /* Title + count stacked below */
  :where(#spaTitle) {
    grid-column: 1 / 2 !important;
    grid-row: 2 / 3 !important;
    justify-self: start !important;
    align-self: start !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  :where(.spaBanner-count) {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    justify-self: end !important;
    align-self: start !important;
    margin: 0 !important;
    opacity: 0.8;
  }
}

/* === PHONE LANDSCAPE: tighten title position under gallery name === */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* move the title closer to gallery name */
  :where(#spaTitle) {
    margin-top: 2px !important; /* small upward shift */
    line-height: 1.1 !important;
  }

  /* optional: ensure count stays level with buttons, not sliding up */
  :where(.spaBanner-count) {
    align-self: center !important;
  }
}

/* === PHONE LANDSCAPE: move count below image title === */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  :where(.spaBanner-wrap) {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto auto !important; /* add a third row */
    row-gap: 2px !important;
  }

  /* gallery name (row 1, left) */
  :where(#spaBannerGallery) {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
  }

  /* image title (row 2, left) */
  :where(#spaTitle) {
    grid-column: 1 / 2 !important;
    grid-row: 2 / 3 !important;
    margin-top: 0 !important;
  }

  /* count (row 3, left) — directly below title */
  :where(.spaBanner-count) {
    grid-column: 1 / 2 !important;
    grid-row: 3 / 4 !important;
    justify-self: start !important;
    align-self: start !important;
    margin-top: 0 !important;
    font-size: 0.85rem !important;
    line-height: 1.1 !important;
    color: var(--muted);
  }

  /* buttons (row 1–2, right side, vertically centered on top two rows) */
  :where(.spaBanner-buttons) {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 3 !important;
    align-self: start !important;
    justify-self: end !important;
    display: inline-flex !important;
    gap: 8px !important;
  }
}

/* ——— PHONE LANDSCAPE: normalize top/bottom spacing across URL bar states ——— */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* A reusable top gap that adapts to the URL bar/status bar height.
     When the bar is hidden, env(...) = 0, so we keep a small 8px gap.
     When it's visible, the inset is larger; we cap it so it doesn't look too low. */
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --top-gap: clamp(8px, var(--safe-top), 18px);
  }

  /* Put the gap on the banner container instead of relying on browser chrome */
  :where(.spaBanner-wrap) {
    margin-top: var(--top-gap) !important;
  }

  /* Keep the buttons off the curved corners on notched phones */
  :where(.spaBanner-buttons) {
    margin-right: calc(8px + var(--safe-right)) !important;
  }

  /* If you’ve moved the phone chip to the lower-left, make it notch-aware too */
  :where(.brand-mobile) {
    position: fixed !important;
    left: calc(10px + var(--safe-left)) !important;
    bottom: calc(10px + var(--safe-bottom)) !important;
    right: auto !important;
    top: auto !important;
  }
}
/* PHONE LANDSCAPE: spawn the nsgrit menu upward from the chip */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* make the chip wrapper the positioning context and park it */
  .brand-mobile {
    position: fixed !important;
    left: calc(10px + env(safe-area-inset-left, 0px)) !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    right: auto !important;
    top: auto !important;
  }

  /* flip the dropdown upward — beat the old `top: calc(100% + 8px)` */
  .brand-mobile .brand-menu-phone,
  .brand-mobile #brandMenuPhone {
    position: absolute !important;
    top: auto !important; /* cancel the old rule */
    bottom: calc(100% + 8px) !important; /* open above the chip */
    left: 0 !important;
    transform-origin: bottom left !important;
    max-height: min(50vh, 360px) !important;
    overflow: auto !important;
  }

  /* keep the open/close animation working */
  .brand-mobile .brand-menu-phone {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition:
      opacity 0.16s ease,
      transform 0.16s ease;
    pointer-events: none;
  }
  .brand-mobile .brand-menu-phone[data-open='true'] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}

/* === PHONE (portrait + landscape): thicker border on nav dropdown === */
@media (hover: none) and (pointer: coarse) {
  .brand-mobile .brand-menu-phone {
    border-width: 2px !important; /* or 3px for extra heft */
    border-style: solid !important;
    border-color: rgba(
      255,
      255,
      255,
      0.18
    ) !important; /* slightly brighter tone */
    border-radius: 12px !important; /* keep your rounding */
  }
}

/* === PHONE: nudge the dropdown away from the finger === */
@media (hover: none) and (pointer: coarse) {
  /* start in the neutral (closed) spot */
  .brand-mobile .brand-menu-phone {
    transform: translate(0, 0) !important;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  /* when open, slide it 50px → right and 20px ↑ up */
  .brand-mobile .brand-menu-phone[data-open='true'] {
    transform: translate(50px, 0px) !important;
  }
}

/* PHONE ONLY: header visible by default; hide only on gallery pages */
@media (hover: none) and (pointer: coarse) {
  /* 1) Default = visible on phone routes like About/Home/Legal */
  .site-header {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  /* 2) Hide ONLY when a gallery is present AND we are not on About */
  body:has(.spaGallery):not(.route-about) .site-header {
    display: none !important;
  }
}

/* PHONE: header is non-sticky everywhere except galleries (where it's hidden) */
@media (hover: none) and (pointer: coarse) {
  /* Default for phone routes like Home/About/Legal: show, not sticky */
  body:not(:has(.spaGallery)) .site-header {
    display: flex !important;
    position: static !important; /* <- key: not sticky */
    top: auto !important;
    z-index: auto !important;
  }

  /* Galleries on phone: keep header hidden */
  body:has(.spaGallery) .site-header {
    display: none !important;
  }
}

/* ✅ HOME • PHONE LANDSCAPE — big, balanced cards (no funky bars) */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* 1) Two large tiles per row (still big) */
  body.route-home .cards,
  body.route-home .home-section > .cards {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(44vw, 1fr)) !important; /* ~2-up */
    gap: 16px !important;
    padding-inline: 3vw !important;
    width: 100vw !important;
  }

  /* 2) Keep tiles tidy and edge-to-edge inside the card */
  body.route-home .card {
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  /* 3) Use a stable, wide aspect (16:9) tied to width (prevents vh “bars”) */
  body.route-home .card-media {
    height: 0 !important;
    padding-bottom: 56% !important; /* 16:9 */
    background: #111 !important;
  }
  /* Make sure we’re filling the frame—no letterbox */
  body.route-home .card-media::before {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }

  /* 4) Comfortable type scale under the image */
  body.route-home .card .title {
    font-size: clamp(1.15rem, 2vw, 1.4rem) !important;
    line-height: 1.2 !important;
  }
  body.route-home .card .hint {
    font-size: clamp(1rem, 1.8vw, 1.2rem) !important;
    font-weight: 600 !important;
  }
}

/* 🧴 HOME • PHONE LANDSCAPE — no-crop tiles with blurred fill */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  body.route-home .cards,
  body.route-home .home-section > .cards {
    grid-template-columns: repeat(
      2,
      minmax(44vw, 1fr)
    ) !important; /* big 2-up */
    gap: 16px !important;
    padding-inline: 3vw !important;
  }

  body.route-home .card {
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  /* Keep a wide, stable tile height */
  body.route-home .card-media {
    position: relative !important;
    height: 0 !important;
    padding-bottom: 60% !important; /* try 60% if you want it taller */
    background: #111 !important;
    overflow: hidden !important;
  }

  /* Top layer: sharp image, fully visible (no crop) */
  body.route-home .card-media::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background-image: var(--card-bg) !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important; /* ← no cropping */
    z-index: 1 !important;
  }

  /* Bottom layer: blurred cover fill to hide letterbox bars */
  body.route-home .card-media::after {
    content: '' !important;
    position: absolute !important;
    inset: -2% !important; /* slight bleed past edges */
    background-image: var(--card-bg) !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    filter: blur(14px) saturate(0.9) brightness(0.1);
    transform: scale(1.05); /* avoid edge artifacts */
    z-index: 0 !important;
    pointer-events: none;
  }

  /* Comfortable text scale */
  body.route-home .card .title {
    font-size: clamp(1.15rem, 2vw, 1.4rem) !important;
    line-height: 1.2 !important;
  }
  body.route-home .card .hint {
    font-size: clamp(1rem, 1.8vw, 1.2rem) !important;
    font-weight: 600 !important;
  }
}

/* 📱 HOME • phone-landscape: desktop styling, scaled up */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Bigger columns than the desktop 360px fallback */
  body.route-home .cards {
    grid-template-columns: repeat(
      2,
      minmax(44vw, 1fr)
    ) !important; /* two big tiles */
    gap: 16px !important;
    padding-inline: 3vw !important;
    width: 100vw !important;
  }

  /* Keep the same desktop chrome; just make the media box a touch taller */
  body.route-home .card-media {
    padding-bottom: 60% !important; /* desktop is 75% (4:3). 60% ≈ taller 16:9. */
  }

  /* Slightly larger footer text for readability */
  body.route-home .card .title {
    font-size: clamp(1.1rem, 2vw, 1.4rem) !important;
  }
  body.route-home .card .hint {
    font-size: clamp(1rem, 1.8vw, 1.2rem) !important;
    font-weight: 600 !important;
  }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Let desktop grid sizing apply, only widen columns slightly */
  body.route-home .cards {
    grid-template-columns: repeat(2, minmax(520px, 1fr)) !important;
    padding-inline: 2vw !important;
    gap: 16px !important;
  }
  /* Avoid extra top margins that steal height */
  .spaBanner-wrap {
    margin-top: 0 !important;
  }
}

/* 📱 MOBILE (iOS + Android) • LANDSCAPE • Home cards larger & crisp */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  /* Bigger columns (2-up) */
  body.route-home .cards {
    grid-template-columns: repeat(2, minmax(46vw, 1fr)) !important;
    gap: 16px !important;
    padding-inline: 3vw !important;
    width: 100vw !important;
  }

  /* Let the media breathe vertically */
  body.route-home .card-media {
    height: auto !important;
    padding-bottom: 0 !important;
    aspect-ratio: 16 / 9 !important; /* 16:9 wide tile; change to 16/10 for taller */
    background: #111 !important;
  }

  /* Crisp, cover-filled image (works on all mobile browsers) */
  body.route-home .card-media::before {
    background-image: image-set(
      var(--card-bg) 1x,
      var(--card-bg-2x, var(--card-bg)) 2x
    ) !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;

    /* Sharpening hints for WebKit + Blink */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
  }

  /* Footer text scale */
  body.route-home .card .title {
    font-size: clamp(1.1rem, 2vw, 1.4rem) !important;
    line-height: 1.2 !important;
  }
  body.route-home .card .hint {
    font-size: clamp(1rem, 1.8vw, 1.2rem) !important;
    font-weight: 600 !important;
  }
}

/* === PHONE: About & Legal — floating but page-pinned phone chip === */
@media (hover: none) and (pointer: coarse) {
  /* Make the content blocks the positioning context */
  body.route-about .about-vert,
  body.route-legal .about {
    position: relative;
    padding-top: 8px; /* room for the chip if it overlaps a hair */
  }

  /* Absolute holder that pins the chip visually, but it scrolls with page */
  body.route-about .chip-pin,
  body.route-legal .chip-pin {
    position: absolute;
    z-index: 40;
    top: -24px; /* tweak to taste */
    left: 8px; /* align with text column */
    pointer-events: none; /* holder ignores taps */
  }

  /* Neutralize gallery rules that force phone chip to fixed in landscape */
  body.route-about .chip-pin .brand-mobile,
  body.route-legal .chip-pin .brand-mobile {
    position: static !important;
    margin: 0 !important;
    transform: translate(0px, -90px) !important;
  }

  /* Chip remains tappable */
  body.route-about .chip-pin .brand-fab-phone,
  body.route-legal .chip-pin .brand-fab-phone {
    pointer-events: auto;
  }

  /* Menu should drop downward under the chip (not upward, no nudge) */
  body.route-about .chip-pin .brand-menu-phone,
  body.route-legal .chip-pin .brand-menu-phone {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    max-height: none !important;
  }
  body.route-about .chip-pin .brand-menu-phone[data-open='true'],
  body.route-legal .chip-pin .brand-menu-phone[data-open='true'] {
    transform: none !important; /* cancel the 50px nudge-from-finger rule */
  }

  /* Landscape: tiny nudge if you want it closer to text */
  @media (orientation: landscape) {
    body.route-about .chip-pin,
    body.route-legal .chip-pin {
      top: -20px;
      left: 6px;
    }
  }
}

/* ——— ABOUT (phone only): force the phone menu to drop *below* the chip ——— */
/* mostly landscape */
@media (hover: none) and (pointer: coarse) {
  /* Make the holder ignore taps, but allow the chip and menu to be clickable */
  body.route-about .chip-pin {
    pointer-events: none !important;
  }

  body.route-about .chip-pin .brand-fab-phone,
  body.route-about .chip-pin .brand-menu-phone {
    pointer-events: auto !important;
  }

  /* Kill the accidental lift on the wrapper so positioning is sane */
  body.route-about .chip-pin .brand-mobile {
    transform: none !important;
    transform: translate(-20px, -55px) !important;
  }

  /* Beat the global/landscape rules (including the ID selector) */
  body.route-about .chip-pin #brandMenuPhone,
  body.route-about .chip-pin .brand-menu-phone {
    position: absolute !important;
    top: calc(100% + 8px) !important; /* ▼ open *below* */
    bottom: auto !important; /* cancel “open above” */
    left: 0 !important;
    right: auto !important;
    transform: none !important; /* cancel the 50px nudge */
    max-height: none !important;
    pointer-events: auto !important;
  }

  /* Keep it neutral when open (no slide/scale) */
  body.route-about .chip-pin #brandMenuPhone[data-open='true'],
  body.route-about .chip-pin .brand-menu-phone[data-open='true'] {
    transform: none !important;
  }

  /* Landscape too — re-assert the downward opening */
  @media (orientation: landscape) {
    body.route-about .chip-pin #brandMenuPhone,
    body.route-about .chip-pin .brand-menu-phone {
      top: calc(100% + 8px) !important;
      bottom: auto !important;
      transform-origin: top left !important;
    }
  }
}

/* ——— LEGAL (phone only): force the phone menu to drop *below* the chip ——— */
@media (hover: none) and (pointer: coarse) {
  /* Make the holder ignore taps, but allow the chip and menu to be clickable */
  body.route-legal .chip-pin {
    pointer-events: none !important;
  }

  body.route-legal .chip-pin .brand-fab-phone,
  body.route-legal .chip-pin .brand-menu-phone {
    pointer-events: auto !important;
  }

  /* Kill the accidental lift on the wrapper so positioning is sane */
  body.route-legal .chip-pin .brand-mobile {
    transform: none !important;
    transform: translate(0px, -60px) !important;
  }

  /* Beat the global/landscape rules (including the ID selector) */
  body.route-legal .chip-pin #brandMenuPhone,
  body.route-legal .chip-pin .brand-menu-phone {
    position: absolute !important;
    top: calc(100% + 8px) !important; /* ▼ open *below* */
    bottom: auto !important; /* cancel “open above” */
    left: 0 !important;
    right: auto !important;
    transform: none !important; /* cancel the 50px nudge */
    max-height: none !important;
    pointer-events: auto !important;
  }

  /* Keep it neutral when open (no slide/scale) */
  body.route-legal .chip-pin #brandMenuPhone[data-open='true'],
  body.route-legal .chip-pin .brand-menu-phone[data-open='true'] {
    transform: none !important;
  }

  /* Landscape too — re-assert the downward opening */
  @media (orientation: landscape) {
    body.route-legal .chip-pin #brandMenuPhone,
    body.route-legal .chip-pin .brand-menu-phone {
      top: calc(100% + 8px) !important;
      bottom: auto !important;
      transform-origin: top left !important;
    }
  }
}

/* Tighten space under the pinned chip on About & Legal (phone) */
@media (hover: none) and (pointer: coarse) {
  /* Remove extra top padding/margin on the content blocks */
  body.route-about .about-vert {
    padding-top: 0 !important;
    margin-top: 4px !important; /* was ~16px */
  }
  body.route-legal .about {
    padding-top: 0 !important;
    margin-top: 6px !important;
  }

  /* Nudge the chip-holder so it sits a touch closer to the text */
  body.route-about .chip-pin,
  body.route-legal .chip-pin {
    top: -16px !important; /* was -26/-20; bring content up under it */
    left: 8px !important;
  }

  /* Ensure the first paragraph/card doesn’t re-add a top gap */
  body.route-about .about-vert > :not(.chip-pin):first-child,
  body.route-legal .about > :not(.chip-pin):first-child {
    margin-top: 0 !important;
  }
}

/* ——— PHONE PORTRAIT ——— */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  /* Kill the accidental lift on the wrapper so positioning is sane */
  body.route-about .chip-pin .brand-mobile {
    transform: none !important;
    transform: translate(-25px, -58px) !important;
  }

  /* Nudge the chip-holder so it sits a touch closer to the text */
  body.route-about .chip-pin,
  body.route-legal .chip-pin {
    top: -18px !important; /* was -26/-20; bring content up under it */
    left: 8px !important;
  }

  .site-header {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 100;
    transform: translate(10px, 0px) !important;
  }
}

/* PHONE — Home: chip should scroll with the page (not fixed) */
@media (hover: none) and (pointer: coarse) {
  /* make sure the holder is absolute (page-pinned) */
  body.route-home .chip-pin {
    position: absolute !important;
    top: 30px !important; /* your ~100px lift */
    left: 10px !important;
    pointer-events: none; /* holder ignores taps */
  }

  /* cancel all the global “fixed chip” rules */
  body.route-home .chip-pin .brand-mobile,
  body.route-home .chip-pin .brand-fab-phone {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    pointer-events: auto; /* chip remains clickable */
  }

  /* keep the dropdown opening downward from the chip */
  body.route-home .chip-pin .brand-menu-phone {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    bottom: auto !important;
    right: auto !important;
    transform: none !important;
  }

  /* Make the holder ignore taps, but allow the chip and menu to be clickable */
  body.route-home .chip-pin {
    pointer-events: none !important;
  }
  body.route-home .chip-pin .brand-fab-phone,
  body.route-home .chip-pin .brand-menu-phone {
    pointer-events: auto !important;
  }

  /* Kill the accidental lift on the wrapper so positioning is sane */
  body.route-home .chip-pin .brand-mobile {
    transform: none !important;
    transform: translate(20px, 0px) !important;
  }

  /* Beat the global/landscape rules (including the ID selector) */
  body.route-home .chip-pin #brandMenuPhone,
  body.route-home .chip-pin .brand-menu-phone {
    position: absolute !important;
    top: calc(100% + 8px) !important; /* ▼ open *below* */
    bottom: auto !important; /* cancel “open above” */
    left: 0 !important;
    right: auto !important;
    transform: none !important; /* cancel the 50px nudge */
    max-height: none !important;
    pointer-events: auto !important;
  }

  /* Keep it neutral when open (no slide/scale) */
  body.route-home .chip-pin #brandMenuPhone[data-open='true'],
  body.route-home .chip-pin .brand-menu-phone[data-open='true'] {
    transform: none !important;
  }

  /* Landscape too — re-assert the downward opening */
  @media (orientation: landscape) {
    body.route-home .chip-pin #brandMenuPhone,
    body.route-home .chip-pin .brand-menu-phone {
      top: calc(100% + 8px) !important;
      bottom: auto !important;
      transform-origin: top left !important;
    }
  }
}

/* also assert this in landscape, which previously forced the chip fixed */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  body.route-home .chip-pin .brand-mobile {
    position: static !important;
  }
}

/* HOME (phone): ensure the dropdown actually appears below the chip */
@media (hover: none) and (pointer: coarse) {
  /* Base placement under the chip (we already forced absolute in JS) */
  body.route-home .chip-pin .brand-menu-phone,
  body.route-home .chip-pin #brandMenuPhone {
    position: absolute !important;
    top: calc(100% + 8px) !important; /* open BELOW */
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important; /* cancel any global nudge */
    max-height: none !important;
    z-index: 1000 !important; /* sit above cards, etc. */
    opacity: 0; /* closed state */
    pointer-events: none;
  }

  /* Open state */
  body.route-home .chip-pin .brand-menu-phone[data-open='true'],
  body.route-home .chip-pin #brandMenuPhone[data-open='true'] {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* === PHONE: unified, page-pinned nsgrit chip for non-gallery pages === */
@media (hover: none) and (pointer: coarse) {
  /* Positioning contexts */
  body.route-home .wrap {
    position: relative; /* anchor for .chip-pin */
  }

  /* Page-pinned holder + simple chip */
  .chip-pin {
    position: absolute !important;
    z-index: 40;
    pointer-events: none; /* holder ignores taps */
  }

  .chip-pin .brand-mobile {
    position: absolute !important;
    top: 0;
    left: 0;
    transform: none !important;
    margin: 0 !important;
    pointer-events: auto; /* chip is clickable */
  }

  /* Orientation-based offsets (defaults) */
  :root {
    --chip-top-portrait: -92px;
    --chip-left-portrait: 8px;
    --chip-top-landscape: -64px;
    --chip-left-landscape: 6px;
  }

  /* Per-route tweaks (override if you want different heights) */
  body.route-home {
    --chip-top-portrait: -118px;
    --chip-top-landscape: -84px;
  }
  /* body.route-about { --chip-top-portrait: -92px;  --chip-top-landscape: -64px; } */
  /* body.route-legal { --chip-top-portrait: -90px;  --chip-top-landscape: -60px; } */

  @media (orientation: portrait) {
    body.route-home .chip-pin {
      top: -63px !important;
      left: -10px !important;
    }
  }
  @media (orientation: landscape) {
    body.route-home .chip-pin {
      top: -57px !important;
      left: calc(var(--chip-left-landscape) + env(safe-area-inset-left, 0px));
    }
  }

  /* Always open the menu BELOW the chip on these routes */
  body.route-home .chip-pin .brand-menu-phone,
  body.route-home .chip-pin #brandMenuPhone {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important; /* cancel gallery nudge */
    max-height: none !important;
    z-index: 1000 !important;
    opacity: 0;
    pointer-events: none;
  }
  body.route-home .chip-pin .brand-menu-phone[data-open='true'],
  body.route-home .chip-pin #brandMenuPhone[data-open='true'] {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Neutralize any global "fixed chip" leakage */
  body.route-home .chip-pin .brand-mobile {
    right: auto !important;
    bottom: auto !important;
  }

  /* Trim extra space under the chip */
  body.route-home .wrap > :not(.chip-pin):first-child {
    margin-top: 0 !important;
  }
}

/* Phone portrait: stack the email + button, keep everything inside the dialog */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .nl-dialog {
    width: min(92vw, 520px);
    padding: 1rem; /* a bit tighter so nothing hugs edges */
    box-sizing: border-box;
  }

  .newsletter-fields {
    display: grid; /* switch from flex row -> single column */
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .newsletter-fields input[type='email'],
  .nl-submit {
    width: 100%; /* full-width controls */
  }

  /* prevent overflow from long placeholders or accidental shrink */
  .newsletter-fields input[type='email'] {
    min-width: 0; /* allow shrinking within the grid */
    font-size: 16px; /* avoids iOS zoom-on-focus */
  }
}

.section-label {
  grid-column: 1 / -1; /* full-width across both columns */
}

/* Center the Home section titles */
.home-section .section-label {
  display: block;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  font-weight: 600;
  font-size: clamp(1rem, 1.4vw + 0.4rem, 1.5rem);
  letter-spacing: 0.05em;
  color: var(--fg-dim); /* same gray you use in nav, usually #aaa-ish */
  margin: 2.5rem 0 1.25rem;
}

.home-sep {
  border: none;
  width: 50%;
  margin: 2.5rem auto 2.5rem;
  opacity: 0.7;
  border-top: 5px solid #444; /* was 1px */
}

/* subtle divider below the site header */
.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px; /* thickness */
  background: rgba(255, 255, 255, 0.15); /* faint line — tweak alpha to taste */
  pointer-events: none;
}

.site-header {
  position: sticky; /* or fixed, depending on your setup */
  top: 0;
  z-index: 100;
  background: #0a0a0a; /* ensure background behind the bar */
}

/* 📱 phone & tablet portrait — slimmer header */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .site-header {
    padding-top: 4px !important;
    padding-bottom: 1px !important;
  }

  .header-inner {
    padding-top: 4px !important;
    padding-bottom: 0px !important;
  }
}

/* 📱 phone & tablet portrait — slimmer header */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  .site-header {
    padding-top: 2px !important;
    padding-bottom: 0px !important;
  }

  .header-inner {
    padding-top: 0px !important;
    padding-bottom: 0px !important;
  }

  .site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }
  .site-header::after {
    content: none;
  } /* if you want to remove the pseudo */
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .home-section .section-label {
    margin-top: calc(2.5rem - 12px);
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  .home-section .section-label {
    margin-top: calc(2.5rem - 12px);
  }
}

/* 📱 phone portrait — move nsgrit chip to lower-left in gallery mode */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  body:has(.spaGallery) .brand-mobile {
    position: fixed !important;
    bottom: 40px !important;
    left: 10px !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 30 !important;
  }

  /* make the dropdown open upward (same as landscape) */
  body:has(.spaGallery) .brand-mobile .brand-menu-phone {
    position: absolute !important;
    top: auto !important;
    bottom: calc(90% + 8px) !important; /* open above the chip */
    left: 0 !important;
    right: auto !important;
    transform-origin: bottom left !important;
  }
}

/* 📱 Phone PORTRAIT — keep gallery name below the status bar */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  body:has(.spaGallery) .spaBanner-wrap {
    margin-top: calc(
      env(safe-area-inset-top, 0px) + 24px
    ) !important; /* nudge down */
  }

  /* optional tiny lift for the label if you want it closer to the title */
  body:has(.spaGallery) .spaBanner-gallery {
    transform: translateY(2px);
  }
}

/* 📱 Phone PORTRAIT — keep gallery name below the status bar */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  body:has(.spaGallery) .spaBanner-wrap {
    margin-top: calc(env(safe-area-inset-top, 0px)) !important; /* nudge down */
  }

  /* optional tiny lift for the label if you want it closer to the title */
  body:has(.spaGallery) .spaBanner-gallery {
    transform: translateY(2px);
  }
}

/* Linked-image affordance: shows only when data-href is present */
.spaSlide[data-href],
.spaTile[data-href] {
  position: relative;
}

/* corner glyph (↗) that fades in on hover/focus for linked images */
.spaSlide[data-href]::after,
.spaTile[data-href]::after {
  content: 'View ↗';
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #555;
  color: #eaeaea;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none; /* purely informational */
}

/* reveal on mouse hover or keyboard focus */
.spaSlide[data-href]:hover::after,
.spaSlide[data-href]:focus-within::after,
.spaTile[data-href]:hover::after,
.spaTile[data-href]:focus-visible::after {
  opacity: 1;
  transform: none;
}

/* ensure the pointer cursor only for linked images (slides + grid tiles) */
.spaSlide[data-href],
.spaTile[data-href] {
  cursor: pointer;
}

/* faint dot in the top-right corner for linked images; brightens on hover */
.spaSlide[data-href]::before,
.spaTile[data-href]::before {
  content: '';
  position: absolute;
  top: 10px;
  right: -6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

/* hover/focus = slightly brighter so it reads as intentional */
.spaSlide[data-href]:hover::before,
.spaSlide[data-href]:focus-within::before,
.spaTile[data-href]:hover::before,
.spaTile[data-href]:focus-visible::before {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

/* Ensure linked slides/tiles can host the badge */
.spaSlide[data-href],
.spaTile[data-href] {
  position: relative;
  cursor: pointer;
}

/* Remove the tiny dot we added earlier (to avoid double signals) */
.spaSlide[data-href]::before,
.spaTile[data-href]::before {
  content: none !important;
}

/* Always-visible corner badge for linked images */
.spaSlide[data-href]::after,
.spaTile[data-href]::after {
  content: 'View ↗';
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eaeaea;
  pointer-events: none; /* don't block taps/clicks */
  -webkit-font-smoothing: antialiased;
}

/* Optional: slightly brighter on focus (keyboard a11y) */
.spaSlide[data-href]:focus-within::after,
.spaTile[data-href]:focus-visible::after {
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(255, 255, 255, 0.28);
}

/* reveal on mouse hover or keyboard focus */
.spaSlide[data-href]:hover::after,
.spaSlide[data-href]:focus-within::after,
.thumb[data-href]:hover::after,
.thumb[data-href]:focus-visible::after,
.spaTile[data-href]:hover::after,
.spaTile[data-href]:focus-visible::after {
  opacity: 1;
  transform: none;
}

/* ensure the pointer cursor only for linked images (slides + grid tiles) */
.spaSlide[data-href],
.thumb[data-href],
.spaTile[data-href] {
  cursor: pointer;
}

/* (if you keep the tiny dot affordance) */
.spaSlide[data-href]::before,
.thumb[data-href]::before,
.spaTile[data-href]::before {
  content: '';
  position: absolute;
  top: 10px;
  right: -6px; /* pulled away from the image edge */
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

/* Always-visible corner badge for linked images */
.spaSlide[data-href]::after,
.thumb[data-href]::after,
.spaTile[data-href]::after {
  content: 'View ↗';
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eaeaea;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

/* Host the badge on linked slides/thumbs */
.spaSlide[data-href],
.thumb[data-href] {
  position: relative; /* .thumb already had it, this ensures .spaSlide does too */
  cursor: pointer;
}

/* Always-visible corner badge for linked images (desktop + phone) */
.spaSlide[data-href]::after,
.thumb[data-href]::after {
  content: 'View ↗';
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  font-size: 12px;
  line-height: 2;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eaeaea;
  pointer-events: none; /* never blocks clicks/taps */
  -webkit-font-smoothing: antialiased;
  opacity: 1 !important; /* defeats any earlier hover-only rule that set opacity:0 */
}

/* Always-visible corner badge for linked images (desktop + phone) */
.spaSlide[data-href]::after,
.thumb[data-href]::after {
  content: 'View ↗';
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  font-size: 12px;
  line-height: 2;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eaeaea;
  pointer-events: none; /* never blocks clicks/taps */
  -webkit-font-smoothing: antialiased;
  opacity: 1 !important; /* defeats any earlier hover-only rule that set opacity:0 */
}

/* Smoothen filter transitions for linked images */
.spaSlide[data-href] img,
.thumb[data-href] img,
.spaTile[data-href] img {
  transition: filter 0.18s ease;
  will-change: filter;
}

/* Desktop/keyboard: brighten + tiny contrast on hover/focus */
.spaSlide[data-href]:hover img,
.spaSlide[data-href]:focus-within img,
.thumb[data-href]:hover img,
.thumb[data-href]:focus-visible img,
.spaTile[data-href]:hover img,
.spaTile[data-href]:focus-visible img {
  filter: brightness(1.16) contrast(1.02);
}

/* Touch feedback: brief pop on tap */
@media (hover: none) {
  .spaSlide[data-href]:active img,
  .thumb[data-href]:active img,
  .spaTile[data-href]:active img {
    filter: brightness(1.08) contrast(1.03);
    transition-duration: 80ms;
  }
}

/* --- About page header --- */
.about-head {
  max-width: 860px;
  margin: 5px auto 20px;
  padding: 0 8px;
  text-align: center;
}

.about-head h1 {
  font-size: clamp(1.6rem, 1rem + 1.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--fg);
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-block; /* underline fits text width */
  filter: brightness(1.05);
}

/* 1) Phone: keep the nsgrit chip higher on the About route */
@media (hover: none) and (pointer: coarse) {
  body.route-about .chip-pin {
    top: -85px !important;
  } /* baseline */
  @media (orientation: portrait) {
    body.route-about .chip-pin {
      top: -85px !important;
    } /* portrait */
  }
}

/* 2) Phone: soften the new About heading’s top margin so it doesn’t push */
@media (hover: none) and (pointer: coarse) {
  .about-head {
    margin: 18px auto 14px !important;
  }
}

.title-is-link {
  cursor: pointer;
}

.title-is-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.tile.has-link:hover::after {
  opacity: 0.9;
}

/* arrow after title for any caption with a link */
.cap.has-link .name-text::after {
  content: ' ↗';
  font-weight: 600;
  font-size: 0.9em;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.cap.has-link .name-link:hover .name-text::after {
  opacity: 0.6;
}

.insta-link {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.insta-link:hover {
  color: var(--link-hover);
}
