/* ============================================================
   XV Valentina · demo (2 versiones)
   html[data-v="ladrillo"] → V1 · html[data-v="vino"] → V2
   Estética: ../design.md
   ============================================================ */

:root {
  --col: min(430px, 100vw);
  --font-display: "Fraunces", serif;
  --font-body: "Jost", sans-serif;
  --r-card: 22px;
  --r-photo: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* V1 · Ladrillo (default) */
  --stage: #c9cdd0; --bg: #f4f1ec; --bg2: #e6ddd4; --surface: #fcfbf9;
  --accent: #a94a32; --accent-deep: #873824; --accent2: #dcae9c; --foil-hi: #f2c7a8;
  --ink: #2e3338; --ink-soft: #6c737a; --line: #e0d8cf;
  --accent-rgb: 169, 74, 50; --shade-rgb: 70, 55, 48;
  /* colores del canvas de la tapa (confeti / destellos) */
  --fx-1: 169, 74, 50; --fx-2: 220, 174, 156; --fx-3: 242, 199, 168;
}
html[data-v="vino"] {
  --stage: #e0d0c8; --bg: #f8f1ec; --bg2: #ecd9d0; --surface: #fdf9f6;
  --accent: #7d2b27; --accent-deep: #5f1d1a; --accent2: #d9aca0; --foil-hi: #eec5b3;
  --ink: #2f2322; --ink-soft: #8a7470; --line: #eddcd4;
  --accent-rgb: 125, 43, 39; --shade-rgb: 80, 40, 35;
  --fx-1: 125, 43, 39; --fx-2: 217, 172, 160; --fx-3: 238, 197, 179;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 300 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Marco tipo celular ----------
   La tarjeta ES el <main> (fondo + radio + sombra + clip), como en otras invitaciones: scrollea entera y nada
   se sale de sus bordes. Antes el fondo era una capa fija con 16px de margen y el contenido
   scrolleaba por encima → en desktop se veía pasarse arriba y abajo. */
.splash {
  position: fixed; top: 0; bottom: 0; left: 0; right: 0;
  width: var(--col); margin: 0 auto;   /* sin translateX(-50%): evita el filo subpixel */
}
.grain {
  position: fixed; inset: 0;
  z-index: 40; pointer-events: none; opacity: .10; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (min-width: 560px) {
  .splash { top: 16px; bottom: 16px; border-radius: 28px; overflow: hidden; }
}

/* ---------- Tipos compartidos ---------- */
.eyebrow { font-size: 12px; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-soft); }
h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; font-size: 40px; line-height: 1.1; color: var(--ink); }

/* Nombre con foil (texto vivo) */
.name {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 88px; line-height: 1.15; letter-spacing: -.02em;
  padding: 0 .12em .12em;
  background: linear-gradient(100deg, var(--f1, var(--accent-deep)) 0%, var(--f2, var(--accent)) 32%, var(--f3, var(--foil-hi)) 46%, var(--f2, var(--accent)) 60%, var(--f1, var(--accent-deep)) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 7s linear infinite;
  filter: drop-shadow(0 6px 18px rgba(var(--accent-rgb), .25));
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -160% 0; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 8px 8px 8px 22px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 500 14px/1 var(--font-body); letter-spacing: .06em;
  background: var(--accent); color: var(--surface);
  box-shadow: 0 14px 26px -16px rgba(var(--accent-rgb), .9), inset 0 1px 0 rgba(255, 255, 255, .22);
  position: relative; overflow: hidden;
  transition: transform .35s var(--ease);
  text-decoration: none;
}
.btn__ic {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 20%, transparent); font-size: 15px;
  transition: transform .35s var(--ease);
}
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: shine 5.5s ease-in-out infinite;
}
@keyframes shine { 0% { left: -60%; } 22%, 100% { left: 130%; } }
.btn:hover { transform: translateY(-2px); }
.btn:hover .btn__ic { transform: translate(2px, -1px) scale(1.06); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn--ghost {
  background: transparent; color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--accent2);
  min-height: 44px; padding: 5px 5px 5px 18px; font-size: 13px;
}
.btn--ghost::after { display: none; }
.btn--ghost .btn__ic { background: var(--bg2); width: 32px; height: 32px; font-size: 13px; }

/* ---------- TAPA ---------- */
.splash {
  z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 30px 56px;
  background:
    radial-gradient(120% 60% at 50% 6%, var(--bg2), transparent 60%),
    radial-gradient(90% 50% at 50% 100%, var(--bg2), transparent 60%),
    var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s cubic-bezier(.7, 0, .2, 1), visibility 0s linear 1.1s;
}
.splash--hidden { clip-path: inset(0 0 100% 0); visibility: hidden; pointer-events: none; }
#tapaFx { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.splash__dt { font-size: 14px; letter-spacing: .28em; text-transform: uppercase; margin-top: 4px; }
.splash__dt b { color: var(--accent); font-weight: 500; }
.splash__loc { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft); margin-top: 22px; }
.pdiv { display: flex; align-items: center; gap: 10px; margin: 22px 0 26px; }
.pdiv i { width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
.pdiv i:last-child { background: linear-gradient(90deg, var(--accent), transparent); }
.pdiv b { width: 6px; height: 6px; transform: rotate(45deg); background: var(--accent); }
/* La tapa NO tiene entrada animada : el subir escalonado (~2s) se sentía tarde
   frente al fondo ya animado, y en conexiones lentas la fuente web llegaba a mitad de la subida.
   Los textos aparecen quietos desde el primer frame; el brillo del nombre y el canvas dan la vida.
   `rise` queda solo para la entrada del hero, que corre después de tocar "Abrir invitación". */
@keyframes rise { from { transform: translateY(24px); } }

/* ---------- Contenido ---------- */
main {
  position: relative; z-index: 1;
  width: var(--col); margin: 0 auto; padding: 0 26px 80px;
  background:
    radial-gradient(120% 900px at 50% 100%, var(--bg2), transparent 70%),
    var(--bg);
  overflow: clip;
}
@media (min-width: 560px) {
  body { background: var(--stage); }
  main { margin: 16px auto; border-radius: 28px; box-shadow: 0 40px 80px -40px rgba(var(--shade-rgb), .5); }
}
section { margin-bottom: 72px; }

/* Hero */
.hero {
  position: relative; margin: 0 -26px 64px; min-height: 100vh; min-height: 100dvh;
  overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  text-align: center; padding: 0 26px 92px;
}
@media (min-width: 560px) { .hero { min-height: calc(100dvh - 32px); } }
.hero__photo { position: absolute; inset: 0; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.entered .hero__photo img { animation: kb 16s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(20, 14, 10, .35) 60%, rgba(20, 14, 10, .82) 100%); }
.hero__txt { position: relative; }
.hero .eyebrow, .hero__date { color: #f7efe5; }
.hero__date { font-size: 14px; letter-spacing: .3em; margin-top: 2px; }
.hero .name { --f1: #f3dcc0; --f2: #fff4e6; --f3: #ffffff; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .35)); }
.entered .hero .hrise { animation: rise 1.2s var(--ease) both; }
.entered .hero .name.hrise { animation: rise 1.2s var(--ease) .12s both, sheen 7s linear infinite; }
.entered .hero .hero__date.hrise { animation-delay: .24s; }
.hero__hint { position: absolute; bottom: 26px; left: 50%; margin-left: -14px; font-size: 28px; color: #f7efe5; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(8px); } }

/* Countdown */
.count { text-align: center; }
.count h2 { margin-bottom: 22px; }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 0 12px; box-shadow: 0 18px 34px -28px rgba(var(--accent-rgb), .55); }
.cell .n { font-family: var(--font-display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent-deep); }
.cell .l { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-top: 8px; }

/* Cinta */
.ribbon { margin: 0 -26px 72px; overflow: hidden; padding: 14px 0; background: var(--accent); color: var(--surface); transform: rotate(-3deg); }
.ribbon__track { display: flex; width: max-content; animation: marquee 22s linear infinite; }
.ribbon span { font-family: var(--font-display); font-size: 26px; white-space: nowrap; padding-right: 22px; }
.ribbon i { font-style: normal; opacity: .7; padding: 0 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Galería: una variante por versión */
.g-acordeon { display: none; }
html[data-v="vino"] .g-polaroid { display: none; }
html[data-v="vino"] .g-acordeon { display: block; }
.ghint { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.ghint .i { font-size: 20px; color: var(--accent); }
.ghint__tap { animation: tap 1.8s ease-in-out infinite; }
@keyframes tap { 40% { transform: translateY(3px) scale(.88); } }

/* V1 · polaroids (tocá para pasar) */
.polas { position: relative; height: 430px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.polas:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }
.pola {
  position: absolute; left: 50%; top: 10px; width: 280px;
  background: var(--surface); padding: 12px 12px 46px; border-radius: 6px;
  box-shadow: 0 24px 40px -26px rgba(var(--shade-rgb), .6), 0 2px 6px rgba(var(--shade-rgb), .08);
  transform: translateX(-50%) rotate(var(--rot));
  transition: transform .7s var(--ease), opacity .4s ease;
}
.pola img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.pola--fly { transform: translateX(-10%) translateY(-30px) rotate(18deg); opacity: 0; }

/* V2 · acordeón: la foto activa se abre, las otras quedan como franjas */
.acc { display: flex; gap: 8px; height: 440px; }
.acc__i {
  flex: 1; min-width: 0; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--r-photo); overflow: hidden; background: var(--bg2);
  box-shadow: 0 24px 40px -26px rgba(var(--shade-rgb), .6);
  transition: flex .8s var(--ease);
}
.acc__i[aria-pressed="true"] { flex: 5; cursor: default; }
.acc__i img { width: 100%; height: 100%; object-fit: cover; }
.acc__i:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 30px 26px; box-shadow: 0 26px 50px -38px rgba(var(--accent-rgb), .6); }
.card__ic, .tile__ic { font-size: 26px; color: var(--accent); margin-bottom: 10px; display: block; }
.card__label { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.when__day { font-family: var(--font-display); font-size: 34px; line-height: 1.15; margin-bottom: 22px; }
.tl { position: relative; padding-left: 28px; margin-bottom: 26px; list-style: none; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), var(--accent2)); }
.tl li { position: relative; padding: 4px 0 14px; }
.tl li::before { content: ""; position: absolute; left: -27px; top: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--accent); }
.tl li:last-child::before { background: var(--accent); }
.tl b { font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--accent-deep); display: block; line-height: 1.1; }
.tl span { font-size: 15px; color: var(--ink-soft); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 18px; display: flex; flex-direction: column; }
.tile__ic { font-size: 22px; }
.tile__big { font-family: var(--font-display); font-size: 26px; line-height: 1.15; }
.tile__sub { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.tile--accent { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.tile--accent .tile__ic, .tile--accent .card__label { color: color-mix(in srgb, var(--surface) 78%, transparent); }

/* RSVP */
.rsvp__card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.rsvp__title { font-size: 34px; }
.rsvp__dl { font-size: 14px; color: var(--ink-soft); margin-top: 8px; }
.rsvp__dl b { color: var(--accent-deep); font-weight: 500; }
.rsvp form { width: 100%; margin-top: 24px; text-align: left; }
.rsvp__lbl { display: block; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.person { border: 1px solid var(--line); border-radius: 16px; padding: 15px 15px 5px; margin-bottom: 12px; background: var(--bg); }
.person__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.person__n { font-family: var(--font-display); font-size: 17px; color: var(--accent-deep); }
.person__tag { font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent2) 35%, transparent); border-radius: 999px; padding: 3px 9px; }
.person__rm { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.person__rm:hover { color: var(--accent-deep); border-color: var(--accent2); }
.person__rm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rsvp__add {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  background: none; border: 1px dashed var(--accent2); border-radius: 999px; padding: 0 18px;
  color: var(--accent-deep); font-size: 13px; letter-spacing: .04em; cursor: pointer; margin-bottom: 18px;
}
.rsvp__add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.field__help { font-size: 13px; line-height: 1.45; color: var(--ink-soft); margin-top: 6px; }
.field input, .field select {
  display: block; width: 100%; margin-top: 6px;
  font: 400 16px/1.3 var(--font-body); color: var(--ink);   /* 16px: iOS no hace zoom al enfocar */
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  -webkit-appearance: none; appearance: none;
  transition: border-color .3s, box-shadow .3s;
}
.field select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%236c737a'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.rsvp__err { font-size: 14px; color: #a3261c; margin: 4px 0 12px; }
.rsvp__submit { text-align: center; margin-top: 12px; }
.rsvp__thanks { margin-top: 18px; }
.rsvp__thanks-t { font-family: var(--font-display); font-style: italic; font-size: 34px; color: var(--accent); }
.rsvp__thanks p { color: var(--ink-soft); }
.rsvp__noscript { text-align: center; color: var(--ink-soft); font-size: 14px; }
.rsvp--closed form { display: none; }

/* Cierre */
.closing { text-align: center; margin-bottom: 0; }
.closing__txt { font-family: var(--font-display); font-size: 20px; color: var(--ink-soft); }
.closing__footer { margin-top: 36px; }
.closing__nm { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft); }
.closing__hm { font-size: 11px; color: var(--ink-soft); margin-top: 8px; opacity: .8; }
.closing__hm a { color: inherit; text-underline-offset: 3px; }

/* Reveal al scroll (la visibilidad base NO depende de la animación: sin .js todo se ve) */
.js [data-reveal] > * { transition: transform 1s var(--ease), opacity 1s var(--ease), filter 1s var(--ease); }
.js [data-reveal]:not(.in) > * { opacity: 0; transform: translateY(28px); filter: blur(6px); }
.js [data-reveal].in > *:nth-child(2) { transition-delay: .08s; }
.js [data-reveal].in > *:nth-child(3) { transition-delay: .16s; }
.ribbon, .hero { z-index: 1; }

/* Parallax de fotos atado al scroll (CSS scroll-driven; sin soporte = foto quieta) */
@supports (animation-timeline: view()) {
  .pola img { animation: para linear both; animation-timeline: view(); animation-range: cover; }
  @keyframes para { from { object-position: 50% 35%; } to { object-position: 50% 65%; } }
}

/* Bottom-sheet "Agendá la fecha" */
.cal-sheet { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.cal-sheet.open { visibility: visible; }
.cal-sheet__scrim { position: absolute; inset: 0; background: rgba(30, 22, 18, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .35s var(--ease); }
.cal-sheet.open .cal-sheet__scrim { opacity: 1; }
.cal-sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 430px; margin: 0 auto;
  background: var(--surface); border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 50px -12px rgba(var(--shade-rgb), .4);
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .42s var(--ease);
}
.cal-sheet.open .cal-sheet__panel { transform: translateY(0); }
.cal-sheet__grab { width: 38px; height: 4px; border-radius: 99px; background: var(--line); margin: 2px auto 14px; }
.cal-sheet__title { text-align: center; font-family: var(--font-display); font-size: 22px; }
.cal-sheet__sub { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 2px 0 16px; }
.cal-sheet__row { display: flex; align-items: center; padding: 15px 16px; border-radius: 14px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--bg); }
.cal-sheet__row + .cal-sheet__row { margin-top: 10px; }
.cal-sheet__row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-sheet__txt b { display: block; font-weight: 500; font-size: 15px; }
.cal-sheet__txt small { display: block; color: var(--ink-soft); font-size: 12px; }
.cal-sheet__cancel { display: block; width: 100%; margin-top: 12px; padding: 13px; background: none; border: 0; color: var(--ink-soft); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.cal-sheet__cancel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .js [data-reveal]:not(.in) > * { opacity: 1; transform: none; filter: none; }
}
