/* Hallmark · pre-emit critique: P5 H5 E4 S5 R4 V5
 * macrostructure: still, handed clip, end still, then the card unfolds
 * theme: custom stationery · paper light · roman serif · warm seal
 * audience: invitados · use: confirmar o declinar, reservar y bajar el PDF · tone: joyful luxury
 */

:root {
  color-scheme: light;
  --paper: oklch(97.2% 0.014 88);
  --paper-2: oklch(94% 0.02 86);
  --cloth: oklch(86% 0.028 78);
  --cloth-light: oklch(91% 0.024 82);
  --ink: oklch(27% 0.03 48);
  --ink-soft: oklch(40% 0.024 52);
  --on-film: oklch(97% 0.012 88);
  --scrim: oklch(24% 0.03 42 / 0.78);
  --rule: oklch(48% 0.04 62);
  --seal: oklch(38% 0.11 24);
  --seal-hover: oklch(32% 0.11 24);
  --seal-loading: oklch(46% 0.09 24);
  --seal-ink: oklch(97% 0.01 88);
  --blush: oklch(78% 0.07 18);
  --petal: oklch(84% 0.07 12);
  --leaf: oklch(58% 0.07 145);
  --focus: oklch(38% 0.11 24);
  --error: oklch(42% 0.14 22);
  --shadow: oklch(30% 0.03 50 / 0.18);
  --font-display: "Cormorant Garamond", Palatino, "Palatino Linotype", "Times New Roman", serif;
  --font-ui: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
}

[hidden] {
  display: none !important;
}

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

html,
body {
  overflow-x: clip;
  margin: 0;
}

html {
  background: var(--cloth);
}

body {
  min-height: 100vh;
  padding: var(--space-4) var(--space-2) var(--space-6, 4rem);
  background:
    radial-gradient(ellipse at 50% 0%, var(--cloth-light), transparent 58%),
    var(--cloth);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.5;
}

img,
video {
  max-width: 100%;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
  margin: 0;
}

h1,
h2 {
  font-style: normal;
  font-weight: 600;
}

.skip {
  position: absolute;
  left: var(--space-2);
  top: 0;
  transform: translateY(-120%);
  background: var(--paper);
  color: var(--ink);
  padding: var(--space-1) var(--space-2);
  z-index: 5;
}

.skip:focus {
  transform: none;
}

.suite {
  width: min(100%, 40rem);
  margin: 0 auto;
}

.menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.tab,
.carousel-bar button,
.step,
.btn,
.ghost {
  font-family: var(--font-ui);
}

.tab {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-1);
  border: 1px solid oklch(52% 0.04 70 / 0.55);
  border-radius: 0.55rem 0.55rem 0 0;
  background: oklch(97.2% 0.014 88 / 0.35);
  color: var(--ink);
  font: 600 0.95rem/1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.tab:hover { background: var(--paper-2); }
.tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.tab:active { transform: translateY(1px); }
.tab[aria-selected="true"],
.tab.is-current,
.tab[aria-current="page"] {
  background: var(--paper);
  border-bottom-color: var(--paper);
  box-shadow: inset 0 -2px 0 var(--seal);
}

.entrega {
  background: var(--paper);
  box-shadow: 0 16px 32px var(--shadow);
  padding: var(--space-2);
}

.stage {
  position: relative;
  aspect-ratio: 1060 / 1080;
  overflow: hidden;
  background: var(--paper-2);
}

.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--paper-2);
}

.stage-fin {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.entrega-actions {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: radial-gradient(
    ellipse at center,
    oklch(22% 0.02 50 / 0.22) 0%,
    oklch(22% 0.02 50 / 0.06) 42%,
    transparent 68%
  );
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.entrega-actions:has(#abrir[hidden]) {
  opacity: 0;
  visibility: hidden;
}
.entrega-actions .btn {
  pointer-events: auto;
}

.carta {
  height: 0;
  overflow: hidden;
  interpolate-size: allow-keywords;
  transition: height 0.8s ease;
}

.carta.is-open {
  height: auto;
}

#sobre[open] {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 3;
  width: 100%;
  max-width: none;
  max-height: 46%;
  margin: 0;
  padding: 0.75rem var(--space-3) 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(
    to top,
    oklch(97.2% 0.014 88 / 0.82),
    oklch(97.2% 0.014 88 / 0.42)
  );
  animation: sobre-veil 0.9s ease both;
}

#sobre[open] .kicker,
#sobre[open] h2,
#sobre[open] .voice,
#sobre[open] .btn {
  animation: sobre-line 0.75s ease both;
}
#sobre[open] h2 { animation-delay: 0.1s; }
#sobre[open] .voice { animation-delay: 0.2s; }
#sobre[open] .btn { animation-delay: 0.34s; }

@keyframes sobre-veil {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sobre-line {
  from {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#sobre h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 500;
  line-height: 0.95;
  color: var(--seal);
}

#sobre .voice {
  max-width: none;
  margin: 0;
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  line-height: 1.2;
}

.btn.soft,
#sobre .btn.soft {
  border-radius: 999px;
  border: 1px solid oklch(38% 0.11 24 / 0.28);
  background: oklch(97.2% 0.014 88 / 0.72);
  color: var(--seal);
  box-shadow: 0 10px 24px oklch(22% 0.02 50 / 0.22);
  backdrop-filter: blur(10px);
}

.btn.soft:hover,
#sobre .btn.soft:hover {
  background: oklch(97.2% 0.014 88 / 0.9);
  border-color: oklch(38% 0.11 24 / 0.45);
  box-shadow: 0 12px 28px oklch(22% 0.02 50 / 0.28);
}

.btn.soft:active,
#sobre .btn.soft:active {
  transform: none;
}

.btn.soft:disabled {
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}

.map-go {
  margin: var(--space-3) 0 0;
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.kicker {
  font: 600 0.75rem/1 var(--font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.voice {
  max-width: 22rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4.4vw, 1.9rem);
  font-weight: 500;
  font-style: normal;
  line-height: 1.25;
}

.fold {
  background: var(--paper);
  box-shadow: 0 16px 28px var(--shadow);
}

.crease {
  height: 1.15rem;
  background:
    linear-gradient(to bottom, oklch(42% 0.04 55 / 0.28), transparent 72%),
    var(--paper-2);
  box-shadow: inset 0 10px 10px -10px oklch(28% 0.04 48 / 0.65);
}

.fold-body {
  position: relative;
  padding: var(--space-4) var(--space-3) var(--space-5);
  text-align: center;
}

.sprig {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto var(--space-2);
}

.sprig circle { fill: var(--blush); }
.sprig circle:nth-child(2),
.sprig circle:nth-child(3) { fill: var(--petal); }
.sprig path {
  stroke: var(--leaf);
  stroke-width: 3;
  fill: none;
}

.when {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 7vw, 2.9rem);
  font-weight: 500;
  line-height: 1.12;
}

.when strong,
.fold h2,
.formal h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: normal;
}

.fold h2 {
  margin-top: var(--space-1);
  font-size: clamp(2.2rem, 8vw, 3rem);
  line-height: 1;
}

.calendar h2 {
  margin-top: var(--space-3);
  font-size: 1.15rem;
  font-weight: 500;
}

.month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  max-width: 15.5rem;
  margin: var(--space-2) auto 0;
  overflow: hidden;
}

.dow,
.day {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 1.65rem;
  font-size: 0.8rem;
  aspect-ratio: 1;
}

.dow {
  color: var(--ink-soft);
  font: 600 0.7rem/1 var(--font-ui);
  letter-spacing: 0.06em;
}

.day { font-variant-numeric: tabular-nums; }

.day.is-event {
  position: relative;
  z-index: 1;
  border-radius: 50%;
  background: transparent;
  color: var(--seal);
  font-weight: 600;
}

.day.is-event::before,
.day.is-event::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.day.is-event::before {
  inset: 1px;
  border: 2px solid var(--seal);
}

.day.is-event::after {
  inset: -4px;
  border: 2px solid var(--seal);
  opacity: 0;
}

.legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.legend i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 2px solid var(--seal);
}

.calendar.is-in .day {
  animation: rise 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 18ms);
}
.calendar.is-in .day.is-event::after {
  animation: halo 1.8s ease-out 0.4s infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes halo {
  0% { transform: scale(0.72); opacity: 0.85; }
  100% { transform: scale(1.55); opacity: 0; }
}

.address {
  margin-top: var(--space-1);
  color: var(--ink-soft);
}

.map-wrap {
  margin: var(--space-3) auto 0;
  max-width: 28rem;
}

.map {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.map text {
  font-family: var(--font-ui);
}

.map-wrap figcaption {
  margin-top: var(--space-1);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.pin {
  transform-origin: center bottom;
  transform-box: fill-box;
}

.signal {
  transform-origin: center;
  transform-box: fill-box;
  opacity: 0;
}

.map-wrap.is-in .signal {
  animation: signal 1.8s ease-out 0.45s infinite;
}

.map-wrap.is-in .pin {
  animation: pin 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

@keyframes pin {
  0% { transform: translateY(-28px); opacity: 0; }
  70% { transform: translateY(3px); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

@keyframes signal {
  0% { transform: scale(0.55); opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0; }
}

.gallery-lead {
  max-width: 22rem;
  margin: var(--space-2) auto 0;
}

#gps img {
  display: block;
  width: 100%;
  height: 11rem;
  object-fit: cover;
}

#gps p {
  margin: var(--space-3) var(--space-3) 0;
  text-align: center;
}

#gps .btn {
  display: block;
  width: calc(100% - 2 * var(--space-3));
  margin: var(--space-3);
}

.carousel {
  margin-top: var(--space-4);
}

.viewport { overflow: hidden; }

.track {
  display: flex;
  transition: transform 0.45s ease;
}

.slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
}

.slide img {
  display: block;
  width: 100%;
  height: 14rem;
  object-fit: cover;
}

.portrait .slide img { height: 22rem; }

.slide figcaption {
  margin-top: var(--space-1);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.carousel-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.carousel-bar button,
.dot {
  min-height: 3rem;
  border: 1px solid oklch(52% 0.04 70 / 0.45);
  border-radius: 999px;
  background: oklch(97.2% 0.014 88 / 0.7);
  color: var(--ink);
  font: 600 0.95rem/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.carousel-bar button { padding: 0 var(--space-2); }
.carousel-bar button:hover,
.dot:hover { background: var(--paper-2); border-color: oklch(52% 0.04 70 / 0.7); }
.carousel-bar button:focus-visible,
.dot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.carousel-bar button:active,
.dot:active { transform: translateY(1px); }

.dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.dot {
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
}

.dot[aria-current="true"] {
  background: oklch(38% 0.11 24 / 0.9);
  border-color: transparent;
  color: var(--seal-ink);
  box-shadow: 0 4px 12px oklch(28% 0.03 50 / 0.12);
}

.reply { text-align: left; }

.reply h2,
.reply-lead,
.note { text-align: center; }

.reply-lead {
  max-width: 28rem;
  margin: var(--space-2) auto var(--space-3);
}

.decision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.note,
.hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.note { margin: var(--space-3) 0 var(--space-2); }

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field label,
.places p { font: 600 0.95rem/1.3 var(--font-ui); }

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font-ui);
}

input:hover { border-color: var(--ink-soft); }
input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[aria-invalid="true"] { border: 2px solid var(--error); }

.error {
  margin: 0;
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
}

.hint { margin: 0; }

.places { display: flex; flex-direction: column; gap: var(--space-1); }

.stepper { display: flex; align-items: center; gap: var(--space-1); }

.step {
  width: 3rem;
  height: 3rem;
  border: 1px solid oklch(52% 0.04 70 / 0.45);
  border-radius: 999px;
  background: oklch(97.2% 0.014 88 / 0.7);
  color: var(--ink);
  font: 600 1.4rem/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.step:hover { background: var(--paper-2); border-color: oklch(52% 0.04 70 / 0.7); }
.step:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.step:active { transform: translateY(1px); }
.step:disabled { opacity: 0.4; cursor: not-allowed; }

output { min-width: 7rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.btn {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: oklch(38% 0.11 24 / 0.92);
  color: var(--seal-ink);
  font: 600 1rem/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 16px oklch(28% 0.03 50 / 0.14);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.3s ease,
    transform 0.2s ease;
}

.btn:hover {
  background: var(--seal-hover);
  box-shadow: 0 8px 20px oklch(28% 0.03 50 / 0.18);
}
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px oklch(28% 0.03 50 / 0.12);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn[data-state="loading"] { background: var(--seal-loading); border-color: var(--seal-loading); cursor: progress; }
.btn[data-state="error"] { background: var(--paper); color: var(--error); border-color: var(--error); box-shadow: none; }
.btn[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--blush); }

.btn.quiet {
  background: oklch(97.2% 0.014 88 / 0.55);
  color: var(--ink);
  border-color: oklch(52% 0.04 70 / 0.45);
  box-shadow: none;
}

.btn.quiet:hover { background: var(--paper-2); border-color: oklch(52% 0.04 70 / 0.7); }
.btn.quiet[aria-pressed="true"] {
  background: var(--paper-2);
  border-color: oklch(38% 0.11 24 / 0.45);
  color: var(--seal);
}

.reply form .btn,
.formal .btn { width: 100%; }

.regret {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  background: var(--paper-2);
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.35;
}

.alert {
  margin: 0;
  padding: var(--space-2);
  border: 2px solid var(--error);
  color: var(--error);
  font-weight: 600;
}

.alert ul { margin: var(--space-1) 0 0; padding-left: 1.2rem; }

.ghost {
  min-height: 3rem;
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1 var(--font-ui);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  white-space: nowrap;
  cursor: pointer;
}

.ghost:hover { color: var(--seal); }
.ghost:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

dialog {
  width: min(26rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 40px var(--shadow);
}

dialog::backdrop { background: oklch(24% 0.03 42 / 0.55); }

.formal {
  padding: var(--space-4) var(--space-3);
  text-align: center;
  outline: 1px solid var(--rule);
  outline-offset: -0.65rem;
}

.formal h2 {
  margin: var(--space-1) 0 var(--space-2);
  font-size: 3rem;
  line-height: 0.95;
}

.formal-name {
  margin: var(--space-1) 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
}

.formal-line { margin-top: var(--space-3); }
.formal-mail { margin-top: var(--space-2); color: var(--ink-soft); font-size: 0.95rem; }

.formal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.waiting {
  margin-top: var(--space-3);
  padding: var(--space-5) var(--space-3);
  background: var(--paper);
  border: 1px solid var(--rule);
  outline: 1px solid var(--rule);
  outline-offset: -0.65rem;
  text-align: center;
  box-shadow: 0 16px 32px var(--shadow);
}

.waiting h1 {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 4.5rem);
  font-weight: 500;
  line-height: 0.95;
}

.waiting p { max-width: 26rem; margin: var(--space-3) auto 0; }

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

@media (prefers-reduced-motion: reduce) {
  .carta { transition: none; }
  .track { transition: none; }
  #sobre[open],
  #sobre[open] .kicker,
  #sobre[open] h2,
  #sobre[open] .voice,
  #sobre[open] .btn,
  .calendar.is-armed:not(.is-in) .day,
  .calendar.is-in .day,
  .calendar.is-in .day.is-event,
  .calendar.is-in .day.is-event::after,
  .map-wrap.is-in .signal,
  .map-wrap.is-in .pin,
  .tab:active,
  .btn:active,
  .step:active {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .calendar.is-in .day.is-event::after,
  .map-wrap.is-in .signal {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 24rem) {
  body { padding-inline: 0.75rem; }
  .fold-body { padding-inline: var(--space-2); }
  .formal { outline-offset: -0.45rem; }
}
