/* Placeholder palette & type — to be replaced with the final brand values. */
:root {
  --paper: #F3F0E8;
  --paper-alt: #ECE8DE;
  --ink: #1F1E1B;
  --muted: #6B6A64;
  --gold: #C2BD86;
  --gold-deep: #87834F;
  --line: rgba(31, 30, 27, 0.22);
  --white: #FFFFFF;

  /* Accents from the final design artwork (img/final-design.png) */
  --coral: #C7564D;
  --mustard: #E19538;
  --olive: #636137;
  --lavender: #A183A1;
  --terracotta: #AD4930;

  --f-display: "Bodoni Moda", "Didot", Georgia, serif;
  --f-script: "Allura", cursive;
  --f-sans: "Barlow Condensed", "Arial Narrow", sans-serif;

  --gutter: 16px;
  --radius: 2px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper) url("../img/background-texture.jpeg") top center / 100% auto repeat-y;
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

/* Logo artwork (img/logo-*.png) */
.logo { margin: 0; width: min(100%, 440px); }
.logo img { width: 100%; height: auto; }
.logo-sm { width: min(100%, 260px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(243, 240, 232, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform 0.35s ease;
}
.nav.is-visible { transform: none; }
.nav-mono { flex: none; display: block; }
.nav-mono img { height: 30px; width: auto; }
.nav-links {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
/* Fade an edge only while there are more links hidden past it (toggled in main.js) */
.nav-links.fade-end { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.nav-links.fade-start { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }
.nav-links.fade-start.fade-end {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.nav-links a {
  flex: none;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav-links a.is-active { color: var(--ink); border-color: var(--gold); }
@media (min-width: 900px) {
  .nav { justify-content: space-between; padding-inline: 40px; }
  .nav-links { gap: 28px; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 28px;
  padding: 24px var(--gutter) 32px;
}

.std-card {
  width: min(100%, 460px);
  aspect-ratio: 2 / 3;
  background: #8a8f90 center / cover no-repeat;
  filter: grayscale(0.5) contrast(0.95);
  box-shadow: 0 18px 40px -18px rgba(31, 30, 27, 0.45), 0 2px 6px rgba(31, 30, 27, 0.12);
}

.hero-info {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4px;
  width: 100%;
  max-width: 460px;
}
.hero-date {
  margin: 14px 0 0;
  font-size: 1.55rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.hero-city {
  margin: 0;
  font-size: 1.45rem;
  color: var(--gold-deep);
}
/* Greeting from the "Saludo" column of the guest sheet */
.hero-guest {
  margin: 18px 0 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.3;
  text-wrap: balance;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  margin: 22px 0 18px;
  border-block: 1px solid var(--line);
  padding: 12px 0;
}
.countdown div { display: grid; }
.countdown div + div { border-left: 1px solid var(--line); }
.countdown span {
  font-family: var(--f-display);
  font-size: 2rem;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown small {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-hint {
  margin-top: 22px;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 460px) minmax(0, 440px);
    justify-content: center;
    align-items: center;
    column-gap: clamp(48px, 7vw, 110px);
    padding: 48px 40px;
  }
  .std-card { width: 100%; max-height: calc(100svh - 96px); width: auto; height: min(690px, calc(100svh - 96px)); }
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn-row .btn { min-width: 150px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 400 0.85rem/1 var(--f-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
/* --hover-bg / --hover-fg rotate through the accent colors (see main.js) */
.btn:hover {
  background: var(--hover-bg, var(--ink));
  border-color: var(--hover-bg, var(--ink));
  color: var(--hover-fg, var(--paper));
}
.btn-ghost { border-color: var(--line); }
.btn-solid { background: var(--ink); color: var(--paper); width: 100%; }
.btn-solid:hover { background: var(--terracotta); border-color: var(--terracotta); color: var(--paper); }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Sections ---------- */
.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
  padding: 88px var(--gutter);
}
.section > * { max-width: 560px; width: 100%; }
.section > .btn { width: auto; }
.section-alt { background: rgba(255, 255, 255, 0.35); border-block: 1px solid rgba(31, 30, 27, 0.06); }

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.section h2,
.palette-body h2 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 8vw, 3rem);
  line-height: 1.1;
  text-wrap: balance;
}
.divider {
  width: 64px;
  height: 1px;
  margin: 22px auto 26px;
  background: var(--gold);
  position: relative;
  overflow: visible;
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  background: var(--paper);
  transform: translate(-50%, -50%) rotate(45deg);
}
.lead { margin: 0 0 24px; font-size: 1.25rem; text-wrap: pretty; }
.note { margin: 18px 0 0; font-size: 0.95rem; letter-spacing: 0.06em; color: var(--muted); }

/* Evento */
.venue-name { margin: 0; font-family: var(--f-display); font-size: 1.6rem; }
.venue-address { margin: 4px 0 24px; color: var(--muted); }
.map {
  aspect-ratio: 4 / 3;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  padding: 6px;
  background: var(--paper);
}
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.5) contrast(0.95); }

/* Cronograma */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  column-gap: 40px;
  padding: 16px 0;
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  background: var(--dot, var(--gold));
  border: 3px solid var(--paper);
  box-sizing: content-box;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.timeline time {
  text-align: right;
  font-family: var(--f-display);
  font-size: 1.9rem;
  color: var(--gold-deep);
  font-variant-numeric: lining-nums;
}
.timeline span {
  text-align: left;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* One accent per moment, in the same order as the button hover colors (HOVERS in main.js) */
.timeline li:nth-child(5n+1) { --dot: var(--terracotta); }
.timeline li:nth-child(5n+2) { --dot: var(--mustard); }
.timeline li:nth-child(5n+3) { --dot: var(--olive); }
.timeline li:nth-child(5n+4) { --dot: var(--lavender); }
.timeline li:nth-child(5n+5) { --dot: var(--coral); }

/* Dress code */
.section > .swatches { max-width: 620px; }
.swatches {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 18px 8px;
}
#palette { margin-inline: auto; max-width: 520px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.swatches li { display: grid; justify-items: center; align-content: start; gap: 8px; }
.swatch {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(31, 30, 27, 0.12);
}
.swatches small {
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
}
.swatches-avoid { grid-template-columns: repeat(4, 1fr); }
.swatches-avoid .swatch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: var(--ink);
  transform: rotate(45deg);
}
.dc-who {
  display: grid;
  gap: 22px;
  margin: 36px 0;
  padding: 26px 0;
  border-block: 1px solid var(--line);
}
.dc-who p { margin: 0; text-wrap: pretty; }
.dc-who .eyebrow { margin-bottom: 6px; }
@media (min-width: 640px) { .dc-who { grid-template-columns: 1fr 1fr; gap: 32px; } }
.dc-avoid { margin-top: 44px; }
.dc-avoid .note { margin-top: 14px; }
.dc-tip {
  margin: 34px 0 22px;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.15rem;
  text-wrap: balance;
}

.guide {
  width: min(100vw - 24px, 720px);
  max-height: calc(100dvh - 24px);
  /* Cream mat between the frame and the content, so the mustard rule never crosses it */
  padding: 22px;
  border: 10px solid var(--coral);
  outline: 3px solid var(--mustard);
  outline-offset: -19px;
  background: var(--paper);
  overflow: hidden;
}
.guide-scroll {
  max-height: calc(100dvh - 24px - 64px);
  overflow: auto;
}
.guide::backdrop { background: rgba(20, 20, 18, 0.7); }
.palette-body { padding: 28px 8px 18px; text-align: center; }
.palette .dc-who { margin-bottom: 0; }
.guide img { width: 100%; height: auto; }
.guide-close {
  position: absolute;
  top: 36px;
  right: 36px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

/* RSVP */
.rsvp {
  display: grid;
  gap: 18px;
  text-align: left;
  padding: 28px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
}
@media (min-width: 600px) { .rsvp { padding: 36px; } }
.people, .diet { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.people legend, .diet legend {
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.only-yes { display: grid; gap: 18px; }

/* One row per guest: name + Sí / No */
.person, .stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 0 0 14px;
  border: 1px solid var(--line);
}
.person > span { min-width: 0; overflow-wrap: anywhere; padding: 8px 0; }
.yesno { display: flex; flex: none; align-self: stretch; }
.yesno label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-left: 1px solid var(--line);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.yesno input { position: absolute; opacity: 0; pointer-events: none; }
.yesno label:hover { background: rgba(194, 189, 134, 0.18); }
.yesno label:has(input:checked) { background: var(--ink); color: var(--paper); }
.yesno label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: -2px; }
.form-error { margin: 0; color: #9A3B2E; font-size: 1rem; }
.rsvp.is-sending button { opacity: 0.6; pointer-events: none; }
.rsvp-done { padding: 12px 0; }
.rsvp-status { display: grid; justify-items: center; gap: 4px; max-width: 520px; }
.rsvp-status .lead { margin-top: 0; }

/* Dietary counters */
.stepper-ctl { display: flex; align-items: center; flex: none; }
.stepper-ctl button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 300 1.5rem/1 var(--f-sans);
  cursor: pointer;
}
.stepper-ctl button:hover:not(:disabled) { background: rgba(194, 189, 134, 0.18); }
.stepper-ctl button:disabled { color: var(--line); cursor: default; }
.stepper-ctl input {
  width: 2.2em;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font: 400 1.2rem/1 var(--f-display);
  font-variant-numeric: lining-nums;
}
.script-title { margin: 0 0 16px; font-family: var(--f-script); font-weight: 400; font-size: 4rem; line-height: 1.2; color: var(--gold-deep); }

/* Regalos */
.section > .gifts { max-width: 420px; }
.gifts { display: grid; gap: 22px; }
.gift-switch {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  justify-self: center;
  width: min(100%, 300px);
  border: 1px solid var(--ink);
}
.gift-switch button {
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 0.85rem/1 var(--f-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}
.gift-switch button + button { border-left: 1px solid var(--ink); }
.gift-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.gift-switch button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gift-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 26px 20px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.gift-card hr { width: 100%; margin: 14px 0; border: 0; border-top: 1px solid var(--line); }
.gift-label {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.gift-alias {
  margin-bottom: 10px;
  font-family: var(--f-display);
  font-size: 1.75rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.gift-cbu {
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.gift-meta {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.copy {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.75rem;
}

/* Instagram */
.insta {
  display: grid;
  justify-items: center;
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.insta p { margin: 0 0 20px; }
.insta .eyebrow { margin-bottom: 4px; }
.insta-handle {
  margin-bottom: 8px;
  font-family: var(--f-display);
  font-size: 1.7rem;
  text-decoration: none;
}
.insta-handle:hover { color: var(--gold-deep); }

/* Footer */
.footer-insta {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
}
.footer-insta:hover { color: var(--ink); }
.footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 72px var(--gutter) calc(56px + env(safe-area-inset-bottom));
  text-align: center;
}
.footer-date { margin: 0; letter-spacing: 0.3em; color: var(--gold-deep); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
