/* ==========================================================
   JUST BLOOD - Main Stylesheet (v5)
   Mobile-first. Breakpoints: 600px, 900px, 1024px (menu), 1200px
   ========================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --cyan: #29c5d6;
  --cyan-bright: #00e5ff;
  --white: #ffffff;
  --text: #dfe4e6;
  --muted: #93a4ab;
  --dim: #68777d;
  --line: #102731;
  --line-2: #1d3b47;
  --rule: rgba(41, 197, 214, .55);
  --black: #000000;
  --bg: #03080b;

  --header-h: 60px;
  --gutter: 20px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
@media (min-width: 600px) { :root { --gutter: 32px; } }
@media (min-width: 900px) { :root { --header-h: 68px; --gutter: 3.6vw; } }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 3px; }
html.is-locked, html.is-locked body { overflow: hidden; }
.cyan { color: var(--cyan); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--cyan-bright); color: #001116; padding: 10px 14px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ---------- 3. Logo ---------- */
.logo-img { display: block; width: auto; height: 22px; }
.footer-logo .logo-img { height: 28px; }
@media (min-width: 900px) {
  .logo-img { height: 26px; }
  .footer-logo .logo-img { height: 32px; }
}

/* ---------- 4. Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding-top: var(--safe-top);
  background: linear-gradient(#000 40%, rgba(0, 0, 0, .75) 75%, rgba(0, 0, 0, 0));
  border-bottom: 1px solid transparent;
  transition: background-color .25s ease, border-color .25s ease;
}
.site-header.is-scrolled { background: rgba(0, 0, 0, .95); border-bottom-color: var(--line); }
.header-inner {
  height: var(--header-h);
  padding: 0 calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: inline-flex; align-items: center; height: 100%; text-decoration: none; }

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(16px, 1.9vw, 28px); }
.nav-list a {
  display: inline-flex; align-items: center;
  color: var(--white); text-decoration: none;
  font-size: 15px; line-height: 1; padding: 10px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav-list a:hover, .nav-list a.is-active { color: var(--cyan); border-bottom-color: var(--cyan); }
.nav-list a.nav-petition { font-weight: 700; letter-spacing: .01em; }
.ext-icon {
  display: inline-block; width: 8px; height: 8px; margin-left: 5px; opacity: .75; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M4 0h6v6H8.5V2.6L1.1 10 0 8.9 7.4 1.5H4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M4 0h6v6H8.5V2.6L1.1 10 0 8.9 7.4 1.5H4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.menu-toggle {
  display: none; flex: 0 0 auto;
  width: 44px; height: 44px; padding: 0; margin-right: -6px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.menu-toggle .bar { display: block; width: 20px; height: 2px; background: var(--white); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.menu-open .menu-toggle .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle .bar:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1023px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; top: calc(var(--header-h) + var(--safe-top)); left: 0; right: 0; bottom: 0;
    background: #000; border-top: 1px solid var(--line);
    padding: 12px calc(var(--gutter) + var(--safe-right)) calc(30px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
    overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
  }
  .menu-open .main-nav { opacity: 1; visibility: visible; transform: none; }
  .main-nav .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav .nav-list li { border-bottom: 1px solid #0f1f26; }
  .main-nav .nav-list a { display: flex; padding: 20px 0; font-size: 18px; border-bottom: 0; }
  .main-nav .nav-list a:hover, .main-nav .nav-list a.is-active { border-bottom: 0; }
  .main-nav .nav-list li:last-child { border-bottom: 0; padding-top: 22px; }
  .main-nav .nav-list a.nav-petition {
    justify-content: center; padding: 18px; font-size: 15px; letter-spacing: .08em;
    background: var(--cyan-bright); color: #001116;
  }
}

/* ---------- 5. Slides (shared) ---------- */
.slide { position: relative; background: radial-gradient(ellipse at 50% 45%, #061520 0%, #02070a 55%, #000 100%); }

/* ---------- 6. Slide 1: Intro ---------- */
.intro-slide {
  padding: calc(var(--header-h) + var(--safe-top) + 32px) calc(var(--gutter) + var(--safe-right)) 8px calc(var(--gutter) + var(--safe-left));
}
.intro-inner { max-width: 680px; margin: 0 auto; }
.eyebrow { color: var(--cyan); font-size: 14px; margin: 0 0 12px; }
.intro-title {
  font-size: clamp(40px, 11vw, 76px);
  font-weight: 700; line-height: 1.02; letter-spacing: -.02em;
  margin: 0 0 22px;
}
.intro-title .cyan { display: block; }
.br-wide { display: none; }
@media (min-width: 600px) { .intro-title .cyan { display: inline; } .br-wide { display: inline; } }
.intro-body { font-size: 17px; line-height: 1.55; color: var(--text); }
.intro-body p { margin: 0 0 16px; }
.intro-body strong { color: var(--white); }
.intro-body strong.hl { color: var(--cyan); }
.intro-lead { font-weight: 700; color: var(--white); font-size: 1.05em; }
.intro-close { margin-top: 24px !important; margin-bottom: 0 !important; }
@media (min-width: 900px) {
  .intro-slide { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-bottom: 56px; }
  #slide-1 { padding-top: 32px; }
  .intro-title { font-size: clamp(54px, 4.7vw, 72px); }
  .intro-body { font-size: clamp(16px, 1.2vw, 18px); }
}
.scroll-cue { display: none; }
@media (min-width: 900px) and (min-height: 760px) {
  .scroll-cue {
    display: block; position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
    color: var(--muted); font-size: 11px; letter-spacing: .3em; text-decoration: none; text-align: center;
  }
  .scroll-cue::after {
    content: ""; display: block; width: 1px; height: 30px; margin: 10px auto 0; background: var(--cyan);
    transform-origin: top; animation: cue 1.8s ease-in-out infinite;
  }
}
@keyframes cue { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---------- 7. Clickable images (shared) ---------- */
.media-btn {
  position: relative; display: block; width: 100%; padding: 0; margin: 0;
  border: 1px solid #173a47; background: #000; cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.media-btn img { width: 100%; height: auto; }
.media-btn:hover { border-color: var(--cyan); box-shadow: 0 0 50px rgba(41, 197, 214, .18); }
.expand-badge {
  position: absolute; right: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px;
  background: rgba(0, 0, 0, .78); border: 1px solid var(--cyan); color: var(--white);
  font-size: 10px; font-weight: 700; letter-spacing: .14em; line-height: 1;
  pointer-events: none; opacity: .92; transition: opacity .2s ease;
}
.expand-badge svg { width: 13px; height: 13px; flex: 0 0 auto; }
.expand-badge .label-touch { display: none; }
@media (hover: hover) {
  .expand-badge { opacity: 0; }
  .media-btn:hover .expand-badge, .media-btn:focus-visible .expand-badge { opacity: 1; }
}
@media (hover: none) {
  .expand-badge .label-mouse { display: none; }
  .expand-badge .label-touch { display: inline; }
}

/* ---------- 8. Slide 2: Four Documents ---------- */
.tech-slide { padding: 28px calc(10px + var(--safe-right)) 36px calc(10px + var(--safe-left)); background: #000; }
.tech-inner { max-width: 1600px; margin: 0 auto; }
.fullbleed-btn { border: 0; }
@media (min-width: 900px) {
  .tech-slide {
    min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h));
    display: flex; align-items: center; justify-content: center; padding: 20px 2vw;
  }
  .tech-inner { width: min(100%, calc((100vh - var(--header-h) - 40px) * 1.778)); }
}

/* ---------- 9. Presentation slides 01-13 ---------- */
.deck-slide { padding: 44px calc(var(--gutter) + var(--safe-right)) 48px calc(var(--gutter) + var(--safe-left)); }
/* Mobile/tablet: keep SLIDE 01 close to the end of the intro */
#slide-1 { padding-top: 36px; }
.deck-slide::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  height: 1px; background: var(--rule);
}
.deck-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; }
/* Mobile order: number + title, image, text + buttons */
.deck-text { display: contents; }
.deck-head { order: 1; }
.deck-media { order: 2; margin: 18px 0 20px; }
.deck-body { order: 3; }

.slide-num { color: var(--cyan); font-size: 13px; letter-spacing: .02em; margin: 0 0 8px; }
.slide-title { font-size: clamp(32px, 8.5vw, 50px); font-weight: 700; line-height: 1.05; letter-spacing: -.015em; }
.deck-body p { margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: var(--text); }

.step-nav { display: flex; gap: 8px; }
.step-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); color: var(--muted);
  font-size: 11px; letter-spacing: .08em; text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}
.step-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.step-btn.is-disabled { opacity: .35; pointer-events: none; }

@media (min-width: 900px) {
  .deck-slide {
    min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h));
    display: flex; align-items: center; padding-top: 32px; padding-bottom: 48px;
  }
  .deck-inner {
    width: 100%; flex-direction: row; align-items: center; gap: clamp(32px, 3.6vw, 56px);
  }
  .deck-text { display: block; flex: 0 0 31%; min-width: 0; }
  .deck-media { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; justify-content: center; }
  .deck-media .media-btn { width: min(100%, calc((100vh - var(--header-h) - 110px) * 1.778)); }
  .text-right .deck-text { order: 2; }
  .text-right .deck-media { order: 1; }
  .slide-title { font-size: clamp(36px, 3.4vw, 50px); margin-bottom: 18px; }
  .deck-body p { font-size: clamp(15px, 1.12vw, 17px); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
  .step-btn { min-height: 30px; padding: 0 10px; font-size: 10px; }
}

/* ---------- 10. Slide 14: Tiffany ---------- */
.tiffany-slide { background: #000; }
.tiffany-figure { margin: 0 auto; max-width: 1800px; position: relative; container-type: inline-size; }
.tiffany-btn { border: 0; }
.tiffany-caption { text-align: center; padding: 22px var(--gutter) 34px; }
.tiffany-quote { margin: 0 0 14px; font-size: clamp(22px, 6vw, 34px); font-weight: 700; line-height: 1.2; }
.q-by { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; font-size: .75em; color: var(--text); white-space: nowrap; }
.tiffany-byline { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.tiffany-num { margin: 0; font-size: 12px; color: var(--cyan); }

/* Tablet/desktop: overlay the text on the image, as in the design */
@media (min-width: 700px) {
  .tiffany-caption { position: absolute; inset: 0; padding: 0; pointer-events: none; }
  .tiffany-quote {
    position: absolute; right: 35.4%; top: 85.2%;
    margin: 0; padding: .06em .35em; background: rgba(0, 0, 0, .82);
    font-size: 2.72cqw; line-height: 1.3; white-space: nowrap;
  }
  .q-by { display: none; }            /* "- Edison" is already part of the image */
  .tiffany-byline { position: absolute; left: 0; right: 0; top: 94.6%; margin: 0; font-size: 1.25cqw; color: #fff; }
  .tiffany-num { position: absolute; right: 9.5%; top: 94.8%; font-size: .95cqw; }
  .tiffany-btn .expand-badge { top: 12px; bottom: auto; }
}
@media (min-width: 900px) {
  .tiffany-slide { min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); display: flex; align-items: center; }
  .tiffany-figure { width: min(100%, calc((100vh - var(--header-h)) * 1.778)); }
}

/* ---------- 11. Cancer Study ---------- */
.study-slide { padding: 48px 0 56px; }
.study-inner { max-width: 1240px; margin: 0 auto; padding: 0 calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left)); }
.study-title {
  font-size: clamp(32px, 7.6vw, 50px); font-weight: 700; line-height: 1.08; letter-spacing: -.015em;
  padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid var(--rule);
}
.study-body { font-size: 16px; line-height: 1.75; color: var(--text); }
.study-body p { margin: 0 0 16px; }
.study-body strong { color: var(--white); }
.study-lead { font-weight: 700; color: var(--white); font-size: 1.05em; }
.study-callout { font-weight: 800; color: var(--white); }
@media (min-width: 900px) {
  .study-slide { padding: 64px 0 72px; }
  .study-body { font-size: 16.5px; }
}

.study-visuals {
  max-width: 1400px; margin: 40px auto 0;
  padding: 0 calc(12px + var(--safe-right)) 0 calc(12px + var(--safe-left));
  display: grid; gap: 18px;
}
@media (min-width: 900px) {
  .study-visuals { gap: 28px; padding: 0 var(--gutter); margin-top: 56px; justify-items: center; }
  .study-visuals .media-btn { width: min(100%, calc((100vh - var(--header-h) - 40px) * 1.778)); }
}

.evidence-block {
  max-width: 1400px; margin: 40px auto 0;
  padding: 0 calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
}
.evidence-title { font-size: clamp(19px, 2.4vw, 26px); line-height: 1.35; font-weight: 700; max-width: 760px; margin-bottom: 22px; }
.evidence-grid { display: grid; gap: 22px; }
.doc-btn { background: #fff; border-color: #2a3c44; }
.yt-link {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--line-2); background: #050d11; color: var(--white); text-decoration: none;
  transition: border-color .2s ease;
}
.yt-link svg { width: 34px; height: 34px; color: #ff2d2d; flex: 0 0 auto; }
.yt-link > span { display: flex; flex-direction: column; min-width: 0; }
.yt-label { font-weight: 700; font-size: 15px; }
.yt-url { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.yt-link:hover { border-color: var(--cyan); }
.yt-link:hover .yt-label { color: var(--cyan); }
@media (min-width: 900px) {
  .evidence-block { margin-top: 64px; }
  .evidence-grid { grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
}

/* ---------- 12. Footer (final page) ---------- */
.site-footer { background: #000; }
.footer-hero { position: relative; overflow: hidden; }
.footer-hero img { width: 100%; height: auto; min-height: 220px; object-fit: cover; }
.footer-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(rgba(0, 0, 0, 0), #000);
}
.footer-main {
  text-align: center; margin-top: -8px; position: relative;
  padding: 0 calc(var(--gutter) + var(--safe-right)) 34px calc(var(--gutter) + var(--safe-left));
}
.footer-logo { display: inline-flex; text-decoration: none; margin-bottom: 20px; }
.nav-foot { justify-content: center; flex-wrap: wrap; gap: 4px 24px; }
.nav-foot a { font-size: 15px; min-height: 44px; }
.nav-foot a:hover { border-bottom-color: transparent; }
.footer-bottom {
  border-top: 1px solid #0e1b21;
  padding: 16px calc(var(--gutter) + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.copyright { margin: 0; font-size: 13px; color: var(--dim); }
.back-top { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted); text-decoration: none; font-size: 13px; }
.back-top svg { width: 15px; height: 15px; }
.back-top:hover { color: var(--cyan); }
@media (min-width: 600px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; max-width: 1400px; margin: 0 auto; }
}
@media (min-width: 900px) {
  .footer-main { margin-top: -40px; padding-bottom: 44px; }
}

/* ==========================================================
   10. Full-screen slideshow viewer
   ========================================================== */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s;
}
.viewer.is-open { opacity: 1; visibility: visible; }
.viewer[hidden] { display: none; }

.viewer-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(14px + var(--safe-left));
}
.viewer-count {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
  white-space: nowrap;
}
.viewer-tools { display: flex; align-items: center; gap: 6px; }

.v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #050d11;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, color .15s ease, opacity .15s ease;
}
.v-btn svg { width: 20px; height: 20px; }
.v-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.v-btn:disabled { opacity: .35; cursor: default; border-color: var(--line-2); color: var(--white); }
.v-btn.v-close { margin-left: 4px; }

.viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: zoom-in;
}
.viewer.is-zoomed .viewer-stage { cursor: grab; }
.viewer.is-dragging .viewer-stage { cursor: grabbing; }

.viewer-img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px calc(8px + var(--safe-right)) 6px calc(8px + var(--safe-left));
}
.viewer-img {
  max-width: none;
  max-height: none;
  flex: 0 0 auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: opacity .2s ease;
}
.viewer-img.is-animating { transition: transform .25s ease, opacity .2s ease; }
.viewer.is-loading .viewer-img { opacity: .15; }

.viewer-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid var(--line-2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: none;
}
.viewer.is-loading .viewer-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.v-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 64px;
  margin-top: -32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, .6);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, color .15s ease, opacity .2s ease;
}
.v-nav svg { width: 24px; height: 24px; }
.v-nav:hover { border-color: var(--cyan); color: var(--cyan); }
.v-prev { left: calc(10px + var(--safe-left)); }
.v-next { right: calc(10px + var(--safe-right)); }
.viewer.is-zoomed .v-nav { opacity: 0; pointer-events: none; }

.viewer-bottom {
  flex: 0 0 auto;
  padding: 6px 0 calc(10px + var(--safe-bottom));
}
.viewer-caption {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 0 16px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-hint { display: none; color: var(--cyan); }
@media (hover: none) { .viewer-hint { display: inline; } }

.viewer-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px calc(14px + var(--safe-right)) 4px calc(14px + var(--safe-left));
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  -webkit-overflow-scrolling: touch;
}
.viewer-thumbs::-webkit-scrollbar { height: 6px; }
.viewer-thumbs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.thumb {
  flex: 0 0 auto;
  width: 96px;
  padding: 0;
  border: 2px solid transparent;
  background: #000;
  opacity: .55;
  cursor: pointer;
  scroll-snap-align: center;
  transition: opacity .15s ease, border-color .15s ease;
}
.thumb img { width: 100%; aspect-ratio: 1467 / 825; object-fit: cover; }
.thumb:hover { opacity: .85; }
.thumb.is-current { opacity: 1; border-color: var(--cyan); }
@media (min-width: 900px) {
  .thumb { width: 120px; }
  .viewer-thumbs { justify-content: safe center; }
}

/* Small phones: arrows at the bottom corners so they never cover the slide */
@media (max-width: 599px) {
  .v-nav { top: auto; bottom: 10px; margin-top: 0; width: 44px; height: 44px; }
  .viewer-caption { font-size: 11px; white-space: normal; line-height: 1.5; }
  .thumb { width: 78px; }
}

/* Phones in landscape / short screens: give the slide all the room */
@media (max-height: 500px) {
  .viewer-thumbs { display: none; }
  .viewer-caption { padding-bottom: 0; }
  .viewer-top { padding-top: calc(4px + var(--safe-top)); padding-bottom: 4px; }
  .v-btn { width: 40px; height: 40px; }
  .v-nav { top: 50%; bottom: auto; margin-top: -26px; height: 52px; }
}

/* Viewer: single-image sets (Four Documents) hide the slideshow controls */
.viewer.is-single .v-nav,
.viewer.is-single .viewer-thumbs,
.viewer.is-single .viewer-count { display: none; }
.viewer-caption { color: var(--text); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
