/* Tomi y Belu: wedding invitation. Colors and fonts from the couple's Canva design, rhythm from the reference reel. */

:root {
  --olive: #3E4721;
  --olive-deep: #343D18;
  --olive-soft: #50592F;
  --olive-field: #4A5329;
  --paper: #FEFDFC;
  --paper-2: #F3F2EA;
  --white: #FFFFFF;
  --ink: #3D3B3A;
  --ink-strong: #151513;
  --ink-soft: #5E5B57;
  --line: rgba(62, 71, 33, 0.3);
  --stripe-soft: #E7E9DC;
  --stripe-mid: #CDD2B9;
  --on-olive: #FEFDFC;
  --on-olive-soft: #D9DCC9;
  --error: #8A2E1C;
  --error-on-olive: #F4C7B6;

  --font-script: "Homemade Apple", "Segoe Script", cursive;
  --font-title: "Cormorant SC", Georgia, serif;
  --font-body: "Crimson Pro", Georgia, serif;
  --label-size: 1rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --space-section: clamp(4.5rem, 3rem + 7vw, 8.5rem);
  --wrap: 1120px;
  --shadow-lift: 0 24px 60px -24px rgba(34, 40, 26, 0.55), 0 2px 8px rgba(34, 40, 26, 0.12);
}

/* Base */

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--olive) var(--paper-2);
}

html.has-cover,
html:has(.lightbox[open]),
html:has(.sheet[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.2rem/1.6 var(--font-body);
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--olive); color: var(--paper); }

input,
textarea { caret-color: var(--olive); }

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: 6px;
}

.band :focus-visible,
.closing :focus-visible,
.lightbox :focus-visible,
.music:focus-visible { outline-color: var(--on-olive); }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p { margin: 0; }
p { text-wrap: pretty; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* Type */

.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}

.title {
  font-family: var(--font-title);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.12em;
}

.label {
  font-family: var(--font-title);
  font-size: var(--label-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.section-title {
  color: var(--ink-strong);
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}

/* Hand-painted stripes: one tile used as a mask, so the color always comes from tokens. */

.stripes { position: relative; isolation: isolate; }

.stripes::before,
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--stripe, var(--olive-deep));
  -webkit-mask: url("assets/rayas.svg") 0 0 / 128px 384px repeat;
  mask: url("assets/rayas.svg") 0 0 / 128px 384px repeat;
  pointer-events: none;
}

.stripes--soft { --stripe: var(--stripe-soft); }

/* Icons: one monoline grammar for every drawing on the page. */

.icon,
.hero__art,
.music svg,
.lightbox svg,
.sheet__close svg,
.hero__scroll svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--lg { width: 5.5rem; height: 5.5rem; color: var(--olive); }
.icon--tiny { width: 1.05rem; height: 1.05rem; stroke-width: 1.8; }

.js .draw :is(path, circle, ellipse) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.3s var(--ease-out) calc(var(--i, 0) * 65ms);
}

.js .draw.is-drawn :is(path, circle, ellipse) { stroke-dashoffset: 0; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.1rem;
  padding: 0.85rem 1.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--olive);
  color: var(--paper);
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 14px -8px rgba(34, 40, 26, 0.6);
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    background-color 0.25s ease;
}

.btn:hover {
  background: var(--olive-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 22px -10px rgba(34, 40, 26, 0.6);
}

.btn:active { transform: translateY(0) scale(0.98); }

.btn--light { background: var(--on-olive); color: var(--olive); }
.btn--light:hover { background: var(--white); }
.btn--wide { width: 100%; margin-top: 0.5rem; }

/* Secondary action next to filled buttons: same pill, drawn as an outline. */
.btn--outline { background: transparent; color: var(--olive); box-shadow: inset 0 0 0 1.5px var(--olive); }
.btn--outline:hover { background: var(--olive); color: var(--paper); box-shadow: inset 0 0 0 1.5px var(--olive); }

.btn[aria-busy="true"] { cursor: progress; opacity: 0.78; transform: none; }

.link-btn {
  appearance: none;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 0;
  background: none;
  color: var(--olive);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

/* Cover: the couple's clip on a paper card inside a thin olive frame, like their draft.
   On phones the card fills the screen; on large screens it stands as a portrait card on the olive. */

.cover {
  --frame: clamp(0.6rem, 2.4vmin, 1.25rem);
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(var(--frame), env(safe-area-inset-top)) var(--frame) max(var(--frame), env(safe-area-inset-bottom));
  background: var(--olive);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.05s var(--ease-in-out);
}

.cover__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 30rem;
  height: 100%;
  max-height: 52rem;
  padding: clamp(1.75rem, 5svh, 3rem) clamp(1.25rem, 6vw, 2.5rem) clamp(1.25rem, 3.5svh, 2.25rem);
  overflow-y: auto;
  background: var(--paper);
  box-shadow: 0 30px 70px -30px rgba(18, 21, 10, 0.7);
  text-align: center;
  transition:
    transform 0.9s var(--ease-in-out),
    opacity 0.6s ease;
}

.cover__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  color: var(--ink-strong);
  font-family: var(--font-title);
  font-size: min(clamp(2.9rem, 2.2rem + 3.5vw, 4rem), 8svh);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 0.92;
  text-transform: lowercase;
}

.cover__names span:not(.n) { margin: 0.1em 0 0.16em; color: var(--olive); font-family: var(--font-script); font-size: 0.36em; letter-spacing: 0; text-transform: none; }

/* The clip takes whatever height is left, keeps its own proportion and never squeezes the button off screen. */
.cover__video {
  flex: 1 1 0;
  min-height: 9rem;
  max-width: 100%;
  margin-top: clamp(1rem, 3svh, 1.75rem);
  object-fit: cover;
  background: var(--paper-2);
}

.cover__date { flex: none; margin: clamp(0.9rem, 2.5svh, 1.4rem) 0; letter-spacing: 0.22em; }

.cover__open { flex: none; width: min(100%, 17rem); }

.cover__hint {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-style: italic;
}

.cover.is-leaving { clip-path: inset(0 0 100% 0); }
.cover.is-leaving .cover__card { transform: translateY(-18%); opacity: 0; }

/* Floating controls */

.music {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--olive);
  color: var(--on-olive);
  cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(34, 40, 26, 0.7);
  transition:
    transform 0.35s var(--ease-out),
    opacity 0.25s ease;
}

.music:hover { transform: scale(1.06); }

/* Step aside while the guest is typing, so it never covers a field. */
body:has(.form :is(input, textarea):focus) .music {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

@media (max-width: 599px) {
  .music { top: auto; right: auto; bottom: max(1rem, env(safe-area-inset-bottom)); left: 0.75rem; width: 3rem; height: 3rem; }
}
.music svg { width: 1.35rem; height: 1.35rem; stroke-width: 1.8; }

.music__bars { display: none; align-items: flex-end; gap: 3px; height: 16px; }

.music__bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}

.music__bars i:nth-child(2) { animation-delay: -0.3s; }
.music__bars i:nth-child(3) { animation-delay: -0.6s; }

.music[aria-pressed="true"] .music__bars { display: flex; }
.music[aria-pressed="true"] .music__note { display: none; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.float-cta {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  min-height: 3.1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--olive);
  color: var(--paper);
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 14px 30px -12px rgba(34, 40, 26, 0.75);
  transform: translate(-50%, 0);
  transition:
    transform 0.55s var(--ease-out),
    opacity 0.3s ease,
    visibility 0s linear 0s;
}

.float-cta.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 160%);
  transition:
    transform 0.55s var(--ease-out),
    opacity 0.3s ease,
    visibility 0s linear 0.55s;
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 3.25rem 0 1rem;
  overflow: hidden;
}

.hero__field {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(#000 65%, transparent);
  mask-image: linear-gradient(#000 65%, transparent);
}

.hero__inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2.25rem;
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__art {
  width: min(52vw, 13.5rem);
  margin-bottom: 0.25rem;
  color: var(--olive);
  stroke-width: 1.7;
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink-strong);
  font-family: var(--font-title);
  font-size: clamp(3.6rem, 2.6rem + 5vw, 5.5rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-transform: lowercase;
}

.hero__names:focus,
#event-title:focus { outline: none; }
.hero__names .amp { margin: 0.12em 0 0.18em; color: var(--olive); font-family: var(--font-script); font-size: 0.36em; letter-spacing: 0; text-transform: none; }

.hero__claim { margin: 1.4rem 0 0.6rem; font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); }

.hero__when { color: var(--ink); font-size: 1.2rem; }
.hero__when .dot { display: none; }

.hero__scroll {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-top: 2.25rem;
  border-radius: 50%;
  color: var(--olive);
}

.hero__scroll svg { width: 2rem; height: 1.25rem; stroke-width: 2; animation: nudge 2.4s var(--ease-out) infinite; }

@keyframes nudge {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(7px); }
}

/* The couple's clip as a paper-edged print, laid slightly askew on the pale stripes. */
.hero__photo { width: min(86%, 21rem); margin: 0.5rem 0 1.5rem; }

.hero__clip {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 576 / 728;
  object-fit: cover;
  border: clamp(0.5rem, 0.35rem + 0.6vw, 0.8rem) solid var(--paper);
  background: var(--paper-2);
  box-shadow: 0 16px 34px -14px rgba(34, 40, 26, 0.6);
  transform: rotate(-1.5deg);
}

/* Ceremony and party */

.event { padding-top: var(--space-section); }

.event__grid { display: grid; gap: 4rem; }

.moment {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.moment__title {
  margin: 0.4rem 0 1rem;
  color: var(--olive);
  font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.4rem);
}

.facts { display: grid; gap: 0.95rem; margin: 0 0 1.9rem; }
.facts div { display: grid; gap: 0.1rem; }
.facts dd { margin: 0; font-size: 1.1rem; }

/* Side by side, the party lists one fact less than the ceremony: both "Cómo llegar" buttons still line up. */
.moment .btn { margin-top: auto; }

/* The hour is what guests come back to check, so it reads first. */
.facts__time dd {
  color: var(--ink-strong);
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.aside {
  max-width: 20em;
  margin: clamp(3.75rem, 3rem + 3vw, 5.5rem) auto;
  color: var(--olive);
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.85rem);
  line-height: 1.7;
  text-align: center;
}

.venue { margin: 0; }

.venue img {
  width: 100%;
  height: clamp(22rem, 105vw, 34rem);
  object-fit: cover;
  object-position: 50% 58%;
}

/* Songs and dress code */

.band {
  padding: var(--space-section) 0;
  background: var(--olive);
  color: var(--on-olive);
}

.band .icon { color: var(--on-olive); }

.band__grid { display: grid; gap: 4.5rem; }

.dress,
.songs { text-align: center; }

.dress__title { margin: 0.4rem 0 0.7rem; font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.4rem); }
.dress__value { color: var(--on-olive); font-size: 1.25rem; }

.songs__title {
  margin: 0.4rem auto 1.1rem;
  max-width: 11em;
  font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.2rem);
  line-height: 1.55;
  text-wrap: balance;
}

.songs__lead { max-width: 30em; margin: 0 auto 2.25rem; color: var(--on-olive-soft); }

/* Gallery */

.gallery { padding: var(--space-section) 0; background: var(--paper-2); }

.gallery__title {
  margin-bottom: 2.5rem;
  color: var(--olive);
  font-size: clamp(2.2rem, 1.8rem + 1.6vw, 2.9rem);
  text-align: center;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__grid li { aspect-ratio: 4 / 5; }
.gallery__grid li:first-child { grid-column: span 2; }

.tile {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: var(--paper);
  cursor: zoom-in;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}

.tile:hover img { transform: scale(1.045); }

/* RSVP */

/* Vertical padding also follows the screen height, so the short card fits a laptop screen (1366x657 viewport). */
.rsvp { --stripe: var(--stripe-mid); padding: min(var(--space-section), 14svh) clamp(1.75rem, 6vw, 2.5rem); background: var(--paper); }

.rsvp__card {
  width: min(100%, 40rem);
  margin-inline: auto;
  padding: clamp(2.5rem, 1.75rem + 3vw, 3.75rem) clamp(1.25rem, 0.5rem + 3.5vw, 3.25rem);
  background: var(--paper);
  box-shadow: var(--shadow-lift);
  text-align: center;
}

/* The adults-only note follows the button as a footnote: the deadline and the action lead. */
.rsvp__note { max-width: 30em; margin: 1.75rem auto 0; color: var(--ink-soft); font-size: 1.05rem; }

.rsvp__deadline { margin-bottom: 2.5rem; color: var(--olive); }
.rsvp__deadline .script { display: block; margin-bottom: 0.5rem; font-size: 1.45rem; }

.rsvp__deadline strong {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rsvp__done { padding: 1.5rem 0 0.5rem; }
.rsvp__done:focus { outline: none; }
.rsvp__done-title { margin-bottom: 0.75rem; color: var(--olive); font-size: 2.3rem; }
.rsvp__done p:not(.rsvp__done-title) { max-width: 26em; margin: 0 auto 1rem; }

/* The card is short now (deadline, button, note), so it keeps a tighter rhythm and fits one screen. */
.rsvp .section-title { margin-bottom: clamp(1.5rem, 1.25rem + 1vw, 2.25rem); }
.rsvp .rsvp__deadline { margin-bottom: 1.9rem; }
.no-js .rsvp__open { display: none; }

/* RSVP sheet: a stripe field like the cover, with the form on a sheet of paper that scrolls on its own. */

.sheet {
  --stripe: var(--stripe-mid);
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(0.75rem, 0.25rem + 2.5vmin, 2.5rem);
  border: 0;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  isolation: isolate;
}

.sheet[open] { display: flex; align-items: center; justify-content: center; animation: sheet-fade 0.35s ease; }
.sheet::backdrop { background: transparent; }

.sheet__panel {
  width: min(100%, 36rem);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  box-shadow: var(--shadow-lift);
  animation: sheet-in 0.6s var(--ease-out);
}

.sheet__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem clamp(1.25rem, 0.75rem + 2vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

/* Small enough to stay on one line next to the close button on phones; balanced if it ever wraps. */
.sheet__title {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.05rem, 0.8rem + 1.1vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: 0.1em;
  text-wrap: balance;
}
.sheet__title:focus { outline: none; }

.sheet__close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--olive);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sheet__close:hover { background: var(--olive); color: var(--paper); }
.sheet__close svg { width: 1.2rem; height: 1.2rem; }

.sheet .form,
.sheet .rsvp__done { padding: clamp(1.25rem, 0.75rem + 2vw, 2.25rem); }
.sheet .rsvp__done { text-align: center; }

/* A tighter rhythm than the page forms, so the form fits with "Sí" chosen and the message folded. */
.sheet .form,
.sheet .when-yes { gap: 1.1rem; }

.form__more { justify-self: start; margin-block: -0.5rem; padding-inline: 0; }

@keyframes sheet-fade {
  from { opacity: 0; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(1.5rem); }
}

/* Add to calendar: an outlined pill under the two "Cómo llegar" buttons, so it doesn't compete with them.
   It stays filled while open and shows two plain links: Google and a .ics file for everything else. */

.calendar { margin-top: clamp(2.75rem, 2rem + 2vw, 3.5rem); text-align: center; }
.calendar summary { list-style: none; }
.calendar summary::-webkit-details-marker { display: none; }
.calendar[open] summary { background: var(--olive); color: var(--paper); }

.calendar__options { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem; margin-top: 0.75rem; }
.calendar[open] .calendar__options { animation: unfold 0.6s var(--ease-out); }
.calendar__opt { display: inline-flex; align-items: center; }

/* Forms */

.form { display: grid; gap: 1.4rem; text-align: left; }
.form--on-dark { max-width: 30rem; margin-inline: auto; }

.field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  padding: 0;
  font-family: var(--font-title);
  font-size: var(--label-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field legend { margin-bottom: 0.45rem; }

.optional {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
}

.form input:not([type="radio"]),
.form textarea {
  width: 100%;
  min-height: 3.3rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
  transition: border-color 0.2s ease, box-shadow 0.25s var(--ease-out);
}

.form textarea { resize: vertical; min-height: 6rem; }

.form input::placeholder,
.form textarea::placeholder { color: #6B705A; }

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 4px rgba(52, 61, 30, 0.14);
}

.form [aria-invalid="true"] { border-color: var(--error); }

.field__hint { font-size: 0.95rem; color: var(--ink-soft); }
.field__error { font-size: 0.95rem; color: var(--error); }
.field__hint:empty,
.field__error:empty { display: none; }

.form__status { min-height: 1.5em; font-size: 0.98rem; color: var(--ink-soft); text-align: center; }
.form__status.is-error { color: var(--error); }

.form--on-dark .optional,
.form--on-dark .field__hint,
.form--on-dark .form__status { color: var(--on-olive-soft); }

.form--on-dark .form__status.is-error { color: var(--error-on-olive); }

.form--on-dark input:not([type="radio"]) {
  border-color: rgba(246, 245, 234, 0.35);
  background: var(--olive-field);
  color: var(--on-olive);
  caret-color: var(--on-olive);
}

.form--on-dark input::placeholder { color: #C9CCB8; }

.form--on-dark input:focus {
  border-color: var(--on-olive);
  box-shadow: 0 0 0 4px rgba(246, 245, 234, 0.16);
}

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.field .choice__opt {
  position: relative;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.choice__opt input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.3rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  text-align: center;
  transition:
    background-color 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}

.choice__opt:hover span { border-color: var(--olive); }

.choice__opt input:checked + span {
  border-color: var(--olive);
  background: var(--olive);
  color: var(--paper);
}

.choice__opt input:focus-visible + span { box-shadow: 0 0 0 4px rgba(52, 61, 30, 0.2); }

.when-yes { display: grid; gap: 1.4rem; }
.js .when-yes:not([hidden]) { animation: unfold 0.6s var(--ease-out); }

@keyframes unfold {
  from { opacity: 0; transform: translateY(-8px); }
}

.stepper {
  display: grid;
  grid-template-columns: 3.3rem 5rem 3.3rem;
  gap: 0.5rem;
  align-items: center;
}

.stepper__btn {
  width: 3.3rem;
  height: 3.3rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--olive);
  font: 400 1.5rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.stepper__btn:hover { background: var(--olive); color: var(--paper); }

.form .stepper input {
  padding: 0.5rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Gift */

.gift { padding: var(--space-section) 0; background: var(--paper); }

.gift__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 36rem;
  text-align: center;
}

.gift__text { margin: 1.1rem 0 1.9rem; color: var(--ink-soft); font-size: 1.15rem; font-style: italic; }

.gift__panel {
  display: grid;
  grid-template-rows: 1fr;
  width: 100%;
  transition: grid-template-rows 0.65s var(--ease-out);
}

.js .gift__panel { grid-template-rows: 0fr; }
.js .gift__panel.is-open { grid-template-rows: 1fr; }
.no-js #gift-toggle { display: none; }
.gift__panel-inner { overflow: hidden; }

.bank {
  display: grid;
  gap: 1.1rem;
  margin: 1.9rem 0 0;
  padding: 1.35rem 1.25rem;
  border-radius: 16px;
  background: var(--paper-2);
  text-align: left;
}

.bank div { display: grid; gap: 0.2rem; }

.bank dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
}

.bank__value {
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.copy {
  appearance: none;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 1.5px solid var(--olive);
  border-radius: 999px;
  background: transparent;
  color: var(--olive);
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.copy:hover,
.copy.is-done { background: var(--olive); color: var(--paper); }

/* On phones the 22-digit CVU pushes its button to the next line; keep it right, like the alias one. */
.bank .copy { margin-left: auto; }

/* Closing */

.closing {
  padding: var(--space-section) 0 calc(var(--space-section) * 0.8);
  background: var(--olive);
  color: var(--on-olive);
  text-align: center;
}

.closing__thanks { margin-bottom: 1.75rem; font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); }
.closing__sign { margin-bottom: 0.5rem; font-size: 1.2rem; }
.closing .label { color: var(--on-olive-soft); }

/* Lightbox */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(27, 32, 15, 0.95);
  color: var(--on-olive);
}

.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }

.lightbox__figure { display: grid; justify-items: center; gap: 0.9rem; margin: 0; }

.lightbox__figure img {
  max-width: min(92vw, 64rem);
  max-height: 80dvh;
  object-fit: contain;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  animation: settle 0.5s var(--ease-out);
}

.lightbox__count { color: var(--on-olive-soft); font-family: var(--font-title); font-size: var(--label-size); letter-spacing: 0.18em; }

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1.5px solid rgba(246, 245, 234, 0.4);
  border-radius: 50%;
  background: rgba(27, 32, 15, 0.5);
  color: var(--on-olive);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover { background: var(--olive-soft); }

.lightbox__close svg,
.lightbox__nav svg { width: 1.3rem; height: 1.3rem; }

.lightbox__close { top: max(1rem, env(safe-area-inset-top)); right: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

@keyframes settle {
  from { opacity: 0; transform: scale(0.97); }
}

/* Scroll reveals: content is visible without JS; JS opts into the entrance. */

.js .reveal {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease-out),
    filter 0.9s var(--ease-out),
    transform 1.1s var(--ease-out);
}

.js .reveal.is-in { opacity: 1; filter: none; transform: none; }

/* Layout from tablet up */

@media (min-width: 600px) {
  .hero__when .dot { display: inline; }
  .hero__when br { display: none; }
}

@media (min-width: 820px) {
  .event__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }

  /* The photo is too small to go full-bleed here, so the band does: pale stripes edge to edge, the photo as a print. */
  .venue { padding: clamp(3.5rem, 6vw, 5.5rem) 1.25rem; }
  .venue::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: -1;
    height: 35%;
    background: linear-gradient(var(--paper), transparent);
  }
  .venue img {
    width: min(100%, 30rem);
    height: auto;
    margin-inline: auto;
    aspect-ratio: 4 / 5;
    border: 0.8rem solid var(--paper);
    box-shadow: 0 16px 34px -14px rgba(34, 40, 26, 0.6);
    transform: rotate(1deg);
  }

  .gallery__grid { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
  .gallery__grid li:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

  /* Wider sheet with the short fields in pairs: name | contact, "¿Venís?" | guests. Everything else takes the full row. */
  .sheet__panel { width: min(100%, 44rem); }
  .sheet .form { grid-template-columns: 1fr 1fr; column-gap: 1.25rem; }
  .sheet .form > *,
  .sheet .when-yes > * { grid-column: 1 / -1; }
  .sheet .field--half { grid-column: auto; }
  .sheet .when-yes { display: contents; }
  .js .sheet .when-yes:not([hidden]) > * { animation: unfold 0.6s var(--ease-out); }
}

@media (min-width: 900px) {
  .band__grid { grid-template-columns: 1.25fr 0.75fr; align-items: center; gap: 5rem; }
  .dress { padding: 2.5rem 0 2.5rem 5rem; border-left: 1px solid rgba(246, 245, 234, 0.22); }
}

@media (min-width: 960px) {
  .hero { padding: 6rem 0; }
  .hero__inner { grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; width: min(100% - 5rem, 1040px); }
  .hero__text { min-height: 0; }
  .hero__art { width: 21rem; }
  .hero__names { font-size: clamp(6rem, 1rem + 6vw, 7.5rem); }
  .hero__photo { justify-self: center; width: min(100%, 25rem); margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal { opacity: 1; filter: none; transform: none; }
}

/* Cormorant SC needs the heavier cut at small sizes to stay readable. */
.field label,
.field legend,
.float-cta,
.hero__claim,
.copy,
.rsvp__deadline strong,
.lightbox__count { font-weight: 600; }
.field .optional { font-weight: 400; }

/* Large stripe fields (RSVP and its sheet) use a soft sage and a wider rhythm on big screens, so they don't vibrate. */
@media (min-width: 820px) {
  .stripes::before,
  .sheet::before {
    -webkit-mask-size: 168px 504px;
    mask-size: 168px 504px;
  }
}

/* Hero call to action and scroll cue: the button leads; the arrow only helps on large screens. */
.hero__cta { margin-top: 1.6rem; }
.hero__scroll { display: none; }

@media (min-width: 960px) {
  .hero__scroll { display: grid; }
  .hero__claim { font-size: 1.6rem; }
  .hero__when { font-size: 1.3rem; }
}

/* After confirming, the song suggestion is the natural next step. */
.rsvp__song { margin: 0.5rem 0 0.75rem; }

/* RSVP stripes: a finer hand-painted tile, after the couple's Canva reference. Two colors to choose from:
   dark olive (default) and sage, previewed with ?rayas=clara. Declared after the shared mask size and the
   base sage color so it wins. */
.rsvp::before,
.sheet::before {
  -webkit-mask-image: url("assets/rayas-finas.svg");
  mask-image: url("assets/rayas-finas.svg");
}

:is(.rsvp, .sheet) { --stripe: var(--olive); }
[data-rayas="clara"] :is(.rsvp, .sheet) { --stripe: var(--stripe-mid); }

/* Phones: floating CTA on the right, away from the music button on the left. Declared last so it beats the base rules. */
@media (max-width: 599px) {
  .float-cta { left: auto; right: max(0.75rem, env(safe-area-inset-right)); transform: none; }
  .float-cta.is-hidden { transform: translateY(160%); }
}

/* Phones: the hero print fits (almost) whole on the first screen, and the RSVP sheet fits with "Sí" chosen. */
@media (max-width: 599px) {
  .hero { padding-top: 1.5rem; }
  .hero__inner { gap: 1.25rem; }
  .hero__art { width: min(42vw, 13.5rem); }
  .hero__claim { margin-top: 0.9rem; }
  .hero__cta { margin-top: 1.25rem; }
  .hero__photo { width: 80%; margin-top: 0; }

  .sheet .form { padding-block: 0.9rem 1rem; }
  .sheet .form,
  .sheet .when-yes { gap: 0.8rem; }
  /* Below the send button, so a message that shows up later never pushes anything. */
  .sheet .form__status:empty { min-height: 0; }
}
