/* ═══════════════════════════════════════════════════════════════════════════
   Landing page
   Builds on the design tokens defined in base.html (--cream, --gold, etc.).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --serif:    'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:     'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h:    68px;
  --wrap:     1120px;
  --on-dark:  rgba(247, 243, 238, .78);
  --hairline: rgba(181, 154, 110, .5);
  --danger:   #c0504d;
}

html { scroll-padding-top: var(--nav-h); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(247, 243, 238, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-dark);
  color: var(--charcoal);
  transition: background .35s ease, color .35s ease, border-color .35s ease;
}
/* Only go transparent when JS can switch it back to solid on scroll. */
.js .site-nav:not(.is-solid) {
  background: transparent;
  backdrop-filter: none;
  border-bottom-color: transparent;
  color: var(--cream);
}
.site-nav-brand {
  font-family: var(--serif);
  font-size: 1.7rem; font-weight: 500; letter-spacing: .02em;
}
.site-nav-brand span { font-style: italic; color: var(--gold); margin: 0 .06em; }
.site-nav-links {
  display: flex; gap: clamp(.9rem, 3vw, 2.25rem);
  list-style: none;
}
.site-nav-links a {
  font-size: .95rem; letter-spacing: .02em;
  padding: .4rem 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .25s ease;
}
.site-nav-links a:hover,
.site-nav-links a:focus-visible { background-size: 100% 1px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  background: var(--charcoal);
  color: var(--cream);
}
.hero-media,
.hero-placeholder { position: absolute; inset: 0; z-index: -2; }

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1)    translate3d(0, 0, 0); }
  to   { transform: scale(1.09) translate3d(-1.5%, -1%, 0); }
}

/* Shown until you add photos to static/img/hero/ */
.hero-placeholder {
  background:
    radial-gradient(60% 70% at 20% 80%, rgba(181, 154, 110, .5), transparent 70%),
    radial-gradient(50% 60% at 80% 20%, rgba(140, 114, 80, .4),  transparent 70%),
    linear-gradient(160deg, #35312d, #1e1c1a);
  background-size: 150% 150%, 150% 150%, 100% 100%;
  animation: glow 18s ease-in-out infinite alternate;
}
@keyframes glow {
  from { background-position: 0% 100%, 100% 0%, 0 0; }
  to   { background-position: 100% 0%, 0% 100%, 0 0; }
}

/* Keeps text legible over any photo */
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(
    to top,
    rgba(18, 16, 14, .8) 0%,
    rgba(18, 16, 14, .25) 48%,
    rgba(18, 16, 14, .5) 100%
  );
}

.hero-inner {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 8vh, 5rem);
  display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: 2rem 3rem;
}
.hero-names {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(4.5rem, 15vw, 12rem);
  line-height: .9; letter-spacing: -.02em;
}
/* Each name sits in a clipped line and rises into view on load. */
.hero-line {
  display: block; overflow: hidden;
  padding: 0 .06em .14em 0; margin-bottom: -.14em;   /* room for descenders */
}
.hero-line > span {
  display: inline-block;
  animation: rise 1.5s cubic-bezier(.2, .7, .1, 1) backwards;
}
.hero-line--2 { padding-left: clamp(1.5rem, 9vw, 9rem); }
.hero-line--2 > span { animation-delay: .3s; }
.amp {
  font-style: italic; font-weight: 300;
  color: var(--gold-light);
  margin-right: .14em;
}
@keyframes rise { from { transform: translateY(105%); } }

.hero-when {
  text-align: right;
  font-size: clamp(1rem, 1.5vw, 1.15rem); letter-spacing: .03em;
  line-height: 1.7; color: var(--on-dark);
  animation: fade 1.4s ease 1s backwards;
}
.hero-when span { display: block; }
.hero-when-date {
  font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--cream); letter-spacing: 0;
}
@keyframes fade { from { opacity: 0; transform: translateY(10px); } }

/* ── Shared section layout ───────────────────────────────────────────────── */
.wrap {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}
.wrap--narrow { max-width: 860px; }

.section { padding-block: clamp(4.5rem, 11vw, 9rem); }

.section-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  line-height: 1.05; letter-spacing: -.01em;
}
.section-intro {
  font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.4rem);
  line-height: 1.55; color: var(--stone);
  max-width: 36em; margin-top: 1.25rem;
}

/* ── Invitation ──────────────────────────────────────────────────────────── */
.invite-lead {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.12; letter-spacing: -.01em;
  text-wrap: balance;
}
.invite-body {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.55;
  color: var(--stone);
  max-width: 34em; margin-top: 1.75rem;
}

/* ── Photo bands between sections ────────────────────────────────────────── */
.band {
  position: relative; isolation: isolate; overflow: hidden;
  height: clamp(260px, 52vh, 560px);
  background: var(--charcoal-2);
}
/* Taller than the band so it can drift without exposing edges. */
.band-img {
  position: absolute; left: 0; top: -10%;
  width: 100%; height: 120%; object-fit: cover;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .band-img {
      animation: band-drift linear both;
      animation-timeline: view();
    }
  }
}
@keyframes band-drift {
  from { transform: translateY(-7%); }
  to   { transform: translateY(7%); }
}
/* Placeholders until you add photos to static/img/dividers/ */
.band--empty.band--0 { background: radial-gradient(70% 90% at 25% 60%, rgba(181,154,110,.5), transparent 70%), linear-gradient(120deg, #2f2c29, #1e1c1a); }
.band--empty.band--1 { background: radial-gradient(70% 90% at 75% 40%, rgba(212,184,150,.4), transparent 70%), linear-gradient(240deg, #3a342d, #24211e); }
.band--empty.band--2 { background: radial-gradient(70% 90% at 50% 70%, rgba(140,114,80,.55), transparent 70%), linear-gradient(180deg, #2f2c29, #1e1c1a); }

/* ── Time and place ──────────────────────────────────────────────────────── */
.details-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.detail { border-top: 1px solid var(--hairline); padding-top: 1.75rem; }
.detail-lead {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1;
  margin-bottom: 1.1rem;
}
.detail p,
.detail address {
  font-style: normal; font-size: 1.05rem; line-height: 1.7;
  color: var(--stone); max-width: 28em;
}
.detail address { margin-bottom: .75rem; }
.text-link {
  display: inline-block; margin-top: 1.25rem; padding-bottom: 2px;
  color: var(--gold-dark); font-weight: 500;
  border-bottom: 1px solid currentColor;
  transition: color var(--transition);
}
.text-link:hover { color: var(--charcoal); }

/* ── Where to stay ───────────────────────────────────────────────────────── */
.stay-list {
  list-style: none;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--hairline);
}
.stay-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 1rem clamp(1.5rem, 4vw, 3rem); align-items: center;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}
.stay-name h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.85rem; line-height: 1.15;
}
.stay-name p { color: var(--stone); font-size: .95rem; margin-top: .3rem; }
.stay-note { color: var(--stone); line-height: 1.65; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-outline,
.btn-outline-dark,
.btn-gold,
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.5rem;
  font-size: 1rem; font-weight: 500; letter-spacing: .02em;
  border-radius: 2px; border: 1px solid transparent;
  white-space: nowrap; text-align: center;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform .12s;
}
.btn-outline,
.btn-outline-dark { color: var(--charcoal); border-color: var(--gold-dark); }
.btn-outline:hover,
.btn-outline-dark:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--cream); }

.btn-gold { background: var(--gold); color: var(--charcoal); font-weight: 600; padding: .95rem 1.9rem; }
.btn-gold:hover { background: var(--gold-light); }
.btn-gold:active { transform: scale(.985); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #a8433f; }

/* ── RSVP ────────────────────────────────────────────────────────────────── */
.rsvp { background: var(--charcoal); color: var(--cream); }
.rsvp-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem); align-items: start;
}
.rsvp-intro p {
  font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.45rem);
  line-height: 1.5; color: var(--on-dark);
  margin-top: 1.25rem; max-width: 24em;
}
.rsvp-fine,
.rsvp-intro .rsvp-fine {   /* the second selector outranks `.rsvp-intro p` above */
  font-family: var(--sans); font-size: .9rem; line-height: 1.5;
  color: var(--stone-light); margin-top: .6rem;
}

.rsvp-panel {
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  border: 1px solid rgba(212, 184, 150, .4);
}
.rsvp .btn-outline { color: var(--cream); border-color: rgba(247, 243, 238, .5); }
.rsvp .btn-outline:hover { background: var(--cream); border-color: var(--cream); color: var(--charcoal); }
.rsvp :focus-visible { outline-color: var(--gold-light); }

.notice {
  margin-bottom: 1.75rem; padding: .85rem 1.1rem;
  border-left: 2px solid var(--gold);
  background: rgba(247, 243, 238, .07);
  font-size: .95rem; line-height: 1.55; color: var(--on-dark);
}

.field label,
.magic label {
  display: block; margin-bottom: .35rem;
  font-size: .95rem; color: var(--gold-light);
}
.field input {
  width: 100%; padding: .55rem 0;
  background: transparent; color: var(--cream);
  border: 0; border-bottom: 1px solid rgba(247, 243, 238, .55);
  border-radius: 0;
  font-family: var(--serif); font-size: 1.7rem;
  transition: border-color var(--transition);
}
.field input::placeholder { color: rgba(247, 243, 238, .35); }
.field input:focus { outline: none; border-bottom-color: var(--gold-light); box-shadow: 0 1px 0 var(--gold-light); }
.field input[aria-invalid="true"] { border-bottom-color: #e58a87; }
.field-error { margin-top: .75rem; color: #f0a9a6; font-size: .95rem; }
.rsvp-form .btn-gold { margin-top: 1.75rem; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.rsvp-done-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.9rem, 3.5vw, 2.5rem); line-height: 1.12;
  margin-bottom: .75rem;
}
.rsvp-done > p { color: var(--on-dark); line-height: 1.6; }
.magic { margin: 2rem 0; }
.magic-row { display: flex; gap: .6rem; }
.magic-row input {
  flex: 1; min-width: 0; padding: .7rem .85rem;
  background: rgba(247, 243, 238, .06); color: var(--cream);
  border: 1px solid rgba(247, 243, 238, .25); border-radius: 2px;
  font-family: var(--sans); font-size: .92rem;
  text-overflow: ellipsis;
}
.magic-row input:focus { outline: 2px solid var(--gold-light); outline-offset: 2px; }

/* Retract confirmation */
dialog {
  width: calc(100% - 2rem); max-width: 440px;
  margin: auto; padding: 2rem;
  border: 0; border-radius: 4px;
  background: var(--cream); color: var(--charcoal);
  box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop .25s cubic-bezier(.4, 0, .2, 1); }
dialog::backdrop { background: rgba(30, 28, 26, .65); backdrop-filter: blur(4px); }
dialog h3 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; line-height: 1.15; }
dialog p  { color: var(--stone); line-height: 1.6; margin-top: .6rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; margin-top: 1.75rem; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--charcoal); color: var(--stone-light);
  border-top: 1px solid rgba(247, 243, 238, .12);
  padding: 3rem clamp(1.25rem, 5vw, 3rem) 3.5rem;
  text-align: center; font-size: .95rem; line-height: 1.7;
}
.footer-names { font-family: var(--serif); font-size: 1.8rem; color: var(--cream); }
.footer-names em { color: var(--gold); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.25rem; }
.footer-links a { border-bottom: 1px solid transparent; transition: color var(--transition), border-color var(--transition); }
.footer-links a:hover { color: var(--cream); border-bottom-color: currentColor; }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-when  { text-align: left; }
  .details-grid,
  .rsvp-grid  { grid-template-columns: 1fr; }
  .stay-item  { grid-template-columns: 1fr; align-items: start; }
  .stay-item .btn-outline { justify-self: start; }
  .magic-row  { flex-direction: column; }
  .magic-row .btn-outline { align-self: flex-start; }
}
@media (max-width: 480px) {
  .site-nav-brand { font-size: 1.45rem; }
  .site-nav-links a { font-size: .88rem; }
  .dialog-actions > * { flex: 1; }
}

/* ── Reduced motion: show everything in its final state ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-line > span,
  .hero-when,
  .hero-slide img,
  .hero-placeholder,
  .band-img,
  dialog[open] { animation: none; }
  .hero-slide { transition: none; }
}
