/* ############################################################
   TWEAK THESE — the two knobs you'll actually want to move
   ############################################################ */
:root {
  /* Hero caption ("THRESHOLD FIGURE" + EXIF): distance from the bottom
     edge of the screen.
        SMALLER number  =  sits LOWER  (closer to the bottom)
        LARGER  number  =  sits HIGHER (lifted up the image)
     Below ~46px it starts to crowd the navigation dots. */
  --exif-bottom: 55px;

  /* Wordmark size. clamp(min, scales-with-width, max) — the middle value
     is what it uses on a normal desktop; the outer two stop it getting
     silly on phones or huge monitors. */
  --wordmark-size: clamp(21px, 2.3vw, 38px);

  /* Hero colour bloom: greyscale → colour, spreading from the centre.
     Longer duration = slower, more cinematic. Delay is the beat of
     black-and-white you see before it starts. */
  --bloom-duration: 5s;
  --bloom-delay: 0.5s;

  /* Contact sheet strip on the Sculptures panel.
     --sheet-bottom must clear --exif-bottom plus the caption's own height
     (~44px), or the strip will sit on top of the caption. */
  --sheet-bottom: 118px;
  --sheet-frame-w: 92px;
  --sheet-gap: 10px;
  --sheet-fade: 0.55s; /* crossfade between plates */
}

/* ============================================================
   Design tokens — single theme
   ============================================================ */
:root {
  --w-bg: #221d1a;
  --w-plate: #17130f;
  --w-ink: #efe7db;
  --w-mute: #a2907c;
  --w-accent: #c79a5b;
  --w-onaccent: #1a1614;
  --w-pink: #ff2d8f; /* bubblegum / riso pink — the family name */

  --w-disp: 'EB Garamond', Georgia, serif;
  --w-lab: 'EB Garamond', Georgia, serif;
  --w-body: 'EB Garamond', Georgia, serif;
  --w-lab-tr: 0.22em;
  --w-lab-size: 10px;

  --w-hair: rgba(239, 231, 219, 0.16);
  --w-rule: rgba(239, 231, 219, 0.3);
  --w-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   Reset & base — page itself never scrolls; #track does
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--w-bg);
}

body {
  font-family: var(--w-body);
  color: var(--w-ink);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--w-accent);
}
img {
  display: block;
  max-width: 100%;
}

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

/* ============================================================
   Ambient wash
   ============================================================ */
#bg-wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      90% 70% at 50% 0%,
      rgba(199, 154, 91, 0.13),
      transparent 62%
    ),
    radial-gradient(60% 60% at 80% 100%, rgba(0, 0, 0, 0.5), transparent 70%);
}

/* ============================================================
   Horizontal track — one viewport per panel, snapped
   ============================================================ */
#track {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

#track::-webkit-scrollbar {
  display: none;
}

.page {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  /* No scroll-snap-stop: it would halt multi-panel dot jumps at every
     panel in between. The wheel handler already paces one step per gesture. */
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  /* bottom padding keeps panel content clear of the wordmark */
  padding: 88px 8vw 124px;
  overflow: hidden;
}

.page-inner {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-inner.narrow {
  max-width: 680px;
}
.page-inner.center {
  align-items: center;
  text-align: center;
}

/* Entrance reveal — set by IntersectionObserver */
.page-inner > * {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.page.is-visible .page-inner > * {
  opacity: 1;
  transform: none;
}
.page.is-visible .page-inner > *:nth-child(2) {
  transition-delay: 0.08s;
}
.page.is-visible .page-inner > *:nth-child(3) {
  transition-delay: 0.16s;
}
.page.is-visible .page-inner > *:nth-child(4) {
  transition-delay: 0.24s;
}
.page.is-visible .page-inner > *:nth-child(5) {
  transition-delay: 0.32s;
}

/* ============================================================
   Photo panels — full-bleed photograph, EXIF centred at the bottom
   Shared by the homepage and any series panel that is pure image.
   ============================================================ */
/* Black ground, not the site brown: these photographs sit on black, so the
   letterbox reads as part of the picture rather than as bars. */
.page-photo {
  padding: 0;
  background: #000;
}

.photo-frame {
  position: absolute;
  inset: 0;
  margin: 0;
}

/* Default is contain — the whole frame stays visible and uncropped at
   every viewport shape. */
.photo-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Opt-in edge-to-edge. Fills the panel with no letterbox, at the cost of
   cropping whichever axis overflows — on a 16:9 screen a 3:2 frame loses
   roughly 16% off the top and bottom. Use only where the composition
   survives it. */
.photo-fill--cover {
  object-fit: cover;
}

/* ── Colour bloom (homepage only) ──────────────────────────────
   The greyscale copy is the base layer. The colour copy above it is
   masked by a soft-edged circle whose size animates 0 → 320%, so colour
   spreads outward from the centre of the frame.
   Tune: --bloom-duration / --bloom-delay at the top of this file. */
.bloom-bw {
  filter: grayscale(1);
}

.bloom-colour {
  -webkit-mask-image: radial-gradient(circle, #000 38%, transparent 72%);
  mask-image: radial-gradient(circle, #000 38%, transparent 72%);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 0% 0%;
  mask-size: 0% 0%;
  animation: colour-bloom var(--bloom-duration) cubic-bezier(0.22, 0.7, 0.2, 1)
    var(--bloom-delay) forwards;
}

@keyframes colour-bloom {
  from {
    -webkit-mask-size: 0% 0%;
    mask-size: 0% 0%;
  }
  to {
    -webkit-mask-size: 320% 320%;
    mask-size: 320% 320%;
  }
}

/* No animation for anyone who asked not to have one — show full colour. */
@media (prefers-reduced-motion: reduce) {
  .bloom-colour {
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.photo-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Bottom only — there is no longer a top nav to protect, and darkening
     the top would needlessly alter the photograph. */
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* Opt-in scrim for panels that carry a series mark and a contact sheet.
   Two of the five plates here are blown-out daylight, so the default
   bottom-only gradient left white text on a white sky.

   The top half is a corner-anchored ellipse rather than a full-width
   band: it sits under the series mark only, so the sky across the rest
   of the frame is left alone. Its centre is pushed off-canvas so what
   shows on the page is the gradient's smooth mid-section — anchored at
   0% 0% the dense core landed in frame and read as a smudge against a
   clear sky. The bottom is deepened because the strips
   and their hairlines need a consistent dark ground to read against —
   at 0.16 alpha the dividers disappeared entirely over daylight. */
.photo-scrim--top {
  background:
    radial-gradient(
      70% 60% at -6% -12%,
      rgba(0, 0, 0, 0.86) 0%,
      rgba(0, 0, 0, 0.66) 26%,
      rgba(0, 0, 0, 0.4) 46%,
      rgba(0, 0, 0, 0.18) 64%,
      rgba(0, 0, 0, 0.06) 80%,
      rgba(0, 0, 0, 0) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 44%,
      rgba(0, 0, 0, 0.5) 72%,
      rgba(0, 0, 0, 0.88) 100%
    );
}

/* A whole-frame veil, for a photograph that sits behind text rather than
   under a caption. Kept deliberately light: the picture is a lit bulb in a
   dark room, so it is nearly all shadow already and only the glass needs
   knocking back. Anything past about 0.4 in the centre puts the filament
   out and leaves a grey bulb hanging in the dark. */
.photo-scrim--veil {
  background:
    radial-gradient(
      52% 52% at 50% 46%,
      rgba(0, 0, 0, 0.38) 0%,
      rgba(0, 0, 0, 0.26) 55%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.2) 0%,
      rgba(0, 0, 0, 0.14) 55%,
      rgba(0, 0, 0, 0.5) 100%
    );
}

/* ── A photograph behind a text panel ─────────────────────────
   .page-photo is for panels that are nothing but a picture; it strips the
   padding. Contact needs its padding and its layout, so it takes the
   photograph as a layer instead. Two things are required: a black ground
   so the site brown never shows through the letterboxing or during decode,
   and a stacking context on the content so the absolutely positioned
   .photo-frame does not paint over it. */
.page--photo-bg {
  background: #000;
}

.page--photo-bg .page-inner {
  position: absolute;
  inset: 0;
  display: block;
  max-width: none;
  z-index: 1;
}

.page--photo-bg .display-lg {
  position: absolute;
  bottom: 20px;
  right: 1vw;
  text-align: right;
  margin: 0;
}

.contact-foot {
  position: absolute;
  bottom: 50px;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(520px, 84vw);
}

/* Combine the centering translateX with the entrance-animation translateY
   so neither clobbers the other. */
.page--photo-bg .page-inner > .contact-foot {
  transform: translateX(-50%) translateY(22px);
}
.page.is-visible .page--photo-bg .page-inner > .contact-foot {
  transform: translateX(-50%) translateY(0);
}

/* The display type is big enough to carry itself. The small uppercase
   lines are not — at phone widths the crop walks the bulb underneath
   them, so they get the same shadow the series marks use. */
.page--photo-bg .copyright,
.page--photo-bg .contact-secondary {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

/* ── Series mark ──────────────────────────────────────────────
   Photo panels had no visible title — the section name existed only in
   a dot tooltip. This gives them the same announcement the text panels
   get, without taking the picture's centre. */
.series-mark {
  position: absolute;
  top: 44px;
  left: 46px;
  z-index: 4;
  max-width: min(46vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
  /* Two shadows: a tight one for edge contrast against pale stone, a wide
     soft one to seat the block over busy detail. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 22px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.page.is-visible .series-mark {
  opacity: 1;
  transform: none;
}

.series-name {
  margin: 0;
  font-family: var(--w-disp);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.005em;
  font-size: clamp(26px, 3.1vw, 50px);
  color: #fff;
}

.series-line {
  margin: 0;
  font-family: var(--w-lab);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
  /* Sits furthest into the scrim's falloff and is the smallest type here,
     so it needs more weight than the usual muted grey to survive a sky. */
  color: rgba(255, 255, 255, 0.82);
}

/* ── Contact sheet ────────────────────────────────────────────
   All plates stay in the DOM stacked on top of each other and cross-
   fade; selecting one never triggers a fetch or a decode flash. */
.plate {
  opacity: 0;
  transition: opacity var(--sheet-fade) ease;
}

.plate[data-active] {
  opacity: 1;
}

/* Both strips stack in one column, so only --sheet-bottom needs tuning. */
.sheets {
  position: absolute;
  left: 50%;
  bottom: var(--sheet-bottom); /* tune at the top of this file */
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.sheet {
  display: flex;
  gap: var(--sheet-gap);
}

/* Row 2 is an index, not a selector. Denser, dimmer, and — critically —
   it does not lift on hover: the lift is row 1's language for "this one
   is now showing behind". Here hover only means "clickable". */
.sheet--open {
  --sheet-frame-w: 52px;
  --sheet-gap: 6px;
}

.sheet--open .sheet-frame {
  opacity: 0.4;
}

.sheet--open .sheet-frame:hover,
.sheet--open .sheet-frame:focus-visible {
  opacity: 1;
  transform: none;
  border-color: var(--w-accent);
}

/* Hairline rule with the label sitting in the gap, so the two strips are
   stated to be different things before anyone has to discover it. */
.sheet-div {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 4px 0 2px;
  font-family: var(--w-lab);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--w-mute);
  white-space: nowrap;
  user-select: none;
}

.sheet-div::before,
.sheet-div::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--w-hair);
}

.sheet-open-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.sheet--open .sheet-frame:hover .sheet-open-glyph,
.sheet--open .sheet-frame:focus-visible .sheet-open-glyph {
  opacity: 1;
}

.sheet-frame {
  position: relative;
  width: var(--sheet-frame-w);
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0.5;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 0.7, 0.2, 1),
    border-color 0.3s ease;
}

.sheet-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-frame:hover,
.sheet-frame:focus-visible,
.sheet-frame[data-active] {
  opacity: 1;
  transform: translateY(-7px);
  border-color: var(--w-pink);
  outline: none;
}

.sheet-num {
  position: absolute;
  top: 3px;
  left: 5px;
  font-family: var(--w-lab);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.photo-exif {
  position: absolute;
  left: 50%;
  bottom: var(--exif-bottom); /* tune at the top of this file */
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: min(92vw, 900px);
  text-align: center;
}

.photo-exif::before {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--w-accent);
}

.exif-title {
  font-family: var(--w-lab);
  font-size: 11px;
  letter-spacing: var(--w-lab-tr);
  text-transform: uppercase;
  color: #fff;
}

.exif-data {
  font-family: var(--w-lab);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
  text-wrap: balance;
}

/* ============================================================
   Typography
   ============================================================ */
/* Visible to screen readers and search engines, not to the eye. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.display-lg {
  margin: 0;
  font-family: var(--w-disp);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1;
  font-size: clamp(38px, 5.6vw, 92px);
}

.lead {
  margin: 0;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--w-mute);
  text-wrap: pretty;
}

.note,
.series-num {
  font-family: var(--w-lab);
  font-size: var(--w-lab-size);
  letter-spacing: var(--w-lab-tr);
  text-transform: uppercase;
}

.note {
  margin: 0;
  color: var(--w-mute);
  opacity: 0.65;
}
.series-num {
  color: var(--w-accent);
}

/* ============================================================
   Contact
   ============================================================ */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.contact-primary,
.contact-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-family: var(--w-lab);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    background 0.25s,
    color 0.25s,
    opacity 0.25s;
}

.contact-primary {
  background: var(--w-accent);
  color: var(--w-onaccent);
}
.contact-primary:hover {
  opacity: 0.85;
  color: var(--w-onaccent);
}

.contact-secondary {
  border: 1px solid var(--w-rule);
}
.contact-secondary:hover {
  background: var(--w-ink);
  color: var(--w-bg);
}

.copyright {
  margin-top: 8px;
  font-family: var(--w-lab);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-mute);
}

/* ============================================================
   Bottom chrome — hint, dots, label, progress
   ============================================================ */
#chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 26px 16px;
  pointer-events: none;
}

/* Equal side rails keep the dots optically centred. Wrappers rather than
   flexing the <a> itself, so the click target stays the width of the text. */
.chrome-side {
  flex: 1 0 0;
  display: flex;
  align-items: flex-end;
}

.chrome-side--right {
  justify-content: flex-end;
}

#logo-link {
  pointer-events: auto;
  align-self: flex-start;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.26em;
  white-space: nowrap;
  line-height: 1;
  font-family: var(--w-disp);
  font-size: var(--wordmark-size);
  letter-spacing: 0.005em;
}

#logo-link:hover {
  color: inherit;
}

.wordmark-given {
  color: var(--w-ink);
}
.wordmark-family {
  color: var(--w-pink);
}

.scroll-hint {
  font-family: var(--w-lab);
  font-size: var(--w-lab-size);
  letter-spacing: var(--w-lab-tr);
  text-transform: uppercase;
  color: var(--w-mute);
  transition: opacity 0.4s ease;
}

/* Nothing further to scroll to on the last panel — don't claim otherwise. */
#chrome.at-end .scroll-hint {
  opacity: 0;
}

#section-dots {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.dot {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--w-mute);
  background: transparent;
  cursor: pointer;
  transition:
    background 0.3s,
    border-color 0.3s,
    transform 0.3s;
}

.dot:hover {
  border-color: var(--w-accent);
  transform: scale(1.35);
}
.dot[data-active] {
  background: var(--w-accent);
  border-color: var(--w-accent);
}

/* The section name now lives here instead of in a permanent corner label —
   it appears on hover, where it is actually wanted. */
.dot::after {
  content: attr(data-label);
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--w-lab);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dot:hover::after {
  opacity: 1;
}

.progress-track {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 2px;
  background: var(--w-hair);
}

#progress-bar {
  height: 100%;
  background: var(--w-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.35s ease;
}

/* ============================================================
   Lightbox
   ============================================================ */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 5vh 6vw;
  background: rgba(8, 6, 5, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.32s ease,
    visibility 0.32s;
}

#lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  transform: scale(0.985);
  transition: transform 0.32s cubic-bezier(0.22, 0.7, 0.2, 1);
}

#lightbox.is-open .lb-figure {
  transform: scale(1);
}

#lb-img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.lb-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.lb-caption::before {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--w-accent);
}

.lb-count {
  position: absolute;
  top: 30px;
  left: 26px;
  font-family: var(--w-lab);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--w-mute);
  user-select: none;
}

.lb-close,
.lb-nav {
  position: absolute;
  background: transparent;
  border: 1px solid var(--w-hair);
  color: var(--w-ink);
  cursor: pointer;
  font-family: var(--w-lab);
  transition:
    border-color 0.25s,
    background 0.25s,
    color 0.25s;
}

.lb-close:hover,
.lb-nav:hover {
  border-color: var(--w-pink);
  background: var(--w-pink);
  color: #16100f;
}

.lb-close {
  top: 22px;
  right: 26px;
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.lb-prev {
  left: 26px;
}
.lb-next {
  right: 26px;
}

@media (max-width: 899px) {
  .lb-nav {
    top: auto;
    bottom: 20px;
    transform: none;
  }
  #lb-img {
    max-height: 64vh;
  }
}

/* ============================================================
   Custom right-click menu
   ============================================================ */
#ctx-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  min-width: 210px;
  padding: 6px;
  background: rgba(20, 16, 14, 0.94);
  border: 1px solid var(--w-hair);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transform-origin: top left;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0.14s;
}

#ctx-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--w-lab);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-ink);
  transition:
    background 0.18s,
    color 0.18s;
}

.ctx-item:hover,
.ctx-item:focus-visible {
  background: var(--w-pink);
  color: #16100f;
  outline: none;
}

.ctx-key {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--w-mute);
}

.ctx-item:hover .ctx-key,
.ctx-item:focus-visible .ctx-key {
  color: rgba(22, 16, 15, 0.6);
}

.ctx-sep {
  height: 1px;
  margin: 5px 12px;
  background: var(--w-hair);
}

/* ============================================================
   Small screens
   ============================================================ */
@media (max-width: 899px) {
  /* Caption sits a little higher on phones — the dots and wordmark are
     proportionally closer to it. Override, don't edit the root value. */
  :root {
    --exif-bottom: 104px;
    --sheet-bottom: 164px;
    --sheet-frame-w: 54px;
    --sheet-gap: 6px;
  }

  .page {
    padding: 64px 22px 118px;
  }

  .series-mark {
    top: 26px;
    left: 22px;
    gap: 7px;
    max-width: 76vw;
  }
  .series-line {
    font-size: 9px;
    letter-spacing: 0.11em;
  }

  /* Ten frames will not sit on one line on a phone. Cap the row at five
     frames wide so it wraps into two tidy rows rather than a ragged one,
     and keep it clearly finer than row 1 above it. */
  .sheet--open {
    --sheet-frame-w: 40px;
    --sheet-gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(var(--sheet-frame-w) * 5 + var(--sheet-gap) * 4);
  }

  .photo-exif {
    width: 88vw;
  }
  .exif-data {
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  /* Wordmark keeps the corner; the hint yields the space it needs. */
  .scroll-hint {
    display: none;
  }

  #chrome {
    align-items: flex-end;
    padding-bottom: 18px;
  }
  #section-dots {
    padding-bottom: 4px;
  }

  /* Contact panel: move the title to top-left so it doesn't sit
     on top of the buttons at the bottom. Scale it down so
     "End of the roll." stays on one line on a narrow screen. */
  .page--photo-bg .display-lg {
    top: 44px;
    bottom: auto;
    left: 22px;
    right: auto;
    text-align: left;
    font-size: clamp(26px, 6.5vw, 38px);
  }

  /* Contact foot: wider and lifted further above the chrome bar */
  .contact-foot {
    bottom: 90px;
    width: 88vw;
  }

  /* Row 1 thumbnails: taller tap target (44 px minimum).
     The width stays at --sheet-frame-w; the extra height is
     hidden overflow, not visible padding, so thumbnails look
     the same but fingers can land more reliably. */
  .sheet:not(.sheet--open) .sheet-frame {
    min-height: 44px;
  }

  /* Row 2 thumbnails: always show the ⤢ glyph — no hover on touch,
     so users need the visual cue that these frames open full size. */
  .sheet--open .sheet-frame .sheet-open-glyph {
    opacity: 0.7;
  }
}
