/* Boda Pilar y Luis */

:root {
  --bg: #f3f2ef;
  --shell: #e7e5e0;
  --card: #fbfbf9;
  --ink: #26241f;
  --muted: #6b665c;
  --line: #ddd6ca;
  --accent: #4f5d3f;      /* verde olivo de la finca */
  --accent-dark: #3b4630;
  --accent-soft: #eef0e8;
  --accent-ink: #ffffff;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;

  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --fs-h3: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  --fs-h2: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  --fs-h1: clamp(3.25rem, 2rem + 4.6vw, 5.75rem);

  --wrap: 1200px;
  --pad: clamp(20px, 4vw, 48px);
  --section: clamp(72px, 9vw, 120px);
  --r-outer: 28px;
  --r-inner: 22px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --nav-bg: rgba(251, 250, 247, .8);
  --chip-bg: rgba(251, 250, 247, .9);
  --field-focus: #ffffff;
  --plus-bg: #e2e6d9;
  --placeholder: #9a9488;
  --error: #9b2c1f;
  --hover-light: #ffffff;
  color-scheme: light;
}

/* ---------- Modo noche ---------- */
:root[data-theme="dark"] {
  --bg: #161714;
  --shell: #22241f;
  --card: #1c1e1a;
  --ink: #ecebe5;
  --muted: #a9a79d;
  --line: #34372f;
  --accent: #8fa274;
  --accent-dark: #a5b78b;
  --accent-soft: #283023;
  --accent-ink: #12140f;
  --nav-bg: rgba(28, 30, 26, .8);
  --chip-bg: rgba(28, 30, 26, .88);
  --field-focus: #121310;
  --plus-bg: #323a2a;
  --placeholder: #7d7b72;
  --error: #e58b7c;
  --hover-light: #2a2d26;
  color-scheme: dark;
}
:root[data-theme="dark"] .hero__media img,
:root[data-theme="dark"] .place__img img,
:root[data-theme="dark"] .story__img img,
:root[data-theme="dark"] .rsvp__photo img { filter: brightness(.9); }

/* Botón de tema */
.theme {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .4s var(--ease), transform .4s var(--ease);
}
.theme:hover { background: var(--shell); }
.theme:active { transform: scale(.94); }
.theme svg { width: 20px; height: 20px; }
.theme .moon { display: block; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }


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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section[id] { scroll-margin-top: 96px; }

body {
  margin: 0;
  transition: background-color .5s var(--ease), color .5s var(--ease);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.05; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(100% - 2 * var(--pad), var(--wrap)); margin-inline: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--card); padding: 8px 14px; border-radius: 99px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 6px 6px 6px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 var(--fs-body) / 1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .5s var(--ease), transform .5s var(--ease);
}
.btn__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  transition: transform .5s var(--ease);
}
.btn__icon svg { width: 16px; height: 16px; }
.btn:hover { background: var(--accent-dark); }
.btn:hover .btn__icon { transform: translate(2px, -1px) scale(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .65; cursor: progress; }

.btn--light { background: var(--card); color: var(--ink); }
.btn--light .btn__icon { background: var(--shell); }
.btn--light:hover { background: var(--hover-light); }

.btn--block { width: 100%; justify-content: space-between; }

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color .4s var(--ease);
}
.link:hover { text-decoration-color: var(--ink); }

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px rgba(38, 36, 31, .06), 0 10px 30px -12px rgba(38, 36, 31, .18); /* taste-skill-ignore: anillo de campo de formulario o barra fija */
  white-space: nowrap;
}
.nav__mark { font-family: var(--serif); font-size: var(--fs-lead); font-weight: 500; text-decoration: none; margin-right: 14px; }
.nav__links { display: flex; gap: 2px; }
.nav__links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: var(--fs-small);
  text-decoration: none;
  color: var(--muted);
  transition: color .4s var(--ease), background-color .4s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--shell); }
.nav .btn { min-height: 42px; padding: 4px 4px 4px 18px; font-size: var(--fs-small); gap: 10px; }
.nav .btn__icon { width: 34px; height: 34px; }

/* ---------- Marco doble ---------- */
.shell {
  padding: 8px;
  border-radius: var(--r-outer);
  background: var(--shell);
}
.core {
  border-radius: var(--r-inner);
  background: var(--card);
  overflow: hidden;
}

/* ---------- Portada ---------- */
.hero { padding: 104px 0 var(--section); }
.hero__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero__kicker { font-family: var(--serif); font-style: italic; font-size: var(--fs-h3); line-height: 1.1; color: var(--accent); }
.hero h1 { margin-top: 10px; font-size: var(--fs-h1); line-height: .98; }
.hero h1 .amp { color: var(--accent); }
.hero__date {
  margin-top: 28px;
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: 1.2;
}
.hero__place { margin-top: 8px; max-width: 38ch; }
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hero__actions .link { font-size: var(--fs-small); }

.hero__media .core {
  position: relative;
  aspect-ratio: 5 / 6;
  max-height: calc(100svh - 150px);
  min-height: 440px;
  width: 100%;
}
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero__media img.is-on { opacity: 1; }
.hero__media img:first-child { object-position: 30% 50%; }
.hero__media img.is-on.drift { animation: drift 7s var(--ease) both; }
@keyframes drift { from { transform: scale(1.05); } to { transform: scale(1); } }
.hero__caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: var(--fs-small);
}

/* ---------- Cuenta atrás ---------- */
.countdown { padding-bottom: var(--section); }
.countdown .core {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  align-items: center;
  gap: 16px;
  padding: 28px clamp(24px, 4vw, 48px);
}
.countdown__label { font-family: var(--serif); font-size: var(--fs-lead); line-height: 1.25; }
.countdown__label span { display: block; margin-top: 4px; font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); }
.unit { text-align: center; }
.unit strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.unit span { display: block; margin-top: 6px; font-size: var(--fs-small); color: var(--muted); }

/* ---------- Cabeceras de sección ---------- */
.head { display: flex; justify-content: space-between; align-items: end; gap: 16px 48px; flex-wrap: wrap; margin-bottom: 36px; }
.head h2 { font-size: var(--fs-h2); }
.head p { max-width: 46ch; }

/* ---------- Lugares ---------- */
.places { padding-bottom: var(--section); }
.places__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.place .core { display: flex; flex-direction: column; height: 100%; }
.place__img { aspect-ratio: 3 / 2; overflow: hidden; }
.place__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.place:hover .place__img img { transform: scale(1.03); }
.place__body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 26px 28px 24px; }
.place__kind { font-family: var(--serif); font-style: italic; font-size: var(--fs-lead); color: var(--accent); }
.place h3 { font-size: var(--fs-h3); }
.place address { font-style: normal; color: var(--muted); }
.place__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 22px;
}
.place__time { font-size: var(--fs-small); color: var(--muted); line-height: 1.4; }
.place__time strong { display: block; font-weight: 500; color: var(--ink); }

/* ---------- El día ---------- */
.story { padding-bottom: var(--section); }
.story__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.story__img .core { aspect-ratio: 3 / 2; }
.story__img img { width: 100%; height: 100%; object-fit: cover; }
.story h2 { font-size: var(--fs-h2); }
.story__text > p { margin-top: 16px; max-width: 42ch; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; }
.steps li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--shell);
}
.steps { display: grid; gap: 6px; }
.steps strong { font-weight: 500; }
.steps span { color: var(--muted); text-align: right; }

/* ---------- Confirmación ---------- */
.rsvp { padding-bottom: var(--section); }
.rsvp__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 3vw, 40px); align-items: start; }
.rsvp__intro { position: sticky; top: 110px; }
.rsvp__intro h2 { font-size: var(--fs-h2); }
.rsvp__intro > p { margin-top: 16px; max-width: 40ch; }
.rsvp__photo { margin-top: 32px; }
.rsvp__photo .core { aspect-ratio: 1 / 1; }
.rsvp__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 26% 50%; }

.form .core { padding: clamp(24px, 3.5vw, 40px); }
.form fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.form legend, .form .label { display: block; padding: 0; margin-bottom: 12px; font-weight: 500; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line); /* taste-skill-ignore: anillo de campo de formulario o barra fija */
  cursor: pointer;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.choice label::before {
  content: "";
  flex: 0 0 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--muted); /* taste-skill-ignore: anillo de campo de formulario o barra fija */
  transition: box-shadow .4s var(--ease);
}
.choice label:hover { background: var(--shell); }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice label:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); /* taste-skill-ignore: anillo de campo de formulario o barra fija */ }
.choice label:has(input:checked)::before { box-shadow: inset 0 0 0 5px var(--accent); /* taste-skill-ignore: anillo de campo de formulario o barra fija */ }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.choice label:active { transform: scale(.985); }

.names { display: grid; gap: 10px; }
.name-row { display: flex; gap: 10px; }
.field {
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line); /* taste-skill-ignore: anillo de campo de formulario o barra fija */
  color: var(--ink);
  font: inherit;
  transition: box-shadow .4s var(--ease), background-color .4s var(--ease);
}
.field::placeholder { color: var(--placeholder); }
.field:focus { outline: none; background: var(--field-focus); box-shadow: inset 0 0 0 1.5px var(--accent); /* taste-skill-ignore: anillo de campo de formulario o barra fija */ }
textarea.field { min-height: 110px; resize: vertical; }
.remove {
  flex: 0 0 54px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line); /* taste-skill-ignore: anillo de campo de formulario o barra fija */
  color: var(--muted);
  font-size: var(--fs-lead);
  cursor: pointer;
  transition: color .4s var(--ease), background-color .4s var(--ease);
}
.remove:hover { color: var(--ink); background: var(--shell); }
.add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: 500 .9375rem / 1 var(--sans);
  cursor: pointer;
  transition: background-color .4s var(--ease);
}
.add:hover { background: var(--accent-soft); }
.add__plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--plus-bg); font-size: 1rem; line-height: 1; }
.hint { margin-top: 6px; color: var(--muted); font-size: var(--fs-small); }

.form__msg { min-height: 1.6em; margin-bottom: 12px; font-size: var(--fs-small); }
.form__msg.is-error { color: var(--error); }

.thanks { display: none; padding: 32px 8px; text-align: center; }
.thanks h3 { font-size: var(--fs-h2); }
.thanks p { margin-top: 12px; color: var(--muted); }
.form.is-done .form__fields { display: none; }
.form.is-done .thanks { display: block; }

/* ---------- Pie ---------- */
.foot { padding-bottom: 28px; }
.foot .core {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: clamp(28px, 4vw, 44px);
  background: var(--accent);
  color: var(--accent-ink);
}
.foot h2 { font-size: var(--fs-h2); }
.foot p { margin-top: 6px; opacity: .85; }
.foot__small { margin-top: 18px; font-size: var(--fs-small); color: var(--muted); text-align: center; }
.foot__credit { margin-top: 6px; font-size: var(--fs-small); color: var(--muted); text-align: center; }
.foot__credit .link { color: var(--ink); }
.foot__credit .heart { color: #c0392b; }

/* ---------- Entradas ---------- */
.rise {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.rise.is-in { opacity: 1; transform: none; }
.no-js .rise { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .hero__media img { transition: none; }
  .hero__media img.is-on.drift { animation: none; }
}

/* ---------- Tableta ---------- */
@media (max-width: 960px) {
  .hero__grid, .story__grid, .rsvp__grid { grid-template-columns: 1fr; }
  .hero__media .core { aspect-ratio: 4 / 3; max-height: none; min-height: 0; }
  .countdown .core { grid-template-columns: repeat(4, 1fr); }
  .countdown__label { grid-column: 1 / -1; text-align: center; margin-bottom: 6px; }
  .countdown__label span { display: none; }
  .rsvp__intro { position: static; }
  .rsvp__photo { display: none; }
  .nav__links { display: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 680px) {
  .nav { top: 10px; padding-left: 18px; }
  .hero { padding-top: 80px; }
  .hero__media { order: -1; }
  .hero__media .core { aspect-ratio: 4 / 4.2; }
  .hero__date { margin-top: 20px; }
  .places__grid { grid-template-columns: 1fr; }
  .place__meta { flex-direction: column; align-items: stretch; }
  .place__meta .btn { justify-content: space-between; }
  .countdown .core { gap: 8px; padding: 22px 14px; }
  .choice { grid-template-columns: 1fr; }
  .steps li { flex-direction: column; gap: 2px; }
  .steps span { text-align: left; }
  .foot .core { grid-template-columns: 1fr; }
  .shell { padding: 6px; border-radius: 24px; }
  .core { border-radius: 18px; }
}
