/* responsive.css
   Links, focus rings, reduced-motion and every breakpoint. Loads last.
   Part of the Mici & Tungi invitation. Load order: base -> sections -> responsive. */
/* ---------- LINKS, FOCUS, MOTION, RESPONSIVE ---------- */
  a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { color: var(--ink); }

  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
  .open-btn:focus-visible, .submit:focus-visible { outline-offset: 4px; }

  img, svg, canvas { max-width: 100%; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .fade { opacity: 1 !important; transform: none !important; }
    .reveal-in { opacity: 1 !important; transform: none !important; }
    .panel { transition: none; }
    #confetti { display: none; }
  }

  /* Tablet */
  @media (max-width: 900px) {
    .section { padding: 104px 22px; }
    .section.even { padding-top: 76px; padding-bottom: 76px; }
    .section.tight-bottom { padding-bottom: 72px; }
    .section.tight-top { padding-top: 22px; }
    .hero {
      min-height: auto;
      justify-content: flex-start;
    }
    .hero > .scroll-cue {
      margin-top: clamp(48px, 7vh, 88px);
    }
  }

  /* Phone */
  @media (max-width: 600px) {
    /* Fluid scale factor — iPhone SE (375px wide) is the reference at 1.0.
       Floor at 1 so SE and narrower phones are NOT affected; bigger phones
       scale up proportionally, capped at 1.2x so very wide/foldable devices
       don't go wild. The 375px denominator (length) makes the division
       produce a unitless number, which is required for clamp() with number
       min/max. */
    :root { --m-scale: clamp(1, calc(100vw / 375px), 1.2); }

    .section { padding: calc(76px * var(--m-scale)) calc(20px * var(--m-scale)); }
    .section.even { padding-top: calc(60px * var(--m-scale)); padding-bottom: calc(60px * var(--m-scale)); }
    .hero { padding: calc(88px * var(--m-scale)) calc(20px * var(--m-scale)) calc(76px * var(--m-scale)); }
    .hero .stamp { width: 66px; height: 66px; font-size: 19px; }
    .hero .pre {
      letter-spacing: 0.30em;
      font-size: calc(12px * var(--m-scale));
    }
    .hero .post { font-size: calc(18px * var(--m-scale)); }
    .hero .hero-portrait { width: calc(240px * var(--m-scale)); }
    .hero .flourish {
      margin: calc(14px * var(--m-scale)) 0 calc(20px * var(--m-scale)) calc(50% - 50vw);
      opacity: 0.7;
    }
    .scratch-section .flourish {
      margin: calc(32px * var(--m-scale)) calc(50% - 50vw) 0 auto;
    }
    .scratch-card.revealed ~ .flourish { opacity: 0.7; }
    .h2 { font-size: calc(28px * var(--m-scale)); }
    .eyebrow {
      letter-spacing: 0.26em;
      font-size: calc(12px * var(--m-scale));
    }
    .timeline-row .name { font-size: calc(18px * var(--m-scale)); }
    .week-label { font-size: calc(10px * var(--m-scale)); }
    .week-date {
      font-size: calc(18px * var(--m-scale));
      width: calc(38px * var(--m-scale));
      height: calc(38px * var(--m-scale));
    }
    .week-month__name { font-size: calc(17px * var(--m-scale)); }
    .cd-num { font-size: calc(38px * var(--m-scale)); }
    .cd-sep { font-size: calc(30px * var(--m-scale)); }
    .cd-lab { font-size: calc(8px * var(--m-scale)); letter-spacing: 0.22em; }
    footer { padding: calc(72px * var(--m-scale)) calc(20px * var(--m-scale)) calc(52px * var(--m-scale)); }
    footer .signoff { font-size: calc(20px * var(--m-scale)); }
    footer .sign-close { font-size: calc(17px * var(--m-scale)); }
    footer .mono { font-size: calc(34px * var(--m-scale)); }
    .scratch-card { aspect-ratio: 5/4; }
    .choice { grid-template-columns: 1fr; gap: calc(10px * var(--m-scale)); }
    .choice span { padding: calc(15px * var(--m-scale)) calc(10px * var(--m-scale)); letter-spacing: 0.20em; }
    .choice input:checked + span { letter-spacing: 0.22em; }
    .guest-row { grid-template-columns: 1fr; gap: 2px; }
    .from-to { grid-template-columns: 1fr; gap: calc(18px * var(--m-scale)); }
    .from-to .dash { display: none; }
    .faq-q { padding: calc(24px * var(--m-scale)) 0; gap: calc(16px * var(--m-scale)); }
    .submit { padding: calc(17px * var(--m-scale)) calc(20px * var(--m-scale)); letter-spacing: 0.26em; }
    .submit:hover { letter-spacing: 0.26em; }
    .rsvp-meta { letter-spacing: 0.22em; }
  }

  /* Very narrow: keep the countdown on one line */
  @media (max-width: 400px) {
    .cd-unit { min-width: 46px; }
    .cd-num { font-size: 30px; }
    .cd-sep { font-size: 22px; }
    .cd-lab { font-size: 7px; letter-spacing: 0.14em; }
  }

  /* Short-ish viewports: keep the curtain button comfortably in view. iPhone
     16 and similar handsets have ~750px of usable height once the Safari URL
     bar is showing, so the compressed spacing kicks in earlier than the true
     "short screen" threshold below. */
  @media (max-height: 800px) {
    .open-btn { margin-top: 36px; }
    .curtain-message .eyebrow { margin-bottom: 20px; }
    .curtain-message .sub { margin-top: 18px; }
  }

  /* Really short viewports: also drop the scroll cue so nothing crowds the
     button. */
  @media (max-height: 620px) {
    .open-btn { margin-top: 24px; }
    .curtain-message .eyebrow { margin-bottom: 14px; }
    .curtain-message .sub { margin-top: 12px; }
    .scroll-cue { display: none; }
  }
