/* =========================================================================
   Tuscan wedding — palette drawn from the villa: honey limestone, terracotta
   roof-tile, cypress + olive green, soft Tuscan sky.
   ========================================================================= */

:root {
  --paper:        #e8ede0;   /* light sage green */
  --paper-2:      #dfe6d4;   /* deeper sage tint for alt sections */
  --card:         #fbfcf7;
  --ink:          #2c2a20;   /* deep stone shadow */
  --ink-soft:     #4a4638;
  --muted:        #857c66;

  --stone:        #b8a684;   /* honey stone */
  --stone-deep:   #8a7a5c;
  --terracotta:   #b1573a;   /* roof tile */
  --terracotta-2: #97452d;
  --cypress:      #3f4a2a;   /* deep cypress */
  --olive:        #6d7449;
  --sage:         #98a074;
  --sky:          #7c9fbe;
  --gold:         #b3894e;
  --lavender:     #7f6cae;   /* accent — the lavender farm */
  --lavender-2:   #6c5a9c;

  --line:         rgba(44, 42, 32, 0.14);
  --shadow-sm:    0 1px 2px rgba(44, 42, 32, .06), 0 6px 18px rgba(44, 42, 32, .06);
  --shadow-lg:    0 20px 60px -20px rgba(44, 42, 32, .35);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Jost", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --maxw: 940px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

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

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .38em;
  font-size: .72rem;
  font-weight: 500;
  color: var(--lavender);
  margin: 0 0 1.1rem;
}

/* ---------- Loading splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--paper);
  transition: opacity .5s var(--ease);
}
.splash.is-hidden { opacity: 0; pointer-events: none; }
.splash__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--lavender);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(.6); opacity: .4 } 50% { transform: scale(1); opacity: 1 } }

/* =========================================================================
   LOGIN GATE
   ========================================================================= */
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(127,108,174,.30), transparent 60%),
    radial-gradient(90% 60% at 50% 120%, rgba(63,74,42,.28), transparent 55%),
    linear-gradient(180deg, #dbe3d0 0%, #e8ede0 45%, #d7e0cb 100%);
}
/* faint tower silhouette line-art vibe via layered gradients */
.gate::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.25), transparent 12%),
    radial-gradient(circle at 82% 22%, rgba(255,255,255,.18), transparent 10%);
  pointer-events: none;
}

.gate__card {
  position: relative; z-index: 1;
  max-width: 460px;
  padding: 3.2rem 2.2rem 2.6rem;
  background: rgba(255,253,247,.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}

.monogram {
  width: 72px; height: 72px;
  margin: 0 auto 1.6rem;
  position: relative;
  display: grid; place-items: center;
}
.monogram__ring {
  position: absolute; inset: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
}
.monogram__ring::before {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(179,137,78,.4);
  border-radius: 50%;
}
.monogram__text {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--lavender);
}

.gate__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.06;
  letter-spacing: .01em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.gate__sub {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: 0 auto 1.8rem;
  max-width: 30ch;
}

.login { display: flex; flex-direction: column; gap: .8rem; }
.login input[type="password"] {
  font-family: var(--sans);
  font-size: 1rem;
  text-align: center;
  letter-spacing: .12em;
  padding: .95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.login input[type="password"]:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(127,108,174,.14);
}
.login__error {
  color: var(--lavender-2);
  font-size: .88rem;
  margin: .2rem 0 0;
}
.gate__foot {
  position: relative; z-index: 1;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: .95rem 1.4rem;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--solid {
  background: var(--lavender);
  color: #fff8f0;
  box-shadow: 0 8px 20px -8px rgba(108,90,156,.7);
}
.btn--solid:hover { background: var(--lavender-2); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: default; }

/* =========================================================================
   APP
   ========================================================================= */
#app[hidden], #gate[hidden] { display: none !important; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  color: #fdf7ec;
  overflow: hidden;
}
.hero__img {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(180deg, rgba(30,28,20,.15) 0%, rgba(30,28,20,.05) 40%, rgba(28,26,18,.72) 100%),
    image-set(url("/images/villa.webp") type("image/webp"), url("/images/villa.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: center 40%;
  transform: scale(1.03);
}
.hero__inner {
  position: relative; z-index: 1;
  width: 100%;
  padding: 3rem 0 4.5rem;
  animation: rise 1.1s var(--ease) both;
}
.hero .eyebrow { color: #dccff2; }
.hero__names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 11vw, 6.5rem);
  line-height: .98;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0,0,0,.35);
}
.hero__amp { font-style: italic; color: #cdbfe8; font-weight: 400; }
.hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  margin-top: 1.4rem;
  font-size: 1.05rem;
  letter-spacing: .04em;
}
.hero__meta .dot { opacity: .6; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  z-index: 1;
  font-size: .7rem; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(253,247,236,.8);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  animation: bob 2.4s ease-in-out infinite;
}
.hero__scroll span { width: 1px; height: 34px; background: rgba(253,247,236,.7); }
@keyframes bob { 0%,100% { transform: translate(-50%, 0) } 50% { transform: translate(-50%, 8px) } }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.section--tint { background: var(--paper-2); }
.section__eyebrow { text-align: center; }
.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.12;
  text-align: center;
  margin: 0 auto 1.4rem;
  max-width: 20ch;
}
.section__lead {
  text-align: center;
  max-width: 56ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.12rem;
  white-space: pre-line; /* preserve paragraph/line breaks as written */
}
.rule {
  width: 54px; height: 1px; margin: 1.6rem auto 2rem;
  background: var(--lavender); position: relative;
}
.rule::before, .rule::after {
  content: ""; position: absolute; top: 50%; width: 4px; height: 4px;
  border-radius: 50%; background: var(--lavender); transform: translateY(-50%);
}
.rule::before { left: -10px; }
.rule::after { right: -10px; }

/* "The Plan" section — lavender accent (the lavender farm) */
.section--plan .eyebrow { color: var(--lavender); }
.section--plan .rule { background: var(--lavender); }
.section--plan .rule::before,
.section--plan .rule::after { background: var(--lavender); }
.section--plan .fact__label { color: var(--lavender-2); }
.section--plan .venue-note { color: var(--lavender-2); }

/* fact cards */
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: 2.8rem;
}
.fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.6rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.fact__label {
  text-transform: uppercase; letter-spacing: .24em; font-size: .68rem;
  color: var(--lavender); font-weight: 500;
}
.fact__value {
  font-family: var(--serif); font-size: 1.5rem; margin-top: .5rem; color: var(--ink);
}

.venue-note {
  margin: 2.8rem auto 0;
  max-width: 60ch; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 1.3rem;
  color: var(--ink-soft); line-height: 1.5;
}

/* =========================================================================
   SURVEY
   ========================================================================= */
.survey { max-width: 660px; margin: 0 auto; }
.q {
  margin-bottom: 2.2rem;
  animation: rise .6s var(--ease) both;
}
.q__label {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: .35rem;
}
.q__req { color: var(--lavender); font-size: 1rem; vertical-align: super; }
.q__help { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }

.field {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  padding: .85rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field:focus {
  outline: none; border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(127,108,174,.13);
}
textarea.field { min-height: 120px; resize: vertical; line-height: 1.6; }

/* RSVP call-to-action on the main page */
.cta { text-align: center; }
.cta__btn { margin-top: 2.4rem; }
.cta__btn .btn { display: inline-block; text-decoration: none; }

/* radio options as selectable cards */
.options { display: flex; flex-direction: column; gap: .6rem; }
.opt {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .1s var(--ease);
}
.opt:hover { border-color: var(--sage); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__mark {
  flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--stone-deep);
  display: grid; place-items: center;
  transition: border-color .18s var(--ease);
}
.opt__mark::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--lavender); transform: scale(0);
  transition: transform .18s var(--ease);
}
.opt__text { font-size: 1rem; color: var(--ink-soft); }
.opt input:checked + .opt__mark { border-color: var(--lavender); }
.opt input:checked + .opt__mark::after { transform: scale(1); }
.opt:has(input:checked) {
  border-color: var(--lavender);
  background: #f2effa;
}
.opt:has(input:checked) .opt__text { color: var(--ink); }
.opt input:focus-visible + .opt__mark {
  box-shadow: 0 0 0 3px rgba(127,108,174,.2);
}

.submit-row {
  margin-top: 2.6rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.submit-row .btn { min-width: 240px; padding: 1.05rem 1.4rem; }
.form-error {
  color: var(--lavender-2); font-size: .92rem; text-align: center;
}

/* ---------- Thank you ---------- */
.thanks {
  max-width: 560px; margin: 0 auto; text-align: center;
  animation: rise .7s var(--ease) both;
}
.thanks__mark {
  width: 78px; height: 78px; margin: 0 auto 1.6rem;
  border: 1px solid var(--gold); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 2rem; color: var(--lavender);
}
.thanks__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 1rem;
}
.thanks__body { color: var(--ink-soft); font-size: 1.12rem; }

/* ---------- Footer ---------- */
.foot {
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  background: var(--cypress);
  color: #e7e2d0;
}
.foot__mono { font-family: var(--serif); font-size: 1.8rem; color: #cdbfe8; }
.foot__line {
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(231,226,208,.7); margin-top: .8rem;
}
.foot__logout {
  margin-top: 1.4rem; background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(231,226,208,.55);
  text-decoration: underline; text-underline-offset: 4px;
}
.foot__logout:hover { color: #cdbfe8; }

/* ---------- Animations & responsive ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
  .hero__inner { padding-bottom: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
