/* Angela, Twenty-Six. Page styles on top of the scrollcraft floor.
   Palette is lifted from her own photographs: shikara vermilion, Andaman
   jungle green, bone, and candle flame. */

:root {
  --green:   #0E2A21;
  --green-2: #16392D;
  --night:   #08150F;
  --bone:    #F2EADB;
  --bone-2:  #E6DCC8;
  --verm:    #E2462B;
  --flame:   #F7C548;
  --ink:     #1B120D;
  --ink-soft:#5B4A3E;

  --sc-canvas: var(--green);
  --sc-surface: var(--green-2);
  --sc-ink: var(--bone);
  --sc-ink-soft: #B9C2B4;
  --sc-accent: var(--flame);
  --sc-accent-ink: var(--ink);
  --sc-font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --sc-font-text: "Newsreader", Georgia, "Times New Roman", serif;
  --sc-shadow-color: 150 45% 4%;

  --rail-h: 64px;
  --px: 0; --py: 0;
}

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.locked { overflow: hidden; }
em { font-style: italic; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--sc-font-display); font-weight: 600; font-stretch: 90%;
  font-size: var(--sc-t-sm); letter-spacing: 0.01em;
  background: var(--flame); color: var(--ink);
  padding: 0.85em 1.5em; border-radius: 999px; white-space: nowrap;
  box-shadow: var(--sc-e1);
  transition: transform 140ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out);
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #FFD76A; } }
.btn--ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--bone) 40%, transparent); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { background: color-mix(in oklab, var(--bone) 10%, transparent); } }
.btn--big { font-size: var(--sc-t-lg); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ================================================================ INTRO */
.intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--green); color: var(--bone);
  overflow-y: auto;
  padding: clamp(1.25rem, 5vw, 5rem);
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  transition: opacity 700ms var(--sc-ease-out), visibility 0s linear 700ms;
}
.intro.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro { display: flex; flex-direction: column; }
.intro__step {
  font-family: var(--sc-font-display); font-size: var(--sc-t-xs); font-weight: 600;
  letter-spacing: var(--sc-track-wide); text-transform: uppercase; color: var(--flame);
  margin: 0 0 clamp(2rem, 6vh, 4rem); width: 100%; max-width: 72rem; margin-inline: auto;
}
.step { display: none; width: 100%; max-width: 72rem; margin-block: auto; margin-inline: auto; padding-bottom: 6vh; }
.step.is-active { display: block; animation: stepIn 520ms var(--sc-ease-out); }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } }
.intro__kicker { margin: 0 0 var(--sc-3); color: var(--sc-ink-soft); font-style: italic; font-size: var(--sc-t-lg); }
.intro__title {
  font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(3rem, 1.2rem + 7vw, 7.5rem); line-height: 0.9; letter-spacing: -0.03em;
  margin: 0 0 var(--sc-7); text-wrap: balance;
}
.intro__title--sm { font-size: clamp(2.4rem, 1rem + 5vw, 5.5rem); }
.intro__title em { font-family: var(--sc-font-text); font-weight: 400; font-stretch: normal; letter-spacing: -0.02em; color: var(--flame); }
.intro__msg { min-height: 1.6em; margin: var(--sc-4) 0 0; font-style: italic; font-size: var(--sc-t-lg); color: var(--flame); }

.gate label { display: block; font-size: var(--sc-t-xl); margin-bottom: var(--sc-4); }
.gate__row { display: flex; gap: var(--sc-3); flex-wrap: wrap; max-width: 36rem; }
.gate__row input {
  flex: 1 1 14rem; min-width: 0;
  background: transparent; border: 0; border-bottom: 2px solid color-mix(in oklab, var(--bone) 45%, transparent);
  padding: 0.4em 0; font-size: var(--sc-t-xl); color: var(--bone); border-radius: 0;
}
.gate__row input:focus { outline: none; border-bottom-color: var(--flame); }
.gate__row input::placeholder { color: color-mix(in oklab, var(--bone) 40%, transparent); font-style: italic; }
.shake { animation: shake 420ms var(--sc-ease-out); }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

.captcha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: min(34rem, 52svh); }
.tile {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; overflow: hidden;
  background: var(--green-2); border-radius: 2px;
  transition: transform 160ms var(--sc-ease-out);
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .emoji { font-size: clamp(2.2rem, 8vw, 3.4rem); display: grid; place-items: center; height: 100%; }
.tile.is-sel { transform: scale(0.9); box-shadow: 0 0 0 3px var(--flame); }
.tile.is-sel::after {
  content: "✓"; position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--flame); color: var(--ink); font: 700 14px/24px var(--sc-font-display); text-align: center;
}
.captcha__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sc-4); max-width: min(34rem, 100%); margin-top: var(--sc-4); flex-wrap: wrap; }
.captcha__foot .intro__msg { margin: 0; flex: 1 1 12rem; }

.bar { height: 10px; background: var(--green-2); border-radius: 999px; overflow: hidden; max-width: 40rem; }
#barFill { height: 100%; width: 100%; background: var(--flame); transform-origin: left; transform: scaleX(0); transition: transform 1100ms var(--sc-ease-out); }
.bar__meta { display: flex; justify-content: space-between; gap: 1rem; max-width: 40rem; margin: var(--sc-3) 0 var(--sc-6); font-size: var(--sc-t-lg); font-style: italic; }
#barPct { font-family: var(--sc-font-display); font-style: normal; font-variant-numeric: tabular-nums; color: var(--flame); }

/* the gift arrives only once the puppy question is answered */
#giftReveal.is-arriving { animation: giftIn 620ms var(--sc-ease-out) both; }
#giftReveal.is-arriving .gift { animation: giftDrop 760ms cubic-bezier(.22,1.2,.36,1) both 120ms; }
@keyframes giftIn { from { opacity: 0; } }
@keyframes giftDrop {
  0% { opacity: 0; transform: translateY(-38px) scale(0.86) rotate(-4deg); }
  60% { opacity: 1; transform: translateY(6px) scale(1.04) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #giftReveal.is-arriving, #giftReveal.is-arriving .gift { animation: none; }
}
.gift { position: relative; width: 170px; height: 170px; margin: var(--sc-6) 0 var(--sc-5); }
.gift__box { position: absolute; left: 10px; right: 10px; bottom: 0; height: 110px; background: var(--verm); border-radius: 3px; box-shadow: var(--sc-e2); }
.gift__box::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--flame); }
.gift__lid { position: absolute; left: 0; right: 0; top: 34px; height: 34px; background: #C93A21; border-radius: 3px; z-index: 1; transition: transform 700ms var(--sc-ease-out); transform-origin: 20% 100%; }
.gift__lid::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--flame); }
.gift__lid::after { content: ""; position: absolute; left: 50%; top: -28px; width: 56px; height: 30px; margin-left: -28px; border: 7px solid var(--flame); border-bottom: 0; border-radius: 50% 50% 0 0; }
.gift.is-open .gift__lid { transform: translate(-30px, -70px) rotate(-24deg); }
.gift__zone { min-height: 90px; display: flex; align-items: center; }
#openBtn { transition: transform 260ms var(--sc-ease-out), background-color 160ms; }

/* ================================================================= RAIL */
.rail {
  position: fixed; z-index: 60; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  translate: -50% 0;
  padding: 10px 16px 9px; border-radius: 999px;
  background: color-mix(in oklab, var(--night) 88%, transparent);
  box-shadow: var(--sc-e2), inset 0 1px 0 color-mix(in oklab, var(--bone) 10%, transparent);
  transition: opacity 400ms var(--sc-ease-out), translate 400ms var(--sc-ease-out);
}
.rail.is-hidden { opacity: 0; translate: -50% 24px; pointer-events: none; }
.rail__row { display: flex; align-items: flex-end; gap: 5px; }
.rail__candle {
  position: relative; width: 7px; height: 30px; padding: 0; border: 0; cursor: pointer;
  background: transparent;
}
.rail__candle::before { /* wax */
  content: ""; position: absolute; left: 1px; right: 1px; bottom: 0; height: 17px; border-radius: 1px;
  background: color-mix(in oklab, var(--bone) 34%, transparent);
  transition: background-color 300ms var(--sc-ease-out);
}
.rail__candle::after { /* flame */
  content: ""; position: absolute; left: 50%; bottom: 19px; width: 6px; height: 9px; margin-left: -3px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 70%, #FFF3C4 0 28%, var(--flame) 45%, #F08A2C 100%);
  transform: scale(0); transform-origin: 50% 100%;
  transition: transform 260ms var(--sc-ease-out);
}
.rail__candle.is-lit::before { background: var(--bone); }
.rail__candle.is-lit::after { transform: scale(1); animation: flicker 1.9s ease-in-out infinite; animation-delay: var(--d, 0s); }
.rail__candle:focus-visible { outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .rail__candle:hover::before { background: var(--flame); } }
.rail__tip {
  position: absolute; bottom: calc(100% + 8px); left: var(--tip-x, 50%); translate: -50% 0;
  margin: 0; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--bone); color: var(--ink);
  font: 600 var(--sc-t-xs)/1.3 var(--sc-font-display);
  opacity: 0; transition: opacity 140ms var(--sc-ease-out); pointer-events: none;
}
.rail__tip.is-on { opacity: 1; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(0.92, 1.06) rotate(-3deg); }
  60% { transform: scale(1.05, 0.95) rotate(2deg); }
}

/* ================================================================ COVER */
/* The left column is a real grid column (date, name, 26), so the three can
   never collide at any window size. Only the figure is out of flow. */
.cover__stage {
  background: var(--verm); color: var(--bone); isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: start;
  padding: 6svh var(--sc-gutter) 0;
}
.cover__meta {
  grid-row: 1; z-index: 4; margin: 0; max-width: 21rem; color: var(--ink);
  opacity: calc(1 - var(--sc-p, 0) * 2.2);
}
.cover__date { margin: 0 0 var(--sc-2); font: 700 var(--sc-t-sm)/1 var(--sc-font-display); letter-spacing: 0.14em; }
.cover__line { margin: 0; font-size: var(--sc-t-lg); line-height: 1.15; font-style: italic; color: var(--bone); text-wrap: balance; }
.cover__title {
  grid-row: 2; align-self: center; z-index: 1; margin: 0;
  font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: min(24vw, 44svh); line-height: 0.82; letter-spacing: -0.045em;
  text-transform: uppercase; color: var(--bone);
  transform: translate3d(calc(var(--px) * -8px), calc(var(--sc-p, 0) * -16svh), 0) scale(calc(1 - var(--sc-p, 0) * 0.05));
  transform-origin: 0% 50%;
  will-change: transform;
}
.cover__figure {
  position: absolute; z-index: 2; left: var(--fig-x, 78%); bottom: -8svh; height: min(96svh, 69vw);
  transform-origin: 50% 100%;
  transform: translate3d(calc(var(--fig-shift, -50%) + var(--px) * 12px), calc(var(--sc-p, 0) * -5svh), 0) scale(calc(1 + var(--sc-p, 0) * 0.12));
  will-change: transform;
}
.cover__figure img { height: 100%; width: auto; max-width: none; filter: drop-shadow(0 30px 40px rgb(60 10 0 / 0.35)); }
.cover__num {
  grid-row: 3; z-index: 3; margin: 0 0 -0.07em -0.06em;
  font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: min(24vw, 34svh); line-height: 0.8; letter-spacing: -0.06em; color: var(--green);
  transform: translate3d(calc(var(--px) * 22px), calc(var(--sc-p, 0) * -42svh), 0);
  will-change: transform;
}

/* =============================================================== LETTER */
.letter-room { background: var(--green); color: var(--bone); padding-bottom: clamp(6rem, 22vh, 14rem); position: relative; z-index: 2; }
.hush { min-height: 78svh; display: grid; place-items: center; padding-inline: var(--sc-gutter); }
.hush p { margin: 0; font-style: italic; font-size: var(--sc-t-lg); color: var(--sc-ink-soft); }
.letter {
  width: min(100% - 2 * var(--sc-gutter), 50rem); margin-inline: auto;
  font-family: var(--sc-font-text); font-weight: 350; font-optical-sizing: auto;
  font-size: clamp(1.45rem, 0.9rem + 1.9vw, 2.55rem); line-height: 1.34; letter-spacing: -0.012em;
}
.letter p { margin: 0 0 1.05em; text-wrap: pretty; }
.letter__salute { font-style: italic; font-size: 1.3em; }
.letter__sign { margin-top: 2em !important; font-style: italic; }
.letter__name {
  display: block; margin-top: 0.1em; font-style: normal;
  font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(3.4rem, 1.6rem + 8vw, 8.5rem); line-height: 0.9; letter-spacing: -0.005em; color: var(--flame);
}
.letter .w { transition: opacity 120ms linear; }
.js-ink .letter .w { opacity: 0.16; }

/* =========================================================== COLLECTION */
.collection { position: relative; z-index: 2; }
.collection__stage { background: var(--bone); color: var(--ink); --sc-ink: var(--ink); }
.collection__rail {
  display: flex; align-items: center; gap: clamp(2.5rem, 6vw, 7rem);
  height: 100%; width: max-content;
  padding-inline: var(--sc-gutter) 16vw; padding-bottom: var(--rail-h);
}
.collection__lead { width: min(26rem, 78vw); flex: none; }
.collection__title {
  margin: 0 0 var(--sc-5);
  font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(4rem, 2rem + 8vw, 9rem); line-height: 0.82; letter-spacing: -0.045em; color: var(--verm);
}
.collection__intro { margin: 0; font-size: var(--sc-t-lg); line-height: 1.4; color: var(--ink-soft); max-width: 22rem; }

.work { margin: 0; flex: none; display: flex; flex-direction: column; gap: var(--sc-4); }
.work--high { align-self: flex-start; margin-top: 7svh; }
.work--low { align-self: flex-end; margin-bottom: 4svh; }
.work__frame {
  display: block; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: var(--bone-2);
  border-radius: 2px; box-shadow: var(--sc-e3);
}
.work__frame img { height: 100%; width: auto; max-width: none; transform: translateX(var(--shift, 0)) scale(1.12); will-change: transform; }
.work--tall .work__frame { height: 60svh; aspect-ratio: 2 / 3; }
.work--mid .work__frame { height: 50svh; aspect-ratio: 2 / 3; }
.work--wide .work__frame { height: 44svh; aspect-ratio: 3 / 2; }
.work__pair { display: flex; gap: var(--sc-4); align-items: flex-end; }
.work__pair .work__frame { height: 34svh; aspect-ratio: 16 / 9; }
.work__pair .work__frame:last-child { height: 26svh; }
.work__frame img { width: 100%; height: 100%; object-fit: cover; }
.label { display: grid; gap: 2px; max-width: 19rem; }
.label__no { font: 700 var(--sc-t-xs)/1.4 var(--sc-font-display); letter-spacing: var(--sc-track-wide); color: var(--verm); text-transform: uppercase; }
.label__title { font: 700 var(--sc-t-lg)/1.1 var(--sc-font-display); font-stretch: 85%; letter-spacing: -0.01em; }
.label__place { font-style: italic; font-size: var(--sc-t-base); }
.label__medium { font-size: var(--sc-t-sm); line-height: 1.45; color: var(--ink-soft); }
.collection__end { width: min(22rem, 70vw); flex: none; }
.collection__end-big { margin: 0 0 var(--sc-3); font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%; font-size: var(--sc-t-3xl); line-height: 0.9; letter-spacing: -0.035em; }
.collection__end-small { margin: 0; font-style: italic; color: var(--ink-soft); }

/* ========================================================== FIELD NOTES */
.notes { position: relative; z-index: 2; }
.note {
  position: relative; overflow: clip; isolation: isolate;
  min-height: 66svh; display: grid; align-items: center;
  padding: clamp(4rem, 10vh, 8rem) var(--sc-gutter) 0;
}
.note--verm  { background: var(--verm);  color: var(--bone); --obs: var(--ink); }
.note--green { background: var(--green); color: var(--bone); --obs: var(--flame); }
.note--bone  { background: var(--bone);  color: var(--ink);  --obs: var(--verm); }
.note--flame { background: var(--flame); color: var(--ink);  --obs: var(--ink); }
.note__copy { position: relative; z-index: 2; max-width: 8.6em; font-size: clamp(3rem, 1rem + 6.4vw, 8.4rem); padding-bottom: clamp(4rem, 12vh, 9rem); }
.note--right .note__copy { justify-self: end; text-align: right; }
.note__heading {
  margin: 0 0 var(--sc-5); font: 700 var(--sc-t-sm)/1 var(--sc-font-display);
  letter-spacing: var(--sc-track-wide); text-transform: uppercase; color: var(--obs);
}
.note__text {
  margin: 0; font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: 1em; line-height: 0.9; letter-spacing: -0.035em; text-wrap: balance;
}
.note__obs { margin: var(--sc-5) 0 0; font-size: var(--sc-t-lg); font-style: italic; color: var(--obs); }
.note__cut { position: absolute; z-index: 1; bottom: -3rem; height: 98%; pointer-events: none; }
.note__cut img { height: 100%; width: auto; max-width: none; }
.note--left .note__cut { right: 5vw; }
.note--right .note__cut { left: 5vw; }
.note--small-cut .note__cut { height: 78%; right: 16vw; }
.note--wide-cut .note__cut { height: 80%; left: 2vw; }
/* the verm grounds carry bone copy over the figure, so the copy sits above it */
.note--florals { align-items: start; }
.note--florals .note__copy { padding-bottom: var(--sc-7); }
.swatches { list-style: none; margin: 0; padding: 0 0 clamp(4rem, 10vh, 7rem); display: flex; gap: clamp(1.5rem, 5vw, 5rem); flex-wrap: wrap; }
.swatch { display: grid; gap: var(--sc-3); justify-items: start; }
.swatch__disc { display: block; width: clamp(8rem, 16vw, 15rem); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: var(--sc-e2); }
.swatch__disc img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.6); }
.swatch--a img { object-position: 55% 72%; transform-origin: 55% 72%; }
.swatch--b img { object-position: 52% 82%; transform-origin: 52% 82%; }
.swatch--c img { object-position: 60% 30%; transform-origin: 60% 30%; }
.swatch__cap { font-style: italic; font-size: var(--sc-t-base); }

/* ================================================================ SWING */
.swing { position: relative; z-index: 2; }
.swing__stage {
  background: var(--green); color: var(--bone);
  --e: clamp(0, calc(var(--sc-p, 0) / 0.62), 1);
  --k: calc(1 - var(--e));
  --arch-w: 34svh; --arch-x: 66vw;
}
.swing__media {
  position: absolute; inset: 0;
  clip-path: inset(
    calc(var(--k) * 14svh)
    calc(var(--k) * (100vw - var(--arch-x) - var(--arch-w) / 2))
    calc(var(--k) * 16svh)
    calc(var(--k) * (var(--arch-x) - var(--arch-w) / 2))
    round calc(var(--k) * var(--arch-w) / 2) calc(var(--k) * var(--arch-w) / 2) calc(var(--k) * 4px) calc(var(--k) * 4px)
  );
}
.swing__media video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; transform: scale(calc(1.18 - var(--e) * 0.18)); }
.swing__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(8 21 15 / 0.9) 0%, rgb(8 21 15 / 0.8) 30%, rgb(8 21 15 / 0.35) 48%, transparent 62%);
  opacity: clamp(0, calc(var(--e) * 1.6), 1);
}
.swing__line {
  position: absolute; left: var(--sc-gutter); margin: 0; max-width: 6.2em;
  font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(3rem, 1rem + 6vw, 8rem); line-height: 0.88; letter-spacing: -0.04em; text-wrap: balance;
}
.swing__line--one { top: 14svh; }
.swing__line--two { top: auto; bottom: calc(var(--rail-h) + 9svh); color: var(--flame); }

/* =============================================================== WISHES */
.wishes { position: relative; z-index: 2; background: var(--bone); color: var(--ink); padding: var(--sc-section) var(--sc-gutter); }
.wishes__wrap { max-width: var(--sc-maxw); margin-inline: auto; }
.wishes__head { display: grid; gap: var(--sc-5); margin-bottom: var(--sc-9); }
.wishes__title {
  margin: 0; font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(3.4rem, 1.6rem + 7vw, 9rem); line-height: 0.82; letter-spacing: -0.045em; color: var(--verm);
}
.wishes__intro { margin: 0; max-width: 26rem; font-size: var(--sc-t-lg); line-height: 1.4; color: var(--ink-soft); }
@media (min-width: 900px) {
  .wishes__head { grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: var(--sc-8); }
  .wishes__intro { padding-bottom: 0.6rem; }
}

.wishes__grid { columns: 3 19rem; column-gap: clamp(1.5rem, 3vw, 3rem); }
.wish {
  break-inside: avoid; display: grid; gap: var(--sc-3); width: 100%;
  margin: 0 0 clamp(1.5rem, 3vw, 3rem); padding: 0; border: 0; text-align: left;
  background: transparent; color: inherit; font: inherit;
}
.wish--has-media { cursor: zoom-in; }
.wish__media { display: block; overflow: hidden; border-radius: 2px; background: var(--bone-2); box-shadow: var(--sc-e2); }
/* the one video wish is a tiny 196px clip; hold it near its real size rather than upscaling it */
.wish__media:has(video) { max-width: 260px; }
.viewer__video { max-height: min(60vh, 420px); }
.wish__media :is(img, video) { width: 100%; height: auto; max-height: clamp(260px, 34vh, 400px); object-fit: cover; display: block; }
@media (hover: hover) and (pointer: fine) {
  .wish__media :is(img, video) { transition: transform 600ms var(--sc-ease-out); }
  .wish--has-media:hover .wish__media :is(img, video) { transform: scale(1.03); }
}
.wish__text {
  display: block; font-family: var(--sc-font-text); font-size: var(--sc-t-lg);
  line-height: 1.42; text-wrap: pretty; overflow-wrap: break-word;
}
.wish__from {
  display: block; font: 700 var(--sc-t-xs)/1.3 var(--sc-font-display);
  letter-spacing: var(--sc-track-wide); text-transform: uppercase; color: var(--verm);
}
.viewer__video { max-height: calc(100dvh - 12rem); width: auto; border-radius: 2px; box-shadow: var(--sc-e3); }
.label--viewer .wish__text { margin-top: var(--sc-2); font-size: var(--sc-t-base); color: var(--ink-soft); }

/* =============================================================== FINALE */
.finale { position: relative; z-index: 2; }
.finale__stage {
  background: var(--night); color: var(--bone);
  display: grid; grid-auto-rows: auto; justify-items: center; align-content: center;
  row-gap: clamp(1.5rem, 4svh, 3.5rem);
  padding: 8svh var(--sc-gutter) calc(var(--rail-h) + 4svh); text-align: center;
  --lit: 1;
}
.finale__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 45% at 50% 64%, rgb(247 197 72 / 0.26), rgb(226 70 43 / 0.08) 45%, transparent 72%);
  opacity: var(--lit); transition: opacity 900ms var(--sc-ease-out);
}
.finale__copy { position: relative; }
.finale__title {
  margin: 0; font-family: var(--sc-font-display); font-weight: 800; font-stretch: 75%;
  font-size: clamp(3rem, 1rem + 6vw, 7.5rem); line-height: 0.88; letter-spacing: -0.04em; text-wrap: balance;
}
.finale__title.is-done { color: var(--flame); }
.finale__msg { margin: var(--sc-4) auto 0; font-size: var(--sc-t-xl); font-style: italic; color: var(--sc-ink-soft); max-width: 26em; min-height: 1.4em; }
.cake { position: relative; margin: 0; padding: 0 0 14px; border: 0; background: transparent; cursor: pointer; }
.cake::after { /* the plate line the candles stand on */
  content: ""; position: absolute; left: -4%; right: -4%; bottom: 0; height: 6px; border-radius: 999px; background: var(--verm);
}
.cake__row { display: flex; gap: clamp(8px, 1.4vw, 20px); align-items: flex-end; justify-content: center; flex-wrap: wrap; max-width: 92vw; }
.candle { position: relative; display: block; width: clamp(9px, 1.1vw, 14px); height: clamp(64px, 10svh, 104px); }
.candle__wax {
  position: absolute; inset: 22px 0 0; border-radius: 2px 2px 0 0;
  background: repeating-linear-gradient(-35deg, var(--bone) 0 7px, var(--verm) 7px 11px);
}
.candle__wax::before { content: ""; position: absolute; left: 50%; top: -6px; width: 2px; height: 7px; margin-left: -1px; background: #3A2A20; }
.candle__flame {
  position: absolute; left: 50%; top: 0; width: 12px; height: 19px; margin-left: -6px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #FFF6D6 0 24%, var(--flame) 44%, #F08A2C 100%);
  transform-origin: 50% 100%;
  animation: flicker 1.7s ease-in-out infinite; animation-delay: var(--d, 0s);
  transition: opacity 260ms var(--sc-ease-out), scale 260ms var(--sc-ease-out);
}
.candle.is-out .candle__flame { opacity: 0; scale: 0.2; animation: none; }
.candle__smoke {
  position: absolute; left: 50%; top: 4px; width: 6px; height: 16px; margin-left: -3px; border-radius: 50%;
  background: rgb(242 234 219 / 0.35); opacity: 0; pointer-events: none;
}
.candle.is-out .candle__smoke { animation: smoke 1.6s var(--sc-ease-out) forwards; }
@keyframes smoke { 0% { opacity: 0.6; transform: translateY(0) scale(0.6); } 100% { opacity: 0; transform: translateY(-46px) translateX(6px) scale(1.6); } }
.finale__actions { display: flex; gap: var(--sc-3); flex-wrap: wrap; justify-content: center; }
.finale__after { position: relative; }
.finale__from { margin: 0 0 var(--sc-3); font-size: var(--sc-t-xl); font-style: italic; }
.finale__links { margin: 0; display: flex; gap: var(--sc-5); justify-content: center; flex-wrap: wrap; }
.linkbtn { appearance: none; background: none; border: 0; padding: 0.3em 0; cursor: pointer; color: var(--bone); font-size: var(--sc-t-base); text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { .linkbtn:hover { color: var(--flame); } }

/* A clip the device refused to autoplay says so, instead of looking broken. */
.is-blocked { position: relative; cursor: pointer; }
.is-blocked::after {
  content: "Tap to play";
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  padding: 0.7em 1.2em; border-radius: 999px;
  background: color-mix(in oklab, var(--night) 82%, transparent); color: var(--bone);
  font: 600 var(--sc-t-sm)/1 var(--sc-font-display); letter-spacing: 0.01em;
  box-shadow: var(--sc-e2); pointer-events: none;
}
.swing__media.is-blocked::after { z-index: 3; }

/* =============================================================== VIEWER */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: var(--sc-5);
  border: 0; background: var(--bone); color: var(--ink);
  grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sc-4);
}
.viewer[open] { display: grid; animation: stepIn 300ms var(--sc-ease-out); }
.viewer::backdrop { background: var(--bone); }
.viewer__fig { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sc-4); min-width: 0; }
.viewer__fig img { max-height: calc(100dvh - 12rem); width: auto; box-shadow: var(--sc-e3); border-radius: 2px; }
.label--viewer { text-align: center; justify-items: center; max-width: 30rem; }
.viewer__close { position: absolute; top: var(--sc-4); right: var(--sc-4); }
.viewer__close, .viewer__nav {
  appearance: none; border: 0; background: transparent; cursor: pointer; color: var(--ink);
  font: 700 var(--sc-t-sm)/1 var(--sc-font-display); letter-spacing: var(--sc-track-wide); text-transform: uppercase;
  padding: 0.9em 0.6em;
}
@media (hover: hover) and (pointer: fine) { :is(.viewer__close, .viewer__nav):hover { color: var(--verm); } }

/* =============================================================== MOBILE */
@media (max-width: 760px) {
  :root { --rail-h: 56px; }
  .rail { padding: 8px 12px 7px; }
  .rail__row { gap: 3px; }
  .rail__candle { width: 6px; height: 26px; }

  .cover__stage { grid-template-rows: auto auto 1fr; padding-top: 4svh; justify-items: stretch; }
  .cover__title { grid-row: 2; align-self: start; margin-top: 3svh; font-size: 30vw; text-align: center; transform-origin: 50% 50%; }
  .cover__figure { height: 72svh; bottom: -4svh; --fig-x: 50%; --fig-shift: -46%; }
  .cover__num { font-size: 44vw; }
  .cover__num { position: absolute; grid-row: auto; margin: 0; font-size: 44vw; right: 2vw; bottom: 12svh; }
  .cover__meta { max-width: 14rem; }
  .cover__line { font-size: var(--sc-t-base); }

  .collection__rail { padding-inline: var(--sc-gutter) 30vw; gap: 2.2rem; }
  .work--tall .work__frame { height: 50svh; }
  .work--mid .work__frame { height: 42svh; }
  .work--wide .work__frame { height: 26svh; }
  .work__pair { flex-direction: column; align-items: flex-start; }
  .work__pair .work__frame { height: 22svh; }
  .work__pair .work__frame:last-child { height: 18svh; }
  .work--high { margin-top: 0; align-self: center; }
  .work--low { margin-bottom: 0; align-self: center; }
  .label { max-width: 70vw; }

  .note { min-height: 92svh; align-items: start; padding-top: 12svh; }
  .note__copy, .note--right .note__copy { justify-self: start; text-align: left; font-size: clamp(2.6rem, 11.5vw, 4rem); padding-bottom: 0; }
  .note__cut { height: 52%; bottom: -2rem; }
  .note--left .note__cut, .note--small-cut .note__cut { right: -4vw; left: auto; }
  .note--right .note__cut, .note--wide-cut .note__cut { left: auto; right: -6vw; }
  .note--small-cut .note__cut { height: 50%; right: 10vw; }
  .note--wide-cut .note__cut { height: 46%; }
  .note--florals { min-height: auto; }
  .wishes__grid { columns: 1; }
  .wish { margin-bottom: var(--sc-7); }
  .cake__row { display: grid; grid-template-columns: repeat(13, auto); gap: 18px 9px; }
  .finale__msg { font-size: var(--sc-t-lg); }
  .swatches { padding-top: var(--sc-5); gap: var(--sc-5); }
  .swatch__disc { width: 38vw; }

  .swing__stage { --arch-w: 44vw; --arch-x: 50vw; }
  .swing__media { clip-path: inset(
    calc(var(--k) * 30svh) calc(var(--k) * (50vw - var(--arch-w) / 2)) calc(var(--k) * 22svh) calc(var(--k) * (50vw - var(--arch-w) / 2))
    round calc(var(--k) * var(--arch-w) / 2) calc(var(--k) * var(--arch-w) / 2) calc(var(--k) * 4px) calc(var(--k) * 4px)); }
  .swing__line { font-size: clamp(2.6rem, 12vw, 4rem); }
  .swing__line--one { top: 7svh; translate: none; }
  .swing__line--two { top: auto; bottom: calc(var(--rail-h) + 6svh); translate: none; }
  .swing__scrim { background: linear-gradient(180deg, rgb(8 21 15 / 0.85) 0%, rgb(8 21 15 / 0.5) 22%, transparent 38%, transparent 58%, rgb(8 21 15 / 0.55) 74%, rgb(8 21 15 / 0.88) 100%); }

  .viewer { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; padding: var(--sc-4); }
  .viewer__fig { grid-column: 1 / -1; grid-row: 1; }
  .viewer__fig img { max-height: calc(100dvh - 14rem); }
  .viewer__nav--prev { grid-row: 2; grid-column: 1; justify-self: start; }
  .viewer__nav--next { grid-row: 2; grid-column: 2; justify-self: end; }
}

/* ======================================================= REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  .cover__title, .cover__figure, .cover__num { transform: translate(-0%, 0); }
  .cover__figure { transform: translateX(var(--fig-shift, -50%)); }
  .cover__meta { opacity: 1; }
  .swing__stage { --e: 1; }
  .rail__candle.is-lit::after, .candle__flame { animation: none; }
  .work__frame img { transform: none; }
  .js-ink .letter .w { opacity: 1; }
}
