/* ==========================================================================
   Gülnihal & Buğrahan — Wedding Invitation
   Mobile-first. Ivory paper, champagne gold, warm charcoal ink.
   The page is printed matter: rules and hairlines instead of app cards,
   letterpress names, foil only on ornaments. Information never waits for an
   animation; only ornaments move.
   ========================================================================== */

:root {
  color-scheme: only light;

  --ivory: #FAF7F2;
  --paper: #FFFDF9;
  --paper-2: #F6F1E7;
  --ink: #1F1B16;
  --ink-btn: #221D18;
  --ink-2: #4F483E;
  --ink-3: #6E675D;

  /* #C5A059 is for ornaments only — it is ~2.3:1 on ivory.
     Gold text uses --gold-text (~4.8:1). Form borders use --field-line (≥3:1 on paper). */
  --gold: #C5A059;
  --gold-soft: #E7D5A9;
  --gold-text: #87672B;
  --gold-line: rgba(197, 160, 89, 0.42);
  --gold-hair: rgba(197, 160, 89, 0.26);
  --field-line: #A08550;
  --foil: linear-gradient(105deg, #93702F 0%, #C29C50 16%, #F1E0AC 27%, #D2AE62 36%, #A47D36 52%, #C9A759 68%, #EBD69E 80%, #A07B35 100%);

  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --display: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --vh: 100vh;

  /* Paper grain: a 72px tile instead of a live SVG filter (cheap on phones). */
  --grain: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAQAAAD/5HvMAAAFK0lEQVR42p1aSZLkMAj0E+rkd9X/P+M5qGnITVZPRfRS3oQQZCbI1zU+z73+fj/rp36v/9bR537uPsp3rv/5iu+nz68zfcX389z17N9H1dfn7huncXW8bp3Dz8f3dTiN565j68o2cJ1Z39e14IV6RFs/j19HH3ddz39OmH1lnM0PXBdPv+Hy6ffyIY9QR+fi4Yhhwrpk3tgyoB7Gj1sDu2f4oAjDVDzhLR3MbA76jmfvvpWhGBR95xh9OXvGfl+k7sSIqFDd+3y/VPm6MVhF/27dHUR0TlUOzUnx1fL0Ge3J3pkLjDntx7nEat48miJMbp9+YVNy4qOJfqrqXfSyy+brb0jTmeTybXmsoZLxm0MejJ4oqhh7CaK3OQkGe/F2ADtTY/yPcO9hEANR+GeD1WdGgdeKSxzUMzMhL81QdsDY01Davv6PiZjX3OJ6lbA8rUGgGUqg2IHpHFnz7/BkI3DYxu8K+fboCVV/P+TSuSRz0RgYMDv43IoxhVmlixp7uGPO4YR/26POZ408fVaXTolakmSmKsq0gn8OcgUEBdMaSg3QxBkeysTGyg+JtyXWeap0RDZHGN8ggb7x88RcxRzmtD3zlzkAu041z/zSmXLE9TxPUHwus5K4UTeKzE7fTcHFBOCTZKcUjfE+HlSaoxLIuoFLn53hHfgQ2nvYquD3Ym0ur18ORxqvJMLyie12jOT+YjXGvnqhJxaXE2W9j/ys+665KNkHpZdSgWHsfy8XnSjzoevLhJnwUYx6Ps+ojIbX/an6LwxrBdm0bUdkxydTOIpYWmheuSlsApyFt9b7aTgn1WZGMgWn4jww1gzt9+oBaxR3nr3iq1mAYxSw3C7ZUe40MxmlAtZRh4yWBb6XWD7td1jjKxkdEb6pTvTy1klSFbWOOmciTE0QKldHqT6Azz95/u13JJytKHtj+l3qOryeHRYpD68QTSlWsKPBSITdNE6MGaOxlZedfFb+aybul12XDFtXFBw9K98y0WMN+Fqzcfi+aSuZHMpt18PAxq3OKlfuqdV8vTfWFKgwalCSe03ssAuvQ/WNoufnTG5IYfM8SwwPl66W02aVZCPeljuyHpmd+ttVqYfQxS1w7jNPzOZqP/kX/XQgOGp0356cD2ScRrHBLYRpsFvyxHCwVirUMXj1YUwC3BNxOdalZw6T7+dHVLq9i/OKHbWjA09sOfDvDY9pkcw9EYV8LgiTGkzTNFlbC8T7Gfsy76wr5vKWo5b6KKnSTAXRhEUfXZxdWl6l3Hxus6XGeFIcnSpOrDC0MYXtK7elZzCNkcbBG+8Xuao34b0vrrjzCMThK3R2tiYxV3MTMrk602K8OfL3KXvQckuxLyx7u6/EmN+2OtjFzOjj2SkF7Ttdz16tmMKHUhN0tlnmorhpqF7GRrLvNf5y2VuLgPfe3whSd0U8cKpGHfv22uLULZkUQSf9250qpw5T6m+Vk50P9MUJRyOKXdpn9HC53TV0CtpHH+/81AIhDKikpaVOjcj2Du6OedxS2fG22+gZE/rUCONzbru3HJSZJulgAOB5pZmDZotuKjg11CjMvWqv1X3G/ng1kSZvCTtFuYsdbhDnth5ea/qluLGGeo/LX32Rid90SDEZX+l5x5qc7rsutEdl1zUjTd3wpIP41qfjfN+rTqURvnUjjOhfs/HNtgb/ZidMdiffeEdMlaZ9syHt3ySm16hioeFi6dq8CrMFuP2rWe61DE8uCpHaKtZ93WsXftpzti8AiOyq/o/z22zt4R7bPwCjDfTYBpPbAAAAAElFTkSuQmCC");
}
@supports (height: 100svh) {
  :root { --vh: 100svh; }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ivory);
  /* hidden first: `clip` is unsupported before Safari 16 / Chrome 90 / Samsung 15 */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--ivory);
  background-image: var(--grain);
  background-size: 72px 72px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

html.is-intro, html.is-intro body,
html.is-sheet, html.is-sheet body { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
em { font-style: normal; }

:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nw { white-space: nowrap; }

/* ==========================================================================
   SHARED TYPE
   Two label voices only:
   - ornamental (Cinzel caps): .kicker, .section-label, family labels, date caps
   - UI (Plus Jakarta caps):  countdown labels, gift field names
   ========================================================================== */
.kicker,
.section-label {
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-text);
  /* compensate the trailing letter-space so text stays optically centred */
  padding-left: 0.24em;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
}
.section-label::before,
.section-label::after {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold-line);
}

.hint {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-3);
  text-align: center;
  text-wrap: pretty;
}

/* ==========================================================================
   FLOATING CONTROLS
   ========================================================================== */
.top-controls {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 60;
  display: flex;
  gap: 8px;
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}
.top-controls.is-tucked { transform: translateY(calc(-100% - var(--safe-top) - 16px)); opacity: 0; pointer-events: none; }
/* keyboard users must never lose the controls */
.top-controls.is-tucked:focus-within { transform: none; opacity: 1; pointer-events: auto; }

.control-pill {
  height: 44px;
  min-width: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  /* opaque enough to read over anything: no backdrop blur (it repaints on every scroll frame) */
  background: rgba(255, 253, 249, 0.95);
  box-shadow: 0 4px 14px -6px rgba(102, 76, 30, 0.25);
  color: var(--ink);
  transition: transform 0.2s var(--ease-out), border-color 0.2s;
}
.control-pill:active { transform: scale(0.95); }

.lang-code {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  transition: color 0.2s;
}
.lang-code.is-active { color: var(--gold-text); }
.lang-sep { width: 1px; height: 12px; background: var(--gold-line); }

.audio-toggle { width: 44px; padding: 0; }
.sound-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold-text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound-speaker { fill: rgba(197, 160, 89, 0.18); }
.sound-wave { opacity: 0; transition: opacity 0.25s; }
.audio-toggle[aria-pressed="true"] .sound-wave { opacity: 1; animation: wave 1.8s ease-in-out infinite; }
.audio-toggle[aria-pressed="true"] .sound-wave-2 { animation-delay: 0.25s; }
.audio-toggle[aria-pressed="true"] .sound-mute { opacity: 0; }
.sound-mute { transition: opacity 0.2s; stroke: var(--ink-3); }
@keyframes wave {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ==========================================================================
   INTRO — SEALED ENVELOPE
   ========================================================================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  align-items: safe center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: calc(var(--safe-top) + 64px) var(--gutter) calc(var(--safe-bottom) + 28px);
  background:
    radial-gradient(110% 60% at 50% 56%, rgba(255, 253, 249, 0.96) 0%, rgba(250, 247, 242, 0) 70%),
    var(--grain) 0 0 / 72px 72px,
    var(--ivory);
  cursor: pointer;
  /* opacity only: a transform here would capture the flying letter (position: fixed) */
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.intro.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-inner {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.intro-head,
.intro-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: introIn 1.1s var(--ease-out) both;
}
.intro-stage { animation-delay: 0.08s; }
@keyframes introIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.intro-guest {
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.3;
  color: var(--ink-2);
  text-wrap: balance;
}
.intro-guest-label { font-style: italic; }
.intro-guest-name { font-weight: 500; color: var(--ink); }

.intro-names {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(2rem, 9.6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.005em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}
.amp {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  padding: 0 0.05em;
}
.intro-date {
  margin-top: 12px;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* --- Envelope ----------------------------------------------------------- */
.envelope {
  --w: min(84vw, 340px);
  position: relative;
  width: var(--w);
  height: calc(var(--w) / 1.5);
  margin: 42px 0 24px;
  perspective: 1100px;
  border-radius: 5px;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.45s ease, transform 0.7s var(--ease-out);
}

/* static contact shadow — no filter on the animating parent */
.env-shadow {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(92, 66, 24, 0.12), 0 22px 34px -16px rgba(92, 66, 24, 0.34);
}
.env-shadow::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -12%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(92, 66, 24, 0.16), rgba(92, 66, 24, 0));
}

.env-layer { position: absolute; inset: 0; }
.env-layer svg,
.env-flap-face svg { width: 100%; height: 100%; overflow: visible; }
.env-back { z-index: 1; }
.env-front { z-index: 3; pointer-events: none; }
/* paper grain over the pockets (the V opening stays clear for the letter) */
.env-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grain) 0 0 / 72px 72px;
  opacity: 0.5;
  -webkit-clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.env-flap-shadow { transition: opacity 0.3s; }

.env-letter {
  position: absolute;
  z-index: 2;
  left: 6%;
  width: 88%;
  top: 7%;
  height: 86%;
  border-radius: 3px;
  background-color: var(--paper);
  box-shadow: 0 0 0 0.5px rgba(160, 128, 64, 0.35), 0 -8px 20px -12px rgba(60, 40, 10, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 11%;
  gap: 5px;
  transition: transform 0.9s var(--ease-out);
}
/* grain and frame live on children so they can fade before the card is scaled */
.env-letter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grain) 0 0 / 72px 72px;
  transition: opacity 0.3s;
}
.env-letter-frame {
  position: absolute;
  inset: 7px;
  border: 1px solid var(--gold-line);
  pointer-events: none;
  transition: opacity 0.3s;
}
.env-letter-frame::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 0.5px solid var(--gold-hair);
}
.env-letter-mono,
.env-letter-date { position: relative; transition: opacity 0.3s; }
.env-letter-mono {
  font-family: var(--display);
  font-size: calc(var(--w) * 0.088);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--gold-text);
}
.env-letter-mono em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}
.env-letter-date {
  font-family: var(--display);
  font-size: calc(var(--w) * 0.032);
  letter-spacing: 0.28em;
  color: var(--ink-3);
}

.env-flap {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.8s var(--ease-in-out);
}
.env-flap-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.env-flap-outer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grain) 0 0 / 72px 72px;
  opacity: 0.5;
  -webkit-clip-path: polygon(0 0, 100% 0, 50% 59%);
  clip-path: polygon(0 0, 100% 0, 50% 59%);
}
.env-flap-inner { transform: rotateY(180deg); }

/* --- Wax seal (baked artwork: seal.webp / seal.png) ---------------------- */
.seal {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 60%;
  width: calc(var(--w) * 0.32);
  height: calc(var(--w) * 0.32);
  transform: translate(-50%, -50%);
  transition: transform 0.25s var(--ease-out);
}
.seal-whole,
.seal-half { position: absolute; inset: 0; }
/* the artwork includes its contact shadow, so it is drawn 8/120 larger on every side */
.seal img,
.seal-glint {
  position: absolute;
  left: -6.667%;
  top: -6.667%;
  width: 113.333%;
  height: 113.333%;
  max-width: none;
}
.seal img { pointer-events: none; -webkit-user-drag: none; }
.seal-half { opacity: 0; }
.seal-left {
  -webkit-clip-path: polygon(-10% -10%, 53% -10%, 47% 18%, 55% 33%, 46% 50%, 54% 66%, 47% 83%, 52% 110%, -10% 110%);
  clip-path: polygon(-10% -10%, 53% -10%, 47% 18%, 55% 33%, 46% 50%, 54% 66%, 47% 83%, 52% 110%, -10% 110%);
}
.seal-right {
  -webkit-clip-path: polygon(53% -10%, 110% -10%, 110% 110%, 52% 110%, 47% 83%, 54% 66%, 46% 50%, 55% 33%, 47% 18%);
  clip-path: polygon(53% -10%, 110% -10%, 110% 110%, 52% 110%, 47% 83%, 54% 66%, 46% 50%, 55% 33%, 47% 18%);
}
/* A slow light glint across the wax invites the tap (three passes, then rest) */
.seal-glint {
  overflow: hidden;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 136 136'%3E%3Cpath d='M114.2,60.0C114.6,62.7 113.5,65.7 112.8,68.4C112.1,71.1 110.9,73.6 109.9,76.2C108.9,78.8 108.0,81.4 106.8,83.8C105.5,86.2 103.8,88.4 102.3,90.7C100.9,93.1 99.8,95.9 98.0,98.0C96.2,100.1 94.1,102.2 91.6,103.5C89.2,104.8 85.9,104.7 83.3,105.7C80.8,106.8 78.7,108.6 76.3,110.1C73.8,111.5 71.3,113.9 68.6,114.5C65.9,115.1 62.8,114.1 60.0,113.5C57.2,112.8 54.6,111.4 52.0,110.6C49.3,109.9 46.7,109.7 44.1,108.9C41.6,108.0 39.1,106.8 36.8,105.5C34.4,104.3 32.3,102.7 30.0,101.3C27.8,99.8 25.6,98.3 23.4,96.6C21.2,95.0 18.9,93.3 16.8,91.4C14.7,89.4 12.3,87.5 10.7,85.1C9.1,82.7 7.6,80.0 7.1,77.2C6.6,74.4 7.4,71.1 7.9,68.2C8.4,65.4 9.8,62.7 10.2,60.0C10.6,57.3 9.9,54.7 10.1,52.1C10.2,49.4 10.4,46.7 11.0,44.1C11.7,41.5 12.9,39.1 14.0,36.6C15.1,34.1 16.2,31.5 17.6,29.2C19.1,26.9 20.9,24.8 22.7,22.7C24.5,20.6 26.4,18.5 28.4,16.4C30.3,14.4 32.1,11.5 34.6,10.2C37.1,8.8 40.3,8.3 43.2,8.3C46.1,8.2 49.3,9.8 52.1,9.9C54.9,10.0 57.3,9.2 60.0,8.9C62.7,8.5 65.5,7.7 68.3,7.8C71.0,8.0 73.6,9.1 76.3,9.9C78.9,10.8 81.5,11.7 84.0,12.9C86.5,14.1 88.9,15.5 91.2,17.0C93.5,18.6 95.9,20.2 98.0,22.0C100.1,23.9 102.5,25.7 103.8,28.2C105.0,30.7 105.0,34.1 105.4,36.8C105.9,39.6 105.6,42.4 106.5,44.9C107.4,47.4 109.4,49.5 110.7,52.0C112.0,54.5 113.9,57.3 114.2,60.0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 136 136'%3E%3Cpath d='M114.2,60.0C114.6,62.7 113.5,65.7 112.8,68.4C112.1,71.1 110.9,73.6 109.9,76.2C108.9,78.8 108.0,81.4 106.8,83.8C105.5,86.2 103.8,88.4 102.3,90.7C100.9,93.1 99.8,95.9 98.0,98.0C96.2,100.1 94.1,102.2 91.6,103.5C89.2,104.8 85.9,104.7 83.3,105.7C80.8,106.8 78.7,108.6 76.3,110.1C73.8,111.5 71.3,113.9 68.6,114.5C65.9,115.1 62.8,114.1 60.0,113.5C57.2,112.8 54.6,111.4 52.0,110.6C49.3,109.9 46.7,109.7 44.1,108.9C41.6,108.0 39.1,106.8 36.8,105.5C34.4,104.3 32.3,102.7 30.0,101.3C27.8,99.8 25.6,98.3 23.4,96.6C21.2,95.0 18.9,93.3 16.8,91.4C14.7,89.4 12.3,87.5 10.7,85.1C9.1,82.7 7.6,80.0 7.1,77.2C6.6,74.4 7.4,71.1 7.9,68.2C8.4,65.4 9.8,62.7 10.2,60.0C10.6,57.3 9.9,54.7 10.1,52.1C10.2,49.4 10.4,46.7 11.0,44.1C11.7,41.5 12.9,39.1 14.0,36.6C15.1,34.1 16.2,31.5 17.6,29.2C19.1,26.9 20.9,24.8 22.7,22.7C24.5,20.6 26.4,18.5 28.4,16.4C30.3,14.4 32.1,11.5 34.6,10.2C37.1,8.8 40.3,8.3 43.2,8.3C46.1,8.2 49.3,9.8 52.1,9.9C54.9,10.0 57.3,9.2 60.0,8.9C62.7,8.5 65.5,7.7 68.3,7.8C71.0,8.0 73.6,9.1 76.3,9.9C78.9,10.8 81.5,11.7 84.0,12.9C86.5,14.1 88.9,15.5 91.2,17.0C93.5,18.6 95.9,20.2 98.0,22.0C100.1,23.9 102.5,25.7 103.8,28.2C105.0,30.7 105.0,34.1 105.4,36.8C105.9,39.6 105.6,42.4 106.5,44.9C107.4,47.4 109.4,49.5 110.7,52.0C112.0,54.5 113.9,57.3 114.2,60.0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}
.seal-glint::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -45%;
  width: 34%;
  background: linear-gradient(90deg, rgba(255, 248, 230, 0), rgba(255, 248, 230, 0.55), rgba(255, 248, 230, 0));
  transform: translateX(0) skewX(-18deg);
  animation: sealGlint 6.5s var(--ease-in-out) 1.8s 3;
}
@keyframes sealGlint {
  0% { transform: translateX(0) skewX(-18deg); }
  24%, 100% { transform: translateX(480%) skewX(-18deg); }
}

.envelope:active .seal { transform: translate(-50%, -50%) scale(0.96); }

.intro-hint {
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  transition: opacity 0.3s;
  animation: hintIn 0.8s ease 1.4s both;
}
@keyframes hintIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Opening sequence (classes added by script.js) ------------------------ */
.intro.is-opening .seal-glint { display: none; }
.intro.is-opening .seal-whole { opacity: 0; }
.intro.is-opening .seal-left { animation: sealLeft 0.7s var(--ease-out) forwards; }
.intro.is-opening .seal-right { animation: sealRight 0.7s var(--ease-out) forwards; }
.intro.is-opening .env-flap-shadow { opacity: 0; }
@keyframes sealLeft {
  0% { opacity: 1; transform: none; }
  45% { opacity: 1; }
  100% { opacity: 0; transform: translate(-22%, 30%) rotate(-16deg); }
}
@keyframes sealRight {
  0% { opacity: 1; transform: none; }
  45% { opacity: 1; }
  100% { opacity: 0; transform: translate(22%, 34%) rotate(13deg); }
}
.intro.is-opening .env-flap { transform: rotateX(180deg); transition-delay: 0.2s; }
.intro.is-flap-behind .env-flap { z-index: 0; }
.intro.is-rising .env-letter { transform: translateY(-56%); }
.intro-head > *,
.intro-hint { transition: opacity 0.45s ease, transform 0.6s var(--ease-out); }
.intro.is-opening .intro-head > *,
.intro.is-opening .intro-hint { opacity: 0; transform: translateY(-8px); }
.intro.is-opening .intro-hint { animation: none; }

/* the letter is lifted out of the envelope into the intro layer, then grows into the page */
.intro.is-lifted .envelope { opacity: 0; transform: translateY(36px); transition: opacity 0.35s ease, transform 0.6s var(--ease-out); }
.env-letter.is-flying {
  position: fixed;
  z-index: 6;
  margin: 0;
  transition: none;
  will-change: transform;
}
.env-letter.is-growing {
  border-radius: 0;
  box-shadow: 0 0 0 0 transparent;
  background-color: var(--ivory);
  /* the card keeps its paper and shadow while it lifts off, then melts into the page */
  transition: transform 0.85s var(--ease-in-out) 0.12s, border-radius 0.5s 0.3s, background-color 0.45s ease 0.42s, box-shadow 0.4s ease 0.45s;
}
.env-letter.is-growing::before,
.env-letter.is-growing .env-letter-frame,
.env-letter.is-growing .env-letter-mono,
.env-letter.is-growing .env-letter-date { opacity: 0; }

/* ==========================================================================
   INVITATION
   ========================================================================== */
.invitation {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--safe-bottom) + 56px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

/* --- Day-of / after banner --------------------------------------------------- */
.phase-banner {
  position: relative;
  margin: calc(var(--safe-top) + 66px) calc(12px - var(--gutter)) 0;
  padding: 26px 22px 22px;
  border-radius: 4px;
  background: var(--ink-btn);
  color: var(--ivory);
  box-shadow: inset 0 0 0 6px var(--ink-btn), inset 0 0 0 6.6px rgba(214, 180, 110, 0.5), 0 18px 36px -18px rgba(31, 27, 22, 0.7);
}
.phase-banner-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1.2; }
.phase-banner-text { margin-top: 6px; font-size: 0.92rem; color: rgba(250, 247, 242, 0.84); }
.phase-banner-cta { margin-top: 16px; }
.phase-banner .btn-primary {
  background: var(--ivory);
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--ivory), inset 0 0 0 3.6px rgba(160, 128, 64, 0.55);
}
.phase-banner .btn-secondary {
  background: transparent;
  color: var(--ivory);
  box-shadow: inset 0 0 0 1px rgba(214, 180, 110, 0.6);
}

/* --- I · Cover card ------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 calc(12px - var(--gutter));
  padding: calc(var(--safe-top) + 64px) 0 calc(var(--safe-bottom) + 16px);
}
.phase-banner:not([hidden]) + .hero { min-height: 0; padding-top: 18px; }

.cover {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 22px 34px;
  isolation: isolate;
}
/* engraved double rule */
.cover::before,
.cover::after { content: ""; position: absolute; pointer-events: none; }
.cover::before { inset: 0; border: 1px solid var(--gold-line); }
.cover::after { inset: 4px; border: 0.5px solid var(--gold-hair); }

/* Kubadabad star-and-cross lattice, strongest at the rule and gone behind the names */
.cover-lattice {
  position: absolute;
  inset: 5px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23C5A059'%3E%3Cpath stroke-width='.55' d='M20,0 L25.86,5.86 L34.14,5.86 L34.14,14.14 L40,20 L34.14,25.86 L34.14,34.14 L25.86,34.14 L20,40 L14.14,34.14 L5.86,34.14 L5.86,25.86 L0,20 L5.86,14.14 L5.86,5.86 L14.14,5.86Z'/%3E%3Ccircle cx='20' cy='20' r='3' stroke-width='.45'/%3E%3C/g%3E%3C/svg%3E") center / 44px 44px;
  -webkit-mask-image: radial-gradient(78% 64% at 50% 50%, transparent 48%, #000 100%);
  mask-image: radial-gradient(78% 64% at 50% 50%, transparent 48%, #000 100%);
}
.cover-corner {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ivory) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12,1 L15.22,4.22 L19.78,4.22 L19.78,8.78 L23,12 L19.78,15.22 L19.78,19.78 L15.22,19.78 L12,23 L8.78,19.78 L4.22,19.78 L4.22,15.22 L1,12 L4.22,8.78 L4.22,4.22 L8.78,4.22Z' fill='none' stroke='%23C5A059' stroke-width='1.4'/%3E%3Ccircle cx='12' cy='12' r='2.6' fill='%23C5A059'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
}
.cover-corner-tl { top: -6.5px; left: -6.5px; }
.cover-corner-tr { top: -6.5px; right: -6.5px; }
.cover-corner-bl { bottom: -6.5px; left: -6.5px; }
.cover-corner-br { bottom: -6.5px; right: -6.5px; }

.crest { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.crest-rule {
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
  transform-origin: 100% 50%;
}
.crest-rule:last-child { background: linear-gradient(270deg, transparent, var(--gold-line)); transform-origin: 0 50%; }
.medal { width: 44px; height: 44px; overflow: visible; }

.guest-line {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.3;
  color: var(--ink-2);
  text-wrap: balance;
}
.guest-label { font-style: italic; }
.guest-name { font-weight: 500; color: var(--ink); }

.couple {
  margin: 28px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 0.98;
}
.couple-name {
  display: block;
  font-size: clamp(3.05rem, 17.4vw, 4.6rem);
  letter-spacing: 0.004em;
  /* letterpress: a touch of paper shows through the ink; highlight under, crisp top edge */
  color: rgba(31, 27, 22, 0.95);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 -0.5px 0.5px rgba(31, 27, 22, 0.18);
}
.couple-amp {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 8px;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.1rem, 10vw, 2.7rem);
  line-height: 1;
}
.couple-amp::before,
.couple-amp::after {
  content: "";
  width: 46px;
  height: 1px;
  background: var(--gold-line);
}
.foil { padding: 0 0.08em 0.06em; color: var(--gold); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .foil {
    background: var(--foil);
    background-size: 320% 100%;
    background-position: 46% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.cover-date {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-variant-numeric: lining-nums;
}

.families {
  width: 100%;
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 10px;
}
.family { min-width: 0; }
.family-parents {
  font-family: var(--serif);
  font-size: clamp(1.08rem, 5vw, 1.26rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}
.amp-i { font-style: italic; font-weight: 400; color: var(--gold-text); }
.family-label {
  margin-top: 5px;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.families-sep {
  width: 9px;
  height: 9px;
  margin-top: 9px;
  transform: rotate(45deg);
  border: 1px solid var(--gold-line);
}

.cover-cue {
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translate(-50%, 50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ivory);
  display: grid;
  place-items: center;
  color: var(--gold-text);
}
.cover-cue svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* --- Prelude --------------------------------------------------------------- */
.prelude { margin-top: 44px; }
.verse {
  max-width: 20em;
  margin: 0 auto;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.58;
  color: var(--ink-2);
  text-wrap: balance;
}

/* --- Seljuk star divider (opens movements II and III) ------------------------ */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gold);
}
.divider-line {
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
  transform-origin: 100% 50%;
}
.divider-line:last-child { background: linear-gradient(270deg, transparent, var(--gold-line)); transform-origin: 0 50%; }
.divider-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.divider-star { width: 20px; height: 20px; }
.divider-movement { margin-top: 72px; }

/* --- Folio: everything after the cover framed like the cover ------------------
   The same engraved double rule and star corners continue down the page, sections
   are tied to the frame by star knots, and a soft light travels along the gilt edge. */
.folio {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 60px calc(12px - var(--gutter)) 0;
  /* 8px more air than the page gutter so buttons and cards never crowd the double rule */
  padding: 46px calc(var(--gutter) - 4px) 40px;
}
.folio::before,
.folio::after { content: ""; position: absolute; pointer-events: none; }
.folio::before { inset: 0; border: 1px solid var(--gold-line); }
.folio::after { inset: 4px; border: 0.5px solid var(--gold-hair); }
/* the opening star of movement II now sits on the frame as a clasp */
.folio > .when { margin-top: 0; }
.folio > .when > .divider:first-child { display: none; }
.folio-clasp {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--gold);
}
.folio-clasp svg { width: 22px; height: 22px; }
/* the cover's lattice, kept to the margins so it never sits behind text */
.folio-lattice {
  position: absolute;
  inset: 5px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.26;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23C5A059'%3E%3Cpath stroke-width='.55' d='M20,0 L25.86,5.86 L34.14,5.86 L34.14,14.14 L40,20 L34.14,25.86 L34.14,34.14 L25.86,34.14 L20,40 L14.14,34.14 L5.86,34.14 L5.86,25.86 L0,20 L5.86,14.14 L5.86,5.86 L14.14,5.86Z'/%3E%3Ccircle cx='20' cy='20' r='3' stroke-width='.45'/%3E%3C/g%3E%3C/svg%3E") center top / 44px 44px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, transparent 13%, transparent 87%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0, transparent 13%, transparent 87%, #000 100%);
}
/* Light gliding down both gilt edges together: a soft halo, a bright core along the double
   rule and a small turning sparkle at its head. Compositor-only (transform + opacity). */
.folio-glint {
  position: absolute;
  top: 0;
  z-index: 1;
  width: 22px;
  height: 240px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 236, 186, 0.5) 0%, rgba(255, 236, 186, 0.18) 45%, rgba(255, 236, 186, 0) 75%);
  will-change: transform, opacity;
}
.folio-glint::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8.5px;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 244, 214, 0), rgba(226, 192, 112, 0.85) 38%, #FFF8E4 50%, rgba(226, 192, 112, 0.85) 62%, rgba(255, 244, 214, 0));
}
.folio-glint::after {
  content: "";
  position: absolute;
  top: 112px;
  left: 4px;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 L14 10 L24 12 L14 14 L12 24 L10 14 L0 12 L10 10Z' fill='%23FFF6DA'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: glintSpark 1.6s linear infinite;
}
.folio-glint-l { left: -8.5px; }
.folio-glint-r { right: -8.5px; }
.folio.is-lit .folio-glint { animation: folioGlint var(--glint-dur, 14s) linear infinite; }
@keyframes folioGlint {
  0% { transform: translateY(-240px); opacity: 0; }
  3% { opacity: 1; }
  77% { opacity: 1; }
  80% { transform: translateY(var(--folio-h, 4000px)); opacity: 0; }
  100% { transform: translateY(var(--folio-h, 4000px)); opacity: 0; }
}
@keyframes glintSpark {
  0% { transform: rotate(0deg) scale(0.75); opacity: 0.7; }
  50% { transform: rotate(45deg) scale(1.05); opacity: 1; }
  100% { transform: rotate(90deg) scale(0.75); opacity: 0.7; }
}
/* As the light passes a section, its knots flare on both edges and its centre star turns.
   script.js sets --flare-delay per divider from the light's speed and the divider's height. */
.folio.is-lit .divider::before,
.folio.is-lit .divider::after { animation: knotFlare var(--glint-dur, 14s) linear var(--flare-delay, 0s) infinite; }
.folio.is-lit .divider .divider-star { animation: starFlare var(--glint-dur, 14s) var(--ease-in-out) var(--flare-delay, 0s) infinite; }
.folio.is-lit .folio-clasp svg { animation: starFlare var(--glint-dur, 14s) var(--ease-in-out) var(--flare-delay, 0s) infinite; }
@keyframes knotFlare {
  0% { transform: none; box-shadow: 0 0 0 0 rgba(255, 232, 178, 0); }
  2% { transform: rotate(22.5deg) scale(1.22); box-shadow: 0 0 0 2px rgba(255, 240, 204, 0.85), 0 0 14px 5px rgba(214, 176, 98, 0.55); }
  7% { transform: rotate(45deg); box-shadow: 0 0 0 0 rgba(255, 232, 178, 0); }
  100% { transform: rotate(45deg); box-shadow: 0 0 0 0 rgba(255, 232, 178, 0); }
}
@keyframes starFlare {
  0% { transform: none; color: var(--gold); }
  3% { transform: rotate(22.5deg) scale(1.18); color: #E9CB86; }
  9% { transform: rotate(45deg); color: var(--gold); }
  100% { transform: rotate(45deg); color: var(--gold); }
}
/* star knots: every divider inside the sheet is tied to both edges of the frame */
.folio .divider { position: relative; align-self: stretch; }
.folio .divider::before,
.folio .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--ivory) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12,1 L15.22,4.22 L19.78,4.22 L19.78,8.78 L23,12 L19.78,15.22 L19.78,19.78 L15.22,19.78 L12,23 L8.78,19.78 L4.22,19.78 L4.22,15.22 L1,12 L4.22,8.78 L4.22,4.22 L8.78,4.22Z' fill='none' stroke='%23C5A059' stroke-width='1.4'/%3E%3Ccircle cx='12' cy='12' r='2.6' fill='%23C5A059'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
}
/* same geometry as the corner stars: centred 1px inside the outer edge, on the heavy rule */
.folio .divider::before { left: calc(-2.5px - var(--gutter)); }
.folio .divider::after { right: calc(-2.5px - var(--gutter)); }
.divider-sub { margin-top: 64px; }
.divider-sub .divider-star { width: 16px; height: 16px; }
.folio > .venue,
.folio > .wishes { margin-top: 44px; }

/* --- II · Date & countdown ----------------------------------------------------- */
.when {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.when > .divider { margin-bottom: 28px; }
.date-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.date-month,
.date-year {
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
}
.date-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 330px;
  margin: 6px 0 4px;
}
.date-side {
  position: relative;
  padding: 10px 0 10px 0.2em;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-variant-numeric: lining-nums tabular-nums;
}
/* engraved double rule above and below */
.date-side::before,
.date-side::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-top: 1px solid var(--gold-line);
  border-bottom: 0.5px solid var(--gold-hair);
}
.date-side::before { top: 0; }
.date-side::after { bottom: 0; transform: scaleY(-1); }
.date-day {
  padding: 0 16px;
  font-family: var(--serif);
  font-size: 5.3rem;
  font-weight: 500;
  line-height: 0.92;
  color: var(--gold-text);
  /* Cormorant defaults to old-style figures where the 5 drops below the baseline */
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 -0.5px 0.5px rgba(80, 58, 20, 0.25);
}

/* weather: a printed line under the date */
/* centred stack (icon over text) so it stays centred however the text wraps */
.weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  align-self: center;
  max-width: 300px;
  margin: 26px auto 0;
  text-align: center;
}
.wx-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--gold-text);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wx-icon g { display: none; }
.weather[data-icon="sun"] .wx-sun,
.weather[data-icon="partly"] .wx-partly,
.weather[data-icon="cloud"] .wx-cloud,
.weather[data-icon="rain"] .wx-rain,
.weather[data-icon="snow"] .wx-snow,
.weather[data-icon="normal"] .wx-normal { display: inline; }
.weather-copy { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.4; }
.weather-text { font-size: 0.9rem; font-weight: 600; color: var(--ink); text-wrap: balance; }
.weather-tip { font-size: 0.82rem; color: var(--ink-2); }
.weather-note { font-size: 0.74rem; color: var(--ink-3); }
.weather-note a { color: inherit; }

/* countdown: printed numerals, no card */
.countdown { width: 100%; max-width: 340px; margin-top: 30px; }
.countdown-title {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.16rem;
  color: var(--ink-2);
}
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; }
.countdown-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.countdown-unit + .countdown-unit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, var(--gold-line), transparent);
}
.countdown-num {
  display: flex;
  justify-content: center;
  min-height: 1.1em;
  font-family: var(--serif);
  font-size: 2.45rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.is-seconds .countdown-num { color: var(--gold-text); }
.cd-slot {
  position: relative;
  display: inline-block;
  width: 0.53em;
  height: 1.1em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.cd-slot > span { position: absolute; inset: 0; text-align: center; }
/* counting DOWN: the old digit drops away, the new one settles in from above */
.cd-slot .cd-out { animation: cdOut 0.5s var(--ease-out) forwards; }
.cd-slot .cd-in { animation: cdIn 0.5s var(--ease-out) both; }
@keyframes cdOut { to { transform: translateY(55%); opacity: 0; } }
@keyframes cdIn {
  from { transform: translateY(-55%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.countdown-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.calendar-actions {
  width: 100%;
  max-width: 340px;
  margin: 26px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* --- Venue ---------------------------------------------------------------- */
.venue { margin-top: 64px; }
.venue-name {
  font-family: var(--serif);
  font-size: clamp(2.05rem, 9.4vw, 2.45rem);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}
.venue-sub {
  margin-top: 6px;
  font-size: 0; /* hides the " · " between the two parts: they are set as two engraved lines */
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--ink-3);
}
.venue-sub .nw { display: block; font-size: 0.86rem; }
.address-text {
  max-width: 24em;
  margin: 14px auto 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: balance;
}
.address-text + .text-link { margin-top: 2px; }
.venue-actions { max-width: 340px; margin: 12px auto 0; }
.map-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 14px;
  margin-top: 4px;
}
.map-links .text-link { position: relative; }
/* a centred dot between the visible links (absolutely placed so it is never underlined) */
.map-links .text-link:not([hidden]) ~ .text-link:not([hidden])::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 3px;
  height: 3px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--gold);
}

.tips {
  list-style: none;
  margin-top: 26px;
  display: grid;
  text-align: left;
  border-top: 1px solid var(--gold-hair);
}
.tip { display: flex; gap: 14px; padding: 16px 4px; }
.tip + .tip { border-top: 1px solid var(--gold-hair); }
.tip svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--gold-text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tip-title { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.tip-text { margin-top: 2px; font-size: 0.9rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* --- Buttons: stationery ------------------------------------------------------ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--ease-out), box-shadow 0.15s var(--ease-out), background-color 0.2s, opacity 0.2s;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn[disabled], .btn.is-busy { opacity: 0.6; pointer-events: none; }

/* paper key with an engraved double rule */
.btn-paper,
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--gold-line),
    inset 0 0 0 3px var(--paper),
    inset 0 0 0 3.5px var(--gold-hair),
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 14px -10px rgba(102, 76, 30, 0.35);
}
.btn-paper svg,
.btn-secondary svg { color: var(--gold-text); }

/* ink key with a gold inner rule — at most two on the page (directions, send note) */
.btn-ink,
.btn-primary {
  background: var(--ink-btn);
  color: #FBF6EC;
  box-shadow: inset 0 0 0 3px var(--ink-btn), inset 0 0 0 3.6px rgba(214, 180, 110, 0.6), 0 10px 20px -12px rgba(31, 27, 22, 0.65);
}
.btn-ink svg,
.btn-primary svg { color: #E3C88A; }

/* pressed: the key sinks a pixel like a stamp, no scale bounce */
.btn:active { transform: translateY(1px); }
.btn-paper:active,
.btn-secondary:active {
  background: #F7F1E6;
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 3px #F7F1E6, inset 0 0 0 3.5px var(--gold-line), inset 0 2px 4px rgba(102, 76, 30, 0.12);
}
.btn-ink:active,
.btn-primary:active {
  background: #15110D;
  box-shadow: inset 0 0 0 3px #15110D, inset 0 0 0 3.6px rgba(214, 180, 110, 0.75), 0 4px 8px -6px rgba(31, 27, 22, 0.7);
}

.btn-lines { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.btn-lines small { margin-top: 2px; font-size: 0.76rem; font-weight: 500; letter-spacing: 0.01em; opacity: 0.78; }
.btn-whatsapp svg { fill: #1FA855; stroke: none; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-text);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.text-link svg { display: none; }
.text-link-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.text-link:active { color: var(--ink); }

@media (hover: hover) {
  .btn-ink:hover, .btn-primary:hover { background: #3A332B; box-shadow: inset 0 0 0 3px #3A332B, inset 0 0 0 3.6px rgba(214, 180, 110, 0.7), 0 10px 20px -12px rgba(31, 27, 22, 0.65); }
  .btn-paper:hover, .btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 3px var(--paper), inset 0 0 0 3.5px var(--gold-line), 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 14px -10px rgba(102, 76, 30, 0.35); }
  .text-link:hover { text-decoration-color: var(--gold-text); }
  .control-pill:hover { border-color: var(--gold); }
}

/* --- III · Share ---------------------------------------------------------------- */
.share { margin-top: 30px; }
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto 12px;
}

/* --- Congratulations ------------------------------------------------------------ */
.wishes { margin-top: 64px; display: flex; flex-direction: column; }
/* --- Guest photos: visible from today, opens on the wedding day ---------------- */
.memories { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.memories-icon {
  width: 36px; height: 36px; margin-bottom: 10px;
  fill: none; stroke: var(--gold-text); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
}
.memories-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}
.memories-text {
  margin: 8px auto 18px;
  max-width: 32ch;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: balance;
}
.memories-btn { width: auto; min-width: 240px; padding: 12px 26px; }
.memories-btn .memories-btn-open { display: none; }
/* Closed: an engraved, dashed outline on bare paper — clearly waiting, not broken. */
.memories-btn[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
  color: var(--ink-3);
  background: transparent;
  box-shadow: none;
  border: 1px dashed var(--gold-line);
}
.memories-btn[aria-disabled="true"] svg { color: var(--ink-3); }
.memories-btn[aria-disabled="false"] .memories-btn-soon { display: none; }
.memories-btn[aria-disabled="false"] .memories-btn-open { display: block; }
.memories-note {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-3);
  text-wrap: balance;
}

.cheer { position: relative; }
.cheer-title {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}
.btn-cheer { width: auto; min-width: 220px; padding: 12px 28px; }
.cheer-star { width: 22px; height: 22px; overflow: visible; }
.cheer-star-line { fill: none; stroke: var(--gold-text); stroke-width: 1.3; stroke-linejoin: round; }
.cheer-star-fill {
  fill: url(#starFoil);
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scale(0);
  transition: transform 0.55s var(--ease-spring);
}
.btn-cheer.is-done { color: var(--gold-text); }
.btn-cheer.is-done .cheer-star-fill { transform: scale(1); }
.cheer-count { margin-top: 12px; font-size: 0.86rem; font-weight: 500; color: var(--ink-3); }

/* a handful of gold-leaf flakes; the container clips them so nothing overflows the page */
.flakes { position: absolute; inset: -70px 0 0; overflow: hidden; pointer-events: none; }
.flake {
  position: absolute;
  width: 7px;
  height: 9px;
  margin: -4px 0 0 -3px;
  background: linear-gradient(135deg, #F3E2AE, #C59E52 60%, #9A7533);
  -webkit-clip-path: polygon(50% 0, 100% 40%, 70% 100%, 0 70%);
  clip-path: polygon(50% 0, 100% 40%, 70% 100%, 0 70%);
  opacity: 0;
  animation: flake 1.15s var(--ease-out) forwards;
}
@keyframes flake {
  0% { transform: translate(0, 0) rotate(0) scale(0.6); opacity: 0; }
  14% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); opacity: 0; }
}

/* --- Reply card (private note) ---------------------------------------------------- */
.reply-card {
  position: relative;
  margin-top: 48px;
  padding: 36px 22px 26px;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(31, 27, 22, 0.05), 0 22px 40px -24px rgba(102, 76, 30, 0.42);
}
.reply-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--gold-hair);
  pointer-events: none;
}
.reply-mark {
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--gold-line);
  color: var(--gold);
  transform: translate(-50%, -50%);
}
.reply-mark svg { width: 100%; height: 100%; }
.wish-title {
  font-family: var(--serif);
  font-size: 1.62rem;
  font-weight: 500;
  line-height: 1.2;
}
.wish-desc {
  max-width: 34ch;
  margin: 8px auto 22px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-3);
  text-wrap: balance;
}

.wish-form { position: relative; display: grid; gap: 16px; text-align: left; }
.field { position: relative; display: grid; gap: 6px; }
.field-label { padding-left: 2px; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.field input,
.field textarea {
  width: 100%;
  /* 16px minimum: anything smaller makes iOS Safari zoom the page on focus */
  font-size: 16px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--field-line);
  background: #FFFEFB;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* ruled writing lines, aligned to the text */
.field textarea {
  min-height: 132px;
  padding-bottom: 28px;
  resize: vertical;
  /* layer 1 masks the line that would fall in the top padding; layer 2 is one rule per text line */
  background-image: linear-gradient(#FFFEFB, #FFFEFB), linear-gradient(180deg, transparent calc(100% - 1px), rgba(197, 160, 89, 0.28) 0);
  background-size: 100% 13px, calc(100% - 28px) 1.6em;
  background-position: 0 0, 14px 12px;
  background-repeat: no-repeat, repeat-y;
  background-attachment: local, local;
}
.field input:focus,
.field textarea:focus { border-color: var(--gold-text); box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.18); }
.field-count {
  position: absolute;
  right: 10px;
  bottom: 6px;
  padding: 0 4px;
  background: #FFFEFB;
  font-size: 0.72rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.field.is-invalid input,
.field.is-invalid textarea { border-color: #B4533C; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error {
  padding: 10px 12px;
  border-radius: 6px;
  background: #FBF0EC;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #9A3F2B;
}

.wish-success { padding: 4px 0 0; outline: none; }
.wish-success-mark { display: block; width: 76px; height: 76px; margin: 0 auto 12px; }
.wish-success-mark img { width: 100%; height: 100%; }
.wish-success:not([hidden]) .wish-success-mark { animation: stamp 0.6s var(--ease-out) both; }
@keyframes stamp {
  0% { transform: scale(1.5) rotate(-10deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(0); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.wish-success-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.wish-success-text { max-width: 32ch; margin: 6px auto 4px; font-size: 0.92rem; color: var(--ink-2); }

/* --- Gift: a small enclosure, collapsed by default ------------------------------- */
.gift { margin-top: 40px; }
.gift-details { max-width: 360px; margin: 0 auto; }
.gift-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px;
  list-style: none;
  cursor: pointer;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.gift-summary::-webkit-details-marker { display: none; }
.gift-summary::marker { content: ""; }
.gift-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--gold-text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease-out);
}
.gift-details[open] .gift-chevron { transform: rotate(180deg); }
.gift-body {
  position: relative;
  margin-top: 12px;
  padding: 26px 22px 18px;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(31, 27, 22, 0.05), 0 16px 30px -20px rgba(102, 76, 30, 0.4);
  animation: giftIn 0.45s var(--ease-out);
}
.gift-body::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold-hair);
  pointer-events: none;
}
@keyframes giftIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.gift-text { font-size: 0.9rem; line-height: 1.55; color: var(--ink-2); text-wrap: balance; }
.gift-info { margin: 16px 0 14px; display: grid; gap: 10px; text-align: left; }
.gift-row {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold-hair);
}
.gift-row:last-child { border-bottom: 0; padding-bottom: 0; }
.gift-row dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.gift-row dd { font-size: 1rem; font-weight: 500; color: var(--ink); }
.gift-row .gift-iban {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.04em;
  word-spacing: 0.1em;
  /* one line from ~380px up; on narrower phones two even lines instead of a lone "23" */
  text-wrap: balance;
  -webkit-user-select: all;
  user-select: all;
}
/* EUR | TRY | Crypto: a small paper switch; the details below follow it */
.gift-switch {
  display: flex;
  width: fit-content;
  gap: 2px;
  margin: 16px auto 0;
  padding: 3px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: var(--paper-2);
}
.gift-cur {
  min-width: 64px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.gift-cur[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 0.5px var(--gold-line), 0 2px 8px -4px rgba(102, 76, 30, 0.35);
}
.gift-cur:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.gift-dt-note { color: var(--ink-3); }

.gift-wallet dt { text-wrap: balance; }
.gift-wallet-line { display: flex; align-items: center; gap: 10px; }
.gift-row .gift-addr {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  word-break: break-all;
  text-wrap: balance;
  -webkit-user-select: all;
  user-select: all;
}
.gift-copy {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--gold-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.gift-copy:active { transform: scale(0.92); }
.gift-copy:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gift-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gift-row .gift-wallet-note { margin-top: 2px; font-size: 0.78rem; font-weight: 400; line-height: 1.45; color: var(--ink-3); }

.gift-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gift-hint { margin-top: 6px; font-size: 0.8rem; line-height: 1.5; color: var(--ink-3); text-wrap: balance; }

/* --- Footer: the seal returns, blind-embossed into the paper --------------------- */
.footer { margin-top: 60px; display: flex; flex-direction: column; align-items: center; }
.footer-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.18rem;
  color: var(--ink-2);
  text-wrap: balance;
}
.footer-seal { width: 92px; height: 92px; margin: 12px 0 4px; }
.footer-date {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  color: var(--ink-3);
}

/* ==========================================================================
   STORY SHEET & TOAST
   ========================================================================== */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(31, 27, 22, 0.55);
  animation: fade 0.25s ease both;
}
.sheet-panel {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  max-height: 92svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px var(--gutter) calc(var(--safe-bottom) + 18px);
  border-radius: 22px 22px 0 0;
  background: var(--ivory);
  text-align: center;
  animation: sheetUp 0.35s var(--ease-out) both;
}
.sheet-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.sheet-text { max-width: 34ch; margin: 4px auto 14px; font-size: 0.88rem; color: var(--ink-2); }
.sheet-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 56vh;
  max-height: 56svh;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(31, 27, 22, 0.04), 0 12px 32px -14px rgba(102, 76, 30, 0.22);
  -webkit-touch-callout: default;
}
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 22px);
  z-index: 90;
  max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.92);
  color: var(--ivory);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.3s var(--ease-out);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   ORNAMENT MOTION
   Content is always visible. Only ornaments wait for their section to scroll
   into view ([data-reveal].is-visible, set by script.js).
   ========================================================================== */
.js .medal-draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-out) 0.1s; }
.js .medal-core { opacity: 0; transition: opacity 0.6s ease 1.1s; }
.js .crest-rule,
.js .divider-line { transform: scaleX(0); transition: transform 1s var(--ease-out) 0.15s; }
.js .divider-star { opacity: 0; transform: rotate(-45deg) scale(0.6); transition: opacity 0.6s ease, transform 1s var(--ease-out); }

.is-visible .medal-draw { stroke-dashoffset: 0; }
.is-visible .medal-core { opacity: 1; }
.is-visible .crest-rule,
.is-visible .divider-line,
.divider.is-visible .divider-line { transform: none; }
.is-visible .divider-star,
.divider.is-visible .divider-star { opacity: 1; transform: none; }
.hero.is-visible .foil { animation: foilSheen 2.4s var(--ease-in-out) 0.5s both, foilDrift 7s ease-in-out 3.2s infinite alternate; }
@keyframes foilDrift {
  from { background-position: 46% 50%; }
  to { background-position: 64% 50%; }
}
/* outside the gilt sheet (no travelling light) stars turn on their own slow beat */
.divider.is-visible .divider-star { animation: starTurn 8s var(--ease-in-out) 1.6s infinite; }
@keyframes starTurn {
  0%, 84% { transform: none; color: var(--gold); }
  92% { transform: rotate(22.5deg) scale(1.14); color: #E2C27C; }
  100% { transform: rotate(45deg); color: var(--gold); }
}
@keyframes foilSheen {
  from { background-position: 100% 50%; }
  to { background-position: 46% 50%; }
}

/* ==========================================================================
   SMALL, SHORT & LANDSCAPE SCREENS
   ========================================================================== */
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .section-label { letter-spacing: 0.14em; padding-left: 0.14em; }
  .section-label::before, .section-label::after { display: none; }
  .cover { padding-left: 14px; padding-right: 14px; }
  .families { grid-template-columns: 1fr 1fr; gap: 6px; }
  .families-sep { display: none; }
  .family-parents { font-size: 1.02rem; }
  .family-label { letter-spacing: 0.1em; padding-left: 0.1em; }
  .date-day { font-size: 4.4rem; padding: 0 10px; }
  .date-side { font-size: 0.72rem; letter-spacing: 0.14em; }
  .countdown-num { font-size: 2.1rem; }
  .countdown-label { letter-spacing: 0.06em; padding-left: 0.06em; }
  .control-pill { padding: 0 12px; }
}

/* Android with browser bars ≈ 360×640: the whole card should stay one screen */
@media (max-height: 700px) {
  .cover { padding-top: 22px; padding-bottom: 24px; }
  .crest { margin-bottom: 10px; }
  .guest-line { margin-top: 12px; }
  .couple { margin: 18px 0 16px; }
  .couple-name { font-size: clamp(2.7rem, 13.6vw, 3.6rem); }
  .families { margin-top: 22px; }
}

@media (max-height: 640px) {
  .intro { padding-top: calc(var(--safe-top) + 58px); }
  .intro-guest { margin-bottom: 14px; }
  .envelope { --w: min(70vw, 270px); margin: 28px 0 18px; }
}

/* Landscape phones (≈ 844×390, Safari ≈ 340px tall): text beside the envelope */
@media (max-height: 480px) and (orientation: landscape) {
  .intro {
    padding: calc(var(--safe-top) + 54px) max(var(--gutter), env(safe-area-inset-right, 0px)) 14px max(var(--gutter), env(safe-area-inset-left, 0px));
  }
  .intro-inner { flex-direction: row; justify-content: center; gap: 36px; max-width: 780px; }
  .intro-head { flex: 1 1 0; max-width: 360px; }
  .intro-guest { margin-bottom: 12px; }
  .envelope { --w: min(46vw, 340px, calc((var(--vh) - 128px) * 1.5)); margin: 0 0 12px; }
}

@media (min-width: 600px) {
  .hero { margin-left: -8px; margin-right: -8px; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .seal-glint { display: none; }
  .intro.is-leaving { transition: opacity 0.4s ease, visibility 0s linear 0.4s !important; }
  .cd-slot .cd-out { display: none; }
}
