/* ---------- Section rhythm: alternating paper tones so the next section always shows ---------- */
main > section:nth-child(even) { background: var(--paper-2); }
main > section:nth-child(even) .page { --paper-bg: var(--paper); }

/* ---------- Hero ---------- */
.hero {
  /* shorter than the viewport on purpose: a strip of the next section stays visible under the fold */
  min-height: calc(100svh - 4.5rem);
  padding-top: clamp(2rem, 6vh, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 4rem);
  padding-block: clamp(0.5rem, 3vh, 2.5rem);
  position: relative;
}
.hero__copy { display: grid; gap: clamp(1rem, 2.4vh, 1.75rem); justify-items: start; }
.hero__copy > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.8s var(--ease-page), transform 1s var(--ease-lift);
}
.hero__copy > :nth-child(1) { transition-delay: 0s; }
.hero__copy > :nth-child(2) { transition-delay: 0.08s; }
.hero__copy > :nth-child(3) { transition-delay: 0.18s; }
.hero__copy > :nth-child(4) { transition-delay: 0.28s; }
.hero__copy > :nth-child(5) { transition-delay: 0.38s; }
.hero__copy.is-in > *, .no-js .hero__copy > * { opacity: 1; transform: none; }
.hero__cta { display: grid; gap: 0.7rem; justify-items: start; }
.hero__device { display: grid; place-items: center; min-width: 0; overflow-x: clip; overflow-y: visible; overflow-clip-margin: 24px; }

/* scroll cue: sits at the bottom of the first viewport, fades once the reader moves */
.scroll-cue {
  position: absolute; left: 50%; bottom: 0.9rem; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-faint);
  opacity: 0; transition: opacity 0.6s var(--ease-page) 1.6s; pointer-events: none;
}
.hero__copy.is-in ~ .scroll-cue, .no-js .scroll-cue { opacity: 1; }
.is-scrolled .scroll-cue { opacity: 0; transition-delay: 0s; transition-duration: 0.3s; }
.scroll-cue__line { position: relative; width: 1px; height: 2.2rem; background: var(--line); overflow: hidden; }
.scroll-cue__line::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--ink);
  animation: cue-drop 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes cue-drop { 0% { top: -40%; } 60%, 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue__line::after { animation: none; top: 30%; } }
@media (max-width: 860px) { .scroll-cue { display: none; } }
.hero .duo { will-change: transform; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .hero__copy, .hero__cta { justify-items: center; }
  .hero__copy .lede { margin-inline: auto; }
  .proof { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__copy > * { transition: none; }
}

/* ---------- Pinned scenes ---------- */
.scene { position: relative; min-height: 320vh; border-top: 1px solid var(--line); }
.privacy { border-top: 1px solid var(--line); }
.scene--short { min-height: 220vh; }
.scene--long { min-height: 440vh; }
.stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(1rem, 4vw, 4rem); padding-inline: var(--gutter);
  max-width: 1320px; margin-inline: auto;
  transition: opacity 0.2s var(--ease-page);
}
.scene.is-switching .stage { opacity: 0; }
.stage__device { display: grid; place-items: center; min-width: 0; order: 1; }
.stage__caption { display: grid; gap: 1.1rem; order: 0; min-width: 0; }
/* hairline progress under the eyebrow: shows the pinned scene advancing as you scroll */
.stage__caption > .mono::after {
  content: ""; display: block; width: 3.5rem; height: 1px; margin-top: 0.7rem;
  background: linear-gradient(90deg, var(--ink-soft) calc(var(--p, 0) * 100%), var(--line) 0);
}
@media (max-width: 860px) { .stage__caption > .mono::after { margin-inline: auto; } }
.stage__caption .h-section { display: grid; }
.stage__caption .cap {
  grid-area: 1 / 1; display: block;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s var(--ease-page), transform 0.6s var(--ease-lift);
}
.stage__caption .cap.is-on { opacity: 1; transform: none; }
.no-js .stage__caption .cap[data-at="1"] { opacity: 1; transform: none; }
.scene--flip .stage__device { order: 0; }
.scene--flip .stage__caption { order: 1; }
.stage .folio { position: absolute; top: 50%; }
.stage .folio--left { left: calc(var(--gutter) * 0.35); }
.stage .folio--right { right: calc(var(--gutter) * 0.35); }

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; padding-block: 4svh 2svh; gap: 1rem; }
  .stage__caption { order: 0 !important; text-align: center; justify-items: center; gap: 0.7rem; }
  .stage__device { order: 1 !important; align-self: center; }
  .stage__caption .lede { margin-inline: auto; }
}

/* ---------- Scene 2: photos ---------- */
.photo-grid {
  position: absolute; inset: 12% 10% auto; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; gap: 4%;
}
.photo-wrap {
  aspect-ratio: 1; overflow: hidden; border-radius: 5%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
  opacity: 0; will-change: transform, opacity; transform-origin: 50% 50%;
}
.photo { width: 100%; height: 100%; display: block; }
.pin {
  position: absolute; left: 50%; top: 50%; width: 15%; opacity: 0;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

/* ---------- Scene 3: hand it across the table ---------- */
#s-show { --half-w: min(40vw, 32vh, 250px); }
.stage--table { grid-template-columns: 1fr; grid-template-rows: 1fr auto; align-items: stretch; gap: 0; padding-block: 3svh 5svh; }
.stage--table .stage__caption { order: 1; text-align: center; justify-items: center; }
.stage--table .stage__caption .lede { margin-inline: auto; }
.table { position: relative; order: 0; min-height: 0; }
.table-device {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  will-change: transform; z-index: 2;
}
.table-device .duo { --lift: 0; }
.table-device .duo__shadow { transform: scaleX(calc(0.5 + var(--fold) / 360)) scale(calc(1 + var(--lift) * 0.12)); opacity: calc(1 - var(--lift) * 0.45); filter: blur(calc(8px + var(--lift) * 10px)); }
.hand {
  position: absolute; left: 50%; top: 50%; width: calc(var(--half-w) * 1.35);
  transform: translate(-50%, -50%);
  color: var(--ink-soft); opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.hand--give { z-index: 1; }
.hand--thumb { z-index: 3; }
.hand--take { z-index: 1; }
.hand--take-thumb { z-index: 3; }
.hand path { vector-effect: non-scaling-stroke; }
.hand--give, .hand--thumb { -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 96%); mask-image: linear-gradient(to bottom, #000 62%, transparent 96%); }
.hand--take, .hand--take-thumb { -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 96%); mask-image: linear-gradient(to bottom, #000 62%, transparent 96%); }
.show { background: #000; overflow: hidden; }
.show .photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.show__inner { position: absolute; inset: 0; }
.show__stamp { position: absolute; right: 7%; bottom: 9%; width: 44%; transform: rotate(-8deg); opacity: .92; }
.show__stamp .stamp-svg { mix-blend-mode: normal; color: #fff !important; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.show__caption {
  position: absolute; left: 8%; right: 8%; top: 8%; margin: 0; color: #fff;
  font-family: var(--font-mono); font-size: calc(var(--half-w) * 0.042); letter-spacing: 0.22em; text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
@media (max-width: 600px) { .hand { display: none; } }

/* ---------- Scene 4: tap a stamp ---------- */
.context {
  position: absolute; inset: 9% 14% 10%; z-index: 3; opacity: 0;
  display: flex; flex-direction: column; gap: 5%;
}
.context h3 {
  font-family: var(--font-serif); font-size: calc(var(--half-w) * 0.15); line-height: 1; letter-spacing: -0.02em; margin: 0;
  font-weight: 460; font-variation-settings: "opsz" 96, "SOFT" 30, "WONK" 0;
}
.context .meta { font-family: var(--font-mono); font-size: calc(var(--half-w) * 0.03); letter-spacing: 0.18em; color: var(--ink-faint); text-transform: uppercase; }
.map { flex: 1; width: 100%; min-height: 0; }
.days { display: flex; gap: 3.5%; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.days li {
  font-family: var(--font-mono); font-size: calc(var(--half-w) * 0.032); letter-spacing: 0.12em;
  padding: 0.35em 0.6em; border: 1px solid var(--line); border-radius: 999px; opacity: 0; will-change: transform, opacity;
}
.days li:first-child { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.gallery { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gallery__hero {
  position: absolute; inset: 0; transform-origin: 0 0; opacity: 0; overflow: hidden;
  will-change: transform, opacity, clip-path;
}
.gallery__hero .photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.gallery__grid {
  position: absolute; left: 7%; right: 7%; top: 49%; bottom: 7%;
  display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 4%;
}
.gallery__grid .photo-wrap { aspect-ratio: auto; border-radius: 4%; }

/* ---------- Scene 5: postcard ---------- */
.postcard {
  position: relative; width: min(78vw, 32vh * 1.5, 560px); aspect-ratio: 3 / 2;
  transform-style: preserve-3d; will-change: transform;
}
.postcard__face {
  position: absolute; inset: 0; overflow: hidden; border-radius: 4px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper); box-shadow: 0 30px 60px -30px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.06);
}
.postcard__face--front .photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.postcard__face--front .stamp { width: 34%; right: 5%; bottom: 7%; left: auto; opacity: 1; }
.postcard__face--front .stamp .stamp-svg { mix-blend-mode: normal; color: #fff !important; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.postcard__face--back {
  transform: rotateY(180deg); background: #f7f2e8; color: #2a2722;
  display: grid; grid-template-columns: 1.1fr 1px 1fr; gap: 5%; padding: 6% 6% 7%;
}
.postcard__face--back::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .52 0 0 0 0 .47 0 0 0 0 .40 0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}
.postcard__msg {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-variation-settings: "opsz" 14, "SOFT" 80, "WONK" 1;
  font-size: clamp(0.9rem, 2.3vw, 1.35rem); line-height: 1.35; color: #2f3a60; align-self: start; padding-top: 4%;
}
.postcard__divider { background: rgba(42,39,34,.25); }
.postcard__addr { display: grid; align-content: end; gap: 0.9em; padding-bottom: 2%; }
.postcard__addr span { display: block; border-bottom: 1px solid rgba(42,39,34,.3); padding-bottom: 0.25em; font-family: var(--font-serif); font-style: italic; font-size: clamp(0.75rem, 1.7vw, 1.05rem); color: #2f3a60; font-variation-settings: "opsz" 14, "SOFT" 80, "WONK" 1; }
.postcard__corner {
  position: absolute; top: 6%; right: 6%; width: 13%; aspect-ratio: 4 / 5;
  border: 1px dashed rgba(42,39,34,.45); display: grid; place-items: center; color: var(--red);
}
.postcard__corner svg { width: 60%; }
.postcard__mark {
  position: absolute; top: 5%; right: 22%; width: 22%; color: var(--red); opacity: .8; transform: rotate(-12deg);
}

/* ---------- Privacy + footer ---------- */
.privacy {
  min-height: 70svh; display: grid; align-content: center; justify-items: center; text-align: center; gap: 1.2rem;
  padding-block: clamp(4rem, 12vh, 9rem); position: relative;
}
.privacy .lede { margin-inline: auto; max-width: 52ch; }
.privacy .proof { justify-content: center; }
.reveal > * { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-page), transform .9s var(--ease-lift); }
.reveal > :nth-child(2) { transition-delay: .08s; } .reveal > :nth-child(3) { transition-delay: .16s; } .reveal > :nth-child(4) { transition-delay: .24s; }
.reveal.is-in > *, .no-js .reveal > * { opacity: 1; transform: none; }
.foot { padding-block: clamp(3rem, 8vh, 6rem) 2rem; display: grid; gap: 2.5rem; }
.foot__cta { display: grid; gap: 1.2rem; justify-items: center; text-align: center; padding-bottom: 1.5rem; }
.foot__meta { display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; justify-content: space-between; }
.foot__meta a { text-decoration: none; border-bottom: 1px solid var(--line); }
.foot__meta a:hover { border-color: var(--ink-soft); }
@media (max-width: 600px) { .foot__meta { justify-content: center; text-align: center; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .stamp.is-thunk { animation: none; opacity: 1; }
  .page.is-shaking { animation: none; }
  .hero__copy > *, .reveal > * { transition: none; }
  .stage__caption .cap { transition: opacity .3s var(--ease-page); transform: none; }
}
.reduce-motion .stamp.is-thunk { animation: none; opacity: 1; }
.reduce-motion .page.is-shaking { animation: none; }
.reduce-motion .duo.is-idle .duo__breathe { animation: none; }
.reduce-motion .stage__caption .cap { transition: opacity .3s var(--ease-page); transform: none; }
/* No JavaScript: the copy carries every scene; captions show their end state */
.no-js .stage__device:empty { display: none; }

/* ---------- Country picker (scene 1) ---------- */
.picker { display: grid; gap: 0.8rem; margin-top: 0.6rem; width: 100%; max-width: 32rem; min-width: 0; }
.picker__label { margin: 0; color: var(--ink-faint); }
.picker__label span { color: var(--ink); }
.picker__rail {
  display: flex; gap: 0.55rem; overflow-x: auto; scroll-behavior: smooth; min-width: 0; max-width: 100%;
  padding: 0.35rem 0.2rem 0.6rem; margin: -0.35rem -0.2rem -0.6rem;
  scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent);
}
.picker__rail::-webkit-scrollbar { display: none; }
.chip {
  flex: none; width: 3rem; height: 2.1rem; padding: 0; border: 0; border-radius: 0.3rem;
  background: none; cursor: pointer; scroll-snap-align: center;
  transition: transform 0.35s var(--ease-lift), box-shadow 0.35s var(--ease-page), opacity 0.35s var(--ease-page);
  opacity: 0.6; box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 1px 3px rgba(0,0,0,.14); overflow: hidden;
}
.chip:hover { opacity: 0.9; transform: translateY(-2px); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.chip.is-on {
  opacity: 1; transform: translateY(-2px);
  box-shadow: 0 0 0 1.5px var(--foil-2, #cbac61), 0 0 0 3.5px color-mix(in srgb, var(--foil-2, #cbac61) 22%, transparent), 0 3px 10px rgba(0,0,0,.18);
}
.chip__flag, .chip .flag { display: block; width: 100%; height: 100%; border-radius: inherit; }
.chip .flag { object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .chip, .picker__rail { transition: none; scroll-behavior: auto; } }
@media (max-width: 860px) { .picker { justify-items: center; max-width: 100%; } }
