/* ═════════ Mobile-first polish (phones are the main audience) ═════════ */
:root { --gutter: max(16px, env(safe-area-inset-left, 0px)); }
body { -webkit-tap-highlight-color: transparent; text-rendering: optimizeSpeed; }

/* NOTE: no content-visibility:auto here. It swaps real section heights for a 760px
   placeholder until a section scrolls near, so the page height keeps changing under
   ScrollTrigger: reveal triggers went stale and the finale never appeared on phones. */

/* tap targets at least 44px tall */
.btn, .btns a, .btn.ghost { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.music-btn { width: 52px; height: 52px; }
.dots button { width: 12px; height: 12px; }

/* no hover-only UI on touch */
@media (pointer: coarse) {
  .cursor-dot { display: none !important; }
  .scratch canvas { cursor: default; }
  .polaroid:hover, .gal-card:hover { transform: none; }
}

/* ── phones ── */
@media (max-width: 600px) {
  .hero-names { font-size: clamp(44px, 14vw, 64px); }
  .hero-top { padding-left: var(--gutter); padding-right: var(--gutter); }
  .tiny-caps { font-size: 11px; letter-spacing: .2em; }
  .section { padding-left: var(--gutter); padding-right: var(--gutter); padding-top: 72px; padding-bottom: 72px; }
  .title { font-size: clamp(30px, 9vw, 40px); line-height: 1.15; }
  .sec-head { margin-bottom: 32px; }
  .couple-grid { gap: 28px; }
  .arch-pic { margin: 8px 8px 20px; }
  .person { width: min(100%, 300px); }
  .kline { font-size: clamp(54px, 18vw, 90px); }
  .kline.k2 { font-size: clamp(60px, 20vw, 100px); }
  .journey-text { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.35; }
  .scratch-row { gap: 12px; }
  .scratch { width: clamp(84px, 27vw, 110px); }
  .scratch small { font-size: 11px; letter-spacing: .2em; }
  .countdown { margin-top: 40px; }
  .cd-grid { gap: 8px; }
  .cd b { font-size: clamp(24px, 8vw, 34px); }
  .ct-text h2 { font-size: clamp(44px, 14vw, 64px); }
  .ct-hint { font-size: 12px; font-weight: 500; }
  .fv-cap .script { font-size: clamp(44px, 14vw, 72px); }
  .fv-kicker { top: 22%; }
  .timeline .tl-item { padding-left: 64px; }
  .tl-dot { width: 42px; height: 42px; left: 0; }
  .tl-card { padding: 18px; }
  .stack { gap: 5vh; }
  .ritual { min-height: 0; padding: 22px; }
  .ritual h3 { font-size: clamp(30px, 9vw, 40px); }
  .gal-card { width: min(74vw, 300px); }
  .gal-card p { font-size: 26px; }
  .gal-end { width: 70vw; }
  .ring { --cw: clamp(120px, 40vw, 170px); }
  .ring-head .title { font-size: clamp(28px, 8.4vw, 36px); }
  .reel-frame { width: min(86vw, 330px); }
  .polaroids { height: 420px; }
  .polaroid { width: 46vw; }
  .polaroid::after { font-size: 19px; }
  .md-center .script { font-size: clamp(36px, 11vw, 52px); }
  .venue-card { padding: 44px 22px 40px; border-radius: 160px 160px 22px 22px; }
  .venue-card h2 { font-size: clamp(40px, 13vw, 56px); }
  .venue-addr { font-size: 15px; }
  .btns { flex-direction: column; align-items: stretch; gap: 12px; }
  .btns .btn { width: 100%; }
  .finale-names { font-size: clamp(40px, 13vw, 58px); }
  .finale-line { font-size: clamp(22px, 6.6vw, 30px); }
  .credit { font-size: 11px; padding: 0 16px; }
  .caption { font-size: clamp(22px, 6.6vw, 30px); bottom: 15%; width: 86vw; }
  .scroll-cue { font-size: 13px; font-weight: 700; letter-spacing: .14em; }
  .hero-date { font-size: 11px; letter-spacing: .12em; }
  .hero-bottom { gap: 6px; padding-bottom: calc(66px + env(safe-area-inset-bottom)); } /* clears the language switcher */
  .gate-hint { font-size: 15px; letter-spacing: .14em; padding: 11px 22px; }
  .cd small { font-size: 10px; letter-spacing: .18em; }
  .lang-float { left: 12px; bottom: 16px; }
  .lang-float button { padding: 8px 12px; font-size: 12px; min-height: 36px; }
}

/* very small phones */
@media (max-width: 360px) {
  .hero-names { font-size: 40px; }
  .kline { font-size: 48px; }
  .scratch { width: 80px; }
  .cd b { font-size: 22px; }
  .venue-card h2 { font-size: 36px; }
}

/* short phones in landscape: keep hero and cards on screen */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-names { font-size: 36px; }
  .hero-top { padding-top: 12px; }
  .caption { font-size: 22px; }
}

/* big kinetic words: keep a margin from the screen edges on phones */
@media (max-width: 699px) {
  #lines .kline { padding-left: 20px; padding-right: 20px; }
}
