/* ==========================================================================
   Invitación de papel · estilos
   Mobile-first. Los colores base se sobrescriben desde config.js (theme).
   ========================================================================== */

@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Pinyon"; src: url("../fonts/pinyon-script-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #F3ECE0;
  --ink: #2B2620;
  --olive: #5B6B4A;
  --terra: #B5623E;

  --paper-lite: color-mix(in srgb, var(--paper), #fff 45%);
  --paper-deep: color-mix(in srgb, var(--paper), var(--ink) 7%);
  --ink-80: color-mix(in srgb, var(--ink), var(--paper) 18%);
  --ink-60: color-mix(in srgb, var(--ink), var(--paper) 34%);
  --line: color-mix(in srgb, var(--ink), transparent 72%);
  --line-soft: color-mix(in srgb, var(--ink), transparent 84%);
  --terra-deep: color-mix(in srgb, var(--terra), #000 30%);

  --serif: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --script: "Pinyon", "Snell Roundhand", cursive;
  --gutter: 22px;
  --ease: cubic-bezier(.22, .7, .2, 1);

  /* Grano de papel (feTurbulence) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .14 0 0 0 0 .1 0 0 0 .42 -.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .04' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .2 -.075'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.rm { scroll-behavior: auto; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--grain), var(--fibers);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html.js:not(.opened) body { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
p { margin: 0 0 .8em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--olive), transparent 70%); }

:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 1px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.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; }

.script { font-family: var(--script); font-weight: 400; font-style: normal; line-height: 1.1; }
.sc, .kicker {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  line-height: 1.4;
  font-variant-numeric: lining-nums;
}
.kicker { color: var(--olive); margin: 0 0 .5em; }
.muted { color: var(--ink-60); margin-bottom: .3em; }

/* ---------- Marco doble de papelería ---------- */
.frame {
  position: relative;
  background: color-mix(in srgb, var(--paper-lite), transparent 35%);
  border: 1px solid var(--line);
  outline: 1px solid var(--line-soft);
  outline-offset: -7px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
  min-height: 50px; padding: 12px 20px;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-weight: 600; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s, color .25s;
}
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--ink); color: var(--paper); outline: 1px solid color-mix(in srgb, var(--paper), transparent 60%); outline-offset: -5px; }
.btn-solid:hover { background: var(--olive); border-color: var(--olive); }
.btn-solid:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
.link { background: none; border: 0; padding: 6px 0; font-style: italic; font-size: 18px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; cursor: pointer; color: var(--ink-80); }

/* ==========================================================================
   INTRO · SOBRE
   ========================================================================== */
.intro { display: none; }
html.js:not(.opened) .intro {
  display: flex;
  position: fixed; inset: 0; z-index: 50;
  align-items: center; justify-content: center;
  background-color: var(--paper);
  background-image: var(--grain), var(--fibers), radial-gradient(ellipse at 50% 45%, transparent 40%, color-mix(in srgb, var(--ink), transparent 90%) 100%);
  transition: opacity .8s ease;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro-stage { display: flex; flex-direction: column; align-items: center; gap: 34px; transition: transform .9s var(--ease); padding-top: 8vh; }
.intro.is-leaving .intro-stage { transform: translateY(-10px) scale(1.03); }

.intro-skip {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px;
  min-height: 44px; padding: 10px 14px;
  background: none; border: 0; cursor: pointer;
  font-weight: 600; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-60);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line);
}
.intro-skip:hover { color: var(--ink); }

.intro-hint {
  margin: 0; font-style: italic; font-size: 21px; color: var(--ink-80);
  animation: breathe 2.8s ease-in-out infinite;
  transition: opacity .4s;
}
.envelope.is-open ~ .intro-hint { opacity: 0; animation: none; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.envelope {
  position: relative;
  width: min(84vw, 440px);
  aspect-ratio: 3 / 2;
  padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
  animation: float 5s ease-in-out infinite;
}
.envelope.is-open { animation: none; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-5px) rotate(.4deg); } }
.envelope:focus-visible { outline-offset: 10px; }

.env-back, .env-letter, .env-pocket, .env-flap, .env-seal { position: absolute; }
.env-back {
  inset: 0; border-radius: 3px;
  background-color: color-mix(in srgb, var(--paper), #8a6a3e 13%);
  background-image: var(--grain);
  box-shadow: 0 26px 40px -28px rgba(43, 38, 32, .55), 0 2px 3px rgba(43, 38, 32, .08);
}
.env-letter {
  left: 6%; right: 6%; top: 5%; bottom: 6%; z-index: 2;
  background-color: var(--paper-lite); background-image: var(--grain);
  border: 1px solid var(--line-soft);
  outline: 1px solid var(--line-soft); outline-offset: -6px;
  transition: transform 1s var(--ease);
}
.env-letter-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 9%; text-align: center; }
.env-letter .sc { font-size: 9px; color: var(--olive); }
.env-names { font-size: clamp(26px, 8.4vw, 40px); color: var(--ink); }
.env-date { font-style: italic; font-size: 14px; color: var(--ink-60); letter-spacing: .08em; }

.env-pocket { inset: 0; width: 100%; height: 100%; z-index: 3; overflow: visible; }
.pocket-fill { fill: color-mix(in srgb, var(--paper), #8a6a3e 9%); stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pocket-line { fill: none; stroke: color-mix(in srgb, var(--ink), transparent 85%); stroke-width: 1; vector-effect: non-scaling-stroke; }

.env-flap {
  top: 0; left: 0; width: 100%; height: 60%; z-index: 4;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform .85s cubic-bezier(.55, .05, .3, 1), z-index 0s .5s;
}
.env-flap svg { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: visible; }
.flap-front path { fill: color-mix(in srgb, var(--paper), #8a6a3e 15%); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.flap-front { filter: drop-shadow(0 3px 2px rgba(43, 38, 32, .12)); }
.flap-back { transform: rotateX(180deg); }
.flap-back path { fill: color-mix(in srgb, var(--paper), #8a6a3e 22%); }

.env-seal {
  left: 50%; top: 60%; width: 24%; z-index: 5;
  transform: translate(-50%, -50%) rotate(-6deg);
  filter: drop-shadow(0 3px 3px rgba(60, 25, 10, .3));
  transition: transform .4s var(--ease), opacity .35s ease;
}
.envelope:hover .env-seal { transform: translate(-50%, -50%) rotate(-3deg) scale(1.04); }

/* Secuencia de apertura */
.envelope.is-open .env-seal { opacity: 0; transform: translate(-50%, -38%) rotate(-14deg) scale(.82); }
.envelope.is-open .env-flap { transform: rotateX(180deg); z-index: 1; transition-delay: .2s, .62s; }
.envelope.is-open .env-letter { transform: translateY(-56%); transition-delay: .95s; }

/* Sello de lacre */
.seal .seal-wax { fill: var(--terra); }
.seal .seal-ring { fill: none; stroke: color-mix(in srgb, var(--terra), #000 28%); stroke-width: 1.6; }
.seal .seal-dots { fill: none; stroke: color-mix(in srgb, var(--terra), #000 22%); stroke-width: 1.2; stroke-dasharray: .5 4.2; stroke-linecap: round; }
.seal .seal-shine { fill: none; stroke: color-mix(in srgb, var(--terra), #fff 45%); stroke-width: 2.2; stroke-linecap: round; opacity: .55; }
.seal .seal-text { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 30px; fill: color-mix(in srgb, var(--terra), #000 35%); }
.seal .seal-text-hi { fill: color-mix(in srgb, var(--terra), #fff 35%); opacity: .55; }

/* ==========================================================================
   PORTADA
   ========================================================================== */
.cover { min-height: 100vh; min-height: 100svh; padding: 14px; display: flex; }
.cover-frame {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 18px 64px;
  text-align: center;
  border: 1px solid var(--line);
  outline: 1px solid var(--line-soft); outline-offset: -8px;
  overflow: hidden;
}
.olive { color: var(--olive); position: absolute; pointer-events: none; }
.olive-tl { width: 220px; height: 74px; top: 22px; left: -26px; transform: rotate(-8deg); }
.olive-br { width: 220px; height: 74px; bottom: 26px; right: -30px; transform: rotate(172deg); }

.names { margin: .1em 0 .15em; font-family: var(--script); font-weight: 400; line-height: .9; display: flex; flex-direction: column; color: var(--ink); }
.names:focus { outline: none; }
.names .n1, .names .n2 { font-size: clamp(66px, min(21vw, 15.5vh), 150px); }
.names .n1 { transform: translateX(-9%); }
.names .n2 { transform: translateX(10%); margin-top: -.12em; }
.names .amp { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(34px, 9vw, 64px); color: var(--terra); line-height: 1; margin: -.05em 0 -.1em; }
.cover-invite { font-style: italic; font-size: 21px; color: var(--ink-80); margin-bottom: 28px; }

.cover-meta { margin-bottom: 30px; }
.roman { font-style: italic; font-size: 28px; letter-spacing: .14em; color: var(--olive); margin-bottom: .1em; font-variant-numeric: normal; }
.cover-date { margin-bottom: .2em; font-size: 18px; }
.cover-place { color: var(--ink-60); font-size: 11.5px; }

/* Ticket de cuenta atrás */
.ticket {
  --notch: 9px;
  position: relative;
  padding: 14px 18px 16px;
  background: var(--paper-lite);
  border: 1px solid var(--line);
  -webkit-mask: radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.ticket::before { content: ""; position: absolute; inset: 5px 14px; border: 1px dashed var(--line-soft); pointer-events: none; }
.ticket-title { font-size: 10.5px; color: var(--terra-deep); margin-bottom: 6px; }
.ticket-row { display: flex; justify-content: center; }
.stub { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 0 8px; }
.stub + .stub { border-left: 1px dashed var(--line); }
.stub .num { font-weight: 600; font-size: 30px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.stub .lbl { font-style: italic; font-size: 14px; color: var(--ink-60); }

.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-60); }
.scroll-cue .sc { font-size: 10px; }
.scroll-cue svg { width: 12px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; }
html:not(.rm) .scroll-cue svg { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ==========================================================================
   SECCIONES · estructura editorial
   ========================================================================== */
.section { max-width: 1080px; margin: 0 auto; padding: 96px var(--gutter) 40px; }
.sec-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.sec-num {
  font-style: italic; font-weight: 500; font-size: 58px; line-height: .8;
  color: var(--olive); min-width: 1.1em;
  padding-right: 14px; border-right: 1px solid var(--line);
  font-variant-numeric: normal;
}
.sec-head h2 { margin: 0; font-weight: 400; font-style: italic; font-size: clamp(36px, 9.5vw, 60px); line-height: 1.02; letter-spacing: -.01em; }
.lede { font-style: italic; font-size: 21px; line-height: 1.45; color: var(--ink-80); max-width: 32ch; margin-bottom: 44px; }

/* ---------- I · Historia ---------- */
.story-list { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.story-list::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 40px; border-left: 1px dashed var(--line); }
.story-item { position: relative; margin-bottom: 64px; }
.story-item::before { content: ""; position: absolute; left: -26px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1px solid var(--olive); }
.story-year { font-style: italic; font-size: 26px; color: var(--terra); line-height: 1; margin-bottom: 14px; font-variant-numeric: lining-nums; }
.story-item h3 { font-weight: 600; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; margin: 22px 0 6px; }
.story-item p { max-width: 34ch; }

.polaroid {
  --r: -2.2deg;
  position: relative; margin: 0;
  width: min(100%, 300px);
  padding: 11px 11px 14px;
  background: color-mix(in srgb, var(--paper), #fff 70%);
  box-shadow: 0 1px 1px rgba(43, 38, 32, .08), 0 14px 26px -18px rgba(43, 38, 32, .5);
  transform: rotate(var(--r));
}
.story-item:nth-child(even) .polaroid { --r: 1.8deg; }
.story-item:nth-child(3n) .polaroid { --r: -1deg; }
.polaroid::before { /* cinta washi */
  content: ""; position: absolute; top: -10px; left: 50%; width: 84px; height: 22px;
  transform: translateX(-50%) rotate(calc(var(--r) * -2));
  background: color-mix(in srgb, var(--terra), transparent 74%);
  -webkit-mask: linear-gradient(90deg, #0000 0 2px, #000 2px calc(100% - 2px), #0000 0);
}
.polaroid .ph { aspect-ratio: 5 / 4; background: color-mix(in srgb, var(--olive), var(--paper) 86%); color: color-mix(in srgb, var(--olive), var(--ink) 35%); display: grid; place-items: center; overflow: hidden; }
.polaroid .ph svg { width: 82%; height: auto; }
.polaroid .ph img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.15); }
.polaroid figcaption { font-style: italic; font-size: 16px; color: var(--ink-60); padding: 8px 4px 0; }

/* ---------- II · Horario ---------- */
.schedule { position: relative; }
.schedule-line { position: absolute; left: 25px; top: 0; height: 100%; width: 12px; overflow: visible; }
.schedule-line path { fill: none; stroke: var(--olive); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: var(--draw, 1); }
html.rm .schedule-line path, html:not(.js) .schedule-line path { stroke-dashoffset: 0; }
.schedule-list { list-style: none; margin: 0; padding: 0; }
.slot { display: grid; grid-template-columns: 62px 1fr; gap: 0 18px; padding-bottom: 54px; }
.slot .slot-icon { grid-column: 1; grid-row: 1 / span 2; }
.slot .slot-time, .slot .slot-body { grid-column: 2; }
.slot-icon { transition: border-color .5s, color .5s; color: var(--ink-60); }
.slot.lit .slot-icon { border-color: var(--olive); color: var(--olive); }
.stub-done { margin: 0; font-style: italic; font-size: 26px; color: var(--terra-deep); }
.slot:last-child { padding-bottom: 8px; }
.slot-icon {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--ink); position: relative; z-index: 1;
}
.slot-icon::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid var(--line-soft); }
.slot-icon svg { width: 34px; height: 34px; }
.slot-time { font-style: italic; font-weight: 500; font-size: 38px; line-height: 1; color: var(--terra); font-variant-numeric: lining-nums; margin: 4px 0 6px; }
.slot h3 { margin: 0 0 4px; font-weight: 600; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.slot p { max-width: 30ch; color: var(--ink-80); }

/* ---------- III · Cómo llegar ---------- */
.place-grid { display: grid; gap: 22px; }
.card { padding: 30px 26px; }
address { font-style: italic; font-size: 22px; line-height: 1.35; margin-bottom: 22px; }
.place-notes { display: grid; gap: 18px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.place-notes p:last-child { margin: 0; }
.map { padding: 8px; aspect-ratio: 4 / 3.4; display: grid; }
.map iframe, .map-placeholder { grid-area: 1 / 1; width: 100%; height: 100%; border: 0; }
.map iframe { filter: sepia(.32) saturate(.75) contrast(1.02); }
.map-placeholder { display: grid; place-items: center; margin: 0; color: var(--ink-60); background: var(--paper-deep); }

/* ---------- IV · Dress code ---------- */
.swatches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px 10px; }
.swatch { width: calc(33.33% - 7px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.swatch:nth-child(even) { transform: translateY(16px); }
.swatch svg { width: 100%; max-width: 104px; aspect-ratio: 1; overflow: visible; }
.swatch span { font-style: italic; font-size: 17px; margin-top: 2px; }

/* ---------- V · RSVP ---------- */
.rsvp-card { padding: 34px 24px 30px; }
.field { margin: 0 0 26px; border: 0; padding: 0; min-width: 0; }
.field > label, legend { display: block; padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-80); }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; font-size: 15px; }
input[type=text], input[type=number], textarea {
  width: 100%; font: inherit; font-style: italic; font-size: 21px; color: var(--ink);
  padding: 8px 2px 9px; background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink), transparent 58%); }
input[type=text]:focus, input[type=number]:focus, textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 1px 0 var(--olive); }
input[type=text]:focus-visible, textarea:focus-visible { outline: none; }
[aria-invalid=true] { border-color: var(--terra-deep) !important; box-shadow: 0 1px 0 var(--terra-deep) !important; }
.err { margin: 6px 0 0; min-height: 0; font-style: italic; font-size: 16.5px; color: var(--terra-deep); }
.err:empty { display: none; }
.err:not(:empty)::before { content: "— "; }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px; text-align: center;
  font-style: italic; font-size: 20px;
  border: 1px solid var(--line); background: transparent;
  transition: border-color .2s, background-color .2s, color .2s;
}
.opt span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1px solid currentColor; flex: none; transition: background-color .2s; }
.opt input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.opt input:checked + span::before { background: var(--terra); border-color: var(--terra); }
.opt input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 3px; }
.choice.is-invalid .opt span { border-color: var(--terra-deep); }

.if-yes { animation: unfold .45s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); }
.stepper button { width: 48px; min-height: 48px; border: 0; background: none; font-size: 24px; cursor: pointer; line-height: 1; }
.stepper button:hover { background: var(--paper-deep); }
.stepper input { width: 56px; text-align: center; border: 0; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); font-style: normal; font-variant-numeric: lining-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: inset 0 -2px 0 var(--olive); }

.check { display: flex; gap: 12px; align-items: center; margin: -4px 0 26px; cursor: pointer; font-style: italic; font-size: 19px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1px solid var(--ink-60); background: transparent; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ""; width: 10px; height: 5px; border-left: 1.5px solid var(--paper); border-bottom: 1.5px solid var(--paper); transform: translateY(-1px) rotate(-45deg); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#rsvp-submit { width: 100%; margin-top: 4px; }
#rsvp-submit[aria-busy=true] { opacity: .7; cursor: progress; }
.err-global { text-align: center; }

.rsvp-done { text-align: center; padding: 10px 0; }
.rsvp-done:focus { outline: none; }
.seal-stamp { width: 112px; margin: 0 auto 6px; filter: drop-shadow(0 4px 4px rgba(60, 25, 10, .25)); }
.seal-check { fill: none; stroke: var(--paper); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.rsvp-done.play .seal-stamp { animation: stamp .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.rsvp-done.play .seal-check { animation: draw .55s .55s ease forwards; }
.rsvp-done.play .done-title, .rsvp-done.play .done-text, .rsvp-done.play .done-demo, .rsvp-done.play .link { animation: rise .7s .7s var(--ease) both; }
html.rm .seal-check { stroke-dashoffset: 0; }
@keyframes stamp { from { opacity: 0; transform: scale(1.8) rotate(-18deg); } 60% { opacity: 1; } to { transform: scale(1) rotate(-4deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.done-title { font-size: 54px; margin: 0 0 .1em; }
.done-text { font-style: italic; font-size: 21px; max-width: 28ch; margin: 0 auto 14px; }
.done-demo { font-size: 10.5px; color: var(--terra-deep); margin-bottom: 18px; }

/* ---------- VI · Regalo ---------- */
.gift-card { padding: 30px 26px; text-align: left; max-width: 520px; }
.gift-holder { font-style: italic; font-size: 20px; margin-bottom: 18px; }
.iban { font-weight: 600; font-size: clamp(16px, 4.9vw, 22px); white-space: nowrap; letter-spacing: .03em; font-variant-numeric: lining-nums tabular-nums; margin-bottom: 20px; word-spacing: .1em; }
.gift-note { font-style: italic; font-size: 15.5px; color: var(--ink-60); margin: 16px 0 0; }
#copy-iban.is-done { background: var(--olive); border-color: var(--olive); color: var(--paper); }

/* ---------- VII · FAQ como notas dobladas ---------- */
.notes { display: grid; gap: 18px; }
.note {
  --fold: 22px; --r: -.5deg;
  position: relative;
  background: linear-gradient(225deg, transparent calc(var(--fold) * .7071), var(--paper-lite) 0);
  transform: rotate(var(--r));
  filter: drop-shadow(0 6px 8px rgba(43, 38, 32, .07)) drop-shadow(0 1px 1px rgba(43, 38, 32, .08));
}
.note:nth-child(even) { --r: .6deg; margin-left: 10px; }
.note:nth-child(3n) { --r: -.2deg; }
.note::before { /* esquina doblada */
  content: ""; position: absolute; top: 0; right: 0; width: var(--fold); height: var(--fold);
  background: linear-gradient(45deg, color-mix(in srgb, var(--paper), var(--ink) 12%) 50%, transparent 50%);
}
.note summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 40px 20px 22px; min-height: 56px;
  font-style: italic; font-size: 22px; line-height: 1.25;
}
.note summary::-webkit-details-marker { display: none; }
.note summary:focus-visible { outline-offset: -4px; }
.plus { position: relative; flex: none; width: 14px; height: 14px; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 50%; width: 14px; border-top: 1.3px solid var(--olive); transition: transform .35s var(--ease); }
.plus::after { transform: rotate(90deg); }
.note[open] .plus::after { transform: rotate(0); }
.note .answer { padding: 0 26px 22px 22px; color: var(--ink-80); border-top: 1px dashed var(--line-soft); margin: 0 22px; padding-left: 0; padding-right: 0; padding-top: 14px; }
.note[open] .answer { animation: unfold .4s var(--ease); }
.note .answer p { margin: 0; }

/* ---------- Pie ---------- */
.footer { position: relative; text-align: center; padding: 120px var(--gutter) 120px; display: flex; flex-direction: column; align-items: center; }
.olive-foot { position: relative; width: 190px; height: 64px; margin-bottom: 4px; transform: rotate(-4deg); }
.footer-title { font-size: clamp(64px, 18vw, 120px); margin: 0; color: var(--ink); }
.footer-sub { font-style: italic; font-size: 21px; color: var(--ink-80); margin-bottom: 30px; }
.footer-sign { margin-top: 56px; color: var(--ink-60); font-size: 11px; }

/* ---------- Banner de muestra ---------- */
.demo-banner {
  position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  padding: 6px 12px; white-space: nowrap;
  font-weight: 600; font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-80);
  background: color-mix(in srgb, var(--paper-lite), transparent 8%);
  border: 1px solid var(--line-soft);
  text-decoration: none;
  transition: opacity .3s;
}
.demo-banner[hidden] { display: none; }
a.demo-banner:hover { color: var(--ink); border-color: var(--line); }

/* ---------- Entradas suaves ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .names.reveal.in .n1 { transform: translateX(-9%); }

/* ==========================================================================
   ESCRITORIO
   ========================================================================== */
@media (min-width: 760px) {
  body { font-size: 20px; }
  :root { --gutter: 40px; }
  .cover { padding: 22px; }
  .cover-frame { padding: 90px 40px; outline-offset: -10px; }
  .olive-tl { width: 360px; height: 120px; top: 34px; left: -30px; }
  .olive-br { width: 360px; height: 120px; bottom: 40px; right: -40px; }
  .scroll-cue { display: flex; }
  .stub { min-width: 86px; }
  .stub .num { font-size: 40px; }

  .section { padding-top: 150px; }
  .sec-num { font-size: 86px; }
  .sec-head--right { justify-content: flex-end; text-align: right; margin-left: auto; }
  .sec-head--right .sec-num { order: 2; border-right: 0; border-left: 1px solid var(--line); padding: 0 0 0 18px; }
  .sec-head--right + .lede { margin-left: auto; text-align: right; }

  /* Historia: zigzag */
  .story-list { padding: 0; }
  .story-list::before { left: 50%; }
  .story-item { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-bottom: 90px; }
  .story-item::before { left: calc(50% - 4px); top: 50%; }
  .story-item .polaroid { justify-self: end; }
  .story-item .story-text { padding-top: 0; }
  .story-item:nth-child(even) .polaroid { order: 2; justify-self: start; }
  .story-item:nth-child(even) .story-text { text-align: right; justify-self: end; }
  .story-item:nth-child(even) .story-text p { margin-left: auto; }

  /* Horario centrado */
  .schedule-line { left: calc(50% - 6px); }
  .slot { grid-template-columns: 1fr 72px 1fr; gap: 30px; align-items: start; }
  .slot .slot-icon { width: 72px; height: 72px; grid-column: 2; grid-row: 1; }
  .slot .slot-time { grid-column: 1; grid-row: 1; text-align: right; font-size: 50px; margin-top: 8px; }
  .slot .slot-body { grid-column: 3; grid-row: 1; padding-top: 10px; }
  .slot:nth-child(even) .slot-time { grid-column: 3; text-align: left; }
  .slot:nth-child(even) .slot-body { grid-column: 1; text-align: right; }
  .slot:nth-child(even) .slot-body p { margin-left: auto; }

  .place-grid { grid-template-columns: 5fr 7fr; gap: 30px; align-items: stretch; }
  .place-notes { grid-template-columns: 1fr; }
  .map { aspect-ratio: auto; min-height: 460px; transform: rotate(.6deg); }

  .dress .swatches { justify-content: flex-end; gap: 10px 26px; }
  .swatch { width: 120px; }

  .rsvp-card { max-width: 640px; padding: 50px 56px 44px; margin-left: 8%; }
  .gift-card { margin-left: auto; margin-right: 6%; padding: 40px 44px; }
  .notes { max-width: 720px; margin-left: 4%; }
  .note:nth-child(even) { margin-left: 46px; }
}
@media (min-width: 1100px) {
  .cover-frame { padding: 100px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html.js .reveal { opacity: 1; transform: none; }
}
