/* ==========================================================================
   Alya & Rifau — Wedding Website
   Quiet luxury · one page · mobile first
   ========================================================================== */

:root {
  --ivory: #F8F5F0;        /* page */
  --paper: #F1ECE4;        /* alternate band */
  --ink: #1F2420;          /* text */
  --muted: #5B6259;        /* secondary text (5.6:1 on ivory) */
  --deep-sage: #52634F;    /* brand accent */
  --sage: #A8B59A;         /* brand: rules, accents on dark */
  --forest: #1D2B23;       /* dark buttons, photo overlays */
  --blush: #E8C4CC;        /* brand: tiny accents only */
  --line: rgba(31, 36, 32, .14);
  --error: #8A2E3B;

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

  --gutter: 28px;
  --section: 104px;
  --measure: 34rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --bar-h: 0px;            /* set when the mobile RSVP bar is showing */
}
@media (min-width: 900px) { :root { --gutter: 48px; --section: 168px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font-family: var(--serif); font-size: 20px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p, h1, h2, h3, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 300; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.label {
  font-family: var(--sans); font-size: 11px; font-weight: 400;
  letter-spacing: .3em; text-transform: uppercase;
}
.caps {
  font-family: var(--serif); font-weight: 300; text-transform: uppercase;
  letter-spacing: .1em; line-height: 1.05;
}
.amp { font-style: italic; font-weight: 300; text-transform: none; letter-spacing: 0; color: var(--sage); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Section heading: —— THE INVITATION */
.kicker {
  display: flex; align-items: center; gap: 14px;
  color: var(--deep-sage); margin-bottom: 36px;
}
.kicker::before { content: ""; width: 40px; height: 1px; background: currentColor; opacity: .5; }
.kicker--center::after { content: ""; width: 40px; height: 1px; background: currentColor; opacity: .5; }
.kicker--center { justify-content: center; }

.h2 { font-size: clamp(38px, 9vw, 64px); }

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 54px; padding: 0 32px;
  background: var(--forest); color: var(--ivory); border: 1px solid var(--forest);
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border-radius: 0;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--deep-sage); border-color: var(--deep-sage); }
.btn--outline { background: transparent; color: var(--forest); }
.btn--outline:hover { background: var(--forest); color: var(--ivory); }
.btn--light { background: var(--ivory); color: var(--forest); border-color: var(--ivory); }
.btn--block { width: 100%; padding: 0 16px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn svg, .link svg { transition: transform .3s var(--ease); }
.btn:hover svg, .link:hover svg { transform: translateX(4px); }

.link {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 0;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  text-decoration: none; color: var(--forest);
}
.link span { border-bottom: 1px solid currentColor; padding-bottom: 4px; }
.link-btn {
  min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.link-btn--accent { color: var(--forest); text-decoration: underline; text-underline-offset: 5px; }

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed; inset: 0 0 auto; z-index: 40; color: var(--ivory);
  transition: background .4s var(--ease), color .4s var(--ease), box-shadow .4s;
}
.header.is-solid {
  background: rgba(248, 245, 240, .94); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.header__inner {
  max-width: 1280px; margin: 0 auto; height: 68px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
@media (min-width: 900px) { .header__inner { height: 88px; } }
.monogram {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  font-family: var(--serif); font-weight: 300; font-size: 26px; line-height: 1; letter-spacing: .04em;
}
.monogram i { width: 1px; height: 20px; background: currentColor; opacity: .55; }
.header__nav { display: none; gap: 44px; }
.header__nav a { font-family: var(--sans); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; text-decoration: none; padding: 10px 0; }
.header__nav a:hover { opacity: .65; }
.header__rsvp {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px;
  border: 1px solid currentColor; text-decoration: none;
  font-family: var(--sans); font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
}
@media (min-width: 900px) { .header__nav { display: flex; } }
@media (max-width: 899px) { .header.is-solid .header__rsvp { opacity: 0; pointer-events: none; } }
.header__rsvp { transition: opacity .3s; }

/* Uploaded logo replaces the A | R monogram (text stays for screen readers via aria-label) */
.has-logo .monogram {
  font-size: 0; gap: 0; height: 30px; width: calc(30px * var(--logo-ratio, 3));
  background: var(--logo-img) left center / contain no-repeat;
}
.has-logo .monogram i { display: none; }
.has-logo .rsvp-top .monogram { height: 26px; width: calc(26px * var(--logo-ratio, 3)); }
/* Logo turns white over photos (header before scrolling, RSVP header) */
.logo-white .header:not(.is-solid) .monogram,
.logo-white .rsvp-top .monogram { filter: brightness(0) invert(1); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 128px var(--gutter) 40px; text-align: center; color: var(--ivory); background: var(--forest);
}
.hero__img {
  position: absolute; inset: 0; z-index: -2;
  background: var(--hero-m-img, url("../images/hero-mobile.jpg")) var(--hero-m-pos, 50% 0) / var(--hero-m-size, auto 108%) no-repeat;
  animation: settle 2.4s var(--ease) both;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(14, 24, 19, .55) 0%, rgba(14, 24, 19, .15) 42%, rgba(14, 24, 19, 0) 70%, rgba(14, 24, 19, .3) 100%),
    rgba(14, 24, 19, var(--hero-shade, 0)); /* “Darken photo” setting */
}
@keyframes settle { from { transform: scale(1.06); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .hero { padding-top: clamp(150px, 19vh, 220px); }
  .hero__img { background: var(--hero-d-img, url("../images/hero-desktop.jpg")) var(--hero-d-pos, 50% 100%) / cover no-repeat; }
}
.hero__names {
  font-size: clamp(42px, 11.5vw, 128px); white-space: nowrap; margin: 22px 0 20px;
}
.hero__names .amp { font-size: 1.05em; margin: 0 .2em 0 .14em; }
.hero__date { font-family: var(--sans); font-size: 11px; letter-spacing: .34em; text-transform: uppercase; opacity: .92; }
@media (min-width: 760px) { .hero__date { font-size: 13px; } }

.fade { opacity: 0; transform: translateY(14px); animation: fade 1.4s var(--ease) forwards; }
.fade--2 { animation-delay: .25s; } .fade--3 { animation-delay: .5s; }
@keyframes fade { to { opacity: 1; transform: none; } }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: var(--section) var(--gutter); }
.section--paper { background: var(--paper); }
.wrap { max-width: var(--measure); margin: 0 auto; }

/* 01 Invitation */
.invitation { text-align: center; }
.invitation__lead { font-style: italic; font-size: 22px; color: var(--muted); }
.invitation__names { font-size: clamp(40px, 10vw, 68px); margin: 26px 0; }
.invitation__body { font-size: clamp(21px, 2.4vw, 24px); line-height: 1.55; max-width: 22em; margin: 0 auto; }
.rule { width: 1px; height: 56px; background: var(--sage); margin: 44px auto; }

/* 02 Story — one image, one paragraph */
.story { display: grid; gap: 44px; max-width: 1120px; margin: 0 auto; align-items: center; }
.story__img { aspect-ratio: 4 / 5; overflow: hidden; margin: 0 calc(var(--gutter) * -1); background: var(--paper); }
.story__img img { width: 100%; height: 100%; object-fit: cover; }
.story__text p + p { margin-top: 18px; }
@media (min-width: 900px) {
  .story { grid-template-columns: 1fr 1fr; gap: 96px; }
  .story__img { margin: 0; }
}

/* 03 Details — definition list */
.details { max-width: 760px; margin: 0 auto; }
.facts { border-top: 1px solid var(--line); }
.fact {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .fact { grid-template-columns: 180px 1fr; gap: 32px; align-items: baseline; padding: 30px 0; } }
.fact dt { color: var(--deep-sage); }
.fact dd { font-size: clamp(24px, 4vw, 30px); line-height: 1.3; font-weight: 400; }
.fact dd small { display: block; margin-top: 6px; font-size: 18px; color: var(--muted); line-height: 1.5; }
.fact .link { margin-top: 10px; }
.countdown-line { margin-top: 28px; color: var(--muted); font-style: italic; text-align: center; }
.countdown-line[hidden] { display: none; }
.map-frame { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; margin-top: 40px; filter: grayscale(.5) sepia(.12); }

/* 04 Schedule */
.timeline { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); list-style: none; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
@media (min-width: 640px) { .timeline li { grid-template-columns: 180px 1fr; gap: 32px; } }
.timeline time, .timeline .t { font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--deep-sage); }
.timeline h3 { font-size: clamp(26px, 5vw, 34px); text-transform: uppercase; letter-spacing: .08em; line-height: 1.15; }
.timeline p { color: var(--muted); font-size: 18px; margin-top: 6px; }

/* 05 RSVP */
.rsvp-cta { text-align: center; }
.rsvp-cta .h2 { margin-bottom: 22px; }
.rsvp-cta p { max-width: 24em; margin: 0 auto 40px; color: var(--muted); }

/* 06 FAQ */
.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 0; font-size: clamp(21px, 3vw, 24px);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: 0 0 13px; height: 13px;
  background: linear-gradient(currentColor, currentColor) center / 13px 1px no-repeat,
              linear-gradient(currentColor, currentColor) center / 1px 13px no-repeat;
  transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__a { padding: 0 0 26px; color: var(--muted); font-size: 19px; }

/* Footer */
.footer {
  padding: 96px var(--gutter) calc(48px + var(--bar-h)); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  border-top: 1px solid var(--line);
}
.footer .caps { font-size: clamp(30px, 7vw, 44px); }
.footer .label { color: var(--muted); }

/* ---------- Mobile RSVP bar ---------- */
.rsvp-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(248, 245, 240, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 -1px 0 var(--line);
  transform: translateY(110%); transition: transform .45s var(--ease);
}
.rsvp-bar.is-visible { transform: none; }
.rsvp-bar p { font-size: 16px; line-height: 1.3; }
.rsvp-bar p .label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.rsvp-bar .btn { min-height: 46px; padding: 0 24px; flex: 0 0 auto; }
@media (min-width: 900px) { .rsvp-bar { display: none; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .fade, .hero__img { opacity: 1; transform: none; transition: none; animation: none; }
}

/* ==========================================================================
   RSVP page
   ========================================================================== */
.rsvp-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--ivory); }
.rsvp-top {
  position: relative; isolation: isolate; overflow: hidden; color: var(--ivory); text-align: center;
  padding: 0 var(--gutter) 44px; background: var(--forest);
}
.rsvp-top::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--hero-d-img, url("../images/hero-desktop.jpg")) var(--hero-d-pos, 30% 15%) / cover no-repeat; }
.rsvp-top::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(14, 24, 19, .45); }
.rsvp-top__bar { display: flex; align-items: center; justify-content: space-between; height: 68px; max-width: 560px; margin: 0 auto 20px; }
.rsvp-top__bar a.back { font-family: var(--sans); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; text-decoration: none; padding: 12px 0; }
.rsvp-top .caps { font-size: clamp(34px, 9.5vw, 54px); white-space: nowrap; }
.rsvp-top .label { margin-top: 16px; display: block; opacity: .9; }

.rsvp-main { width: 100%; max-width: 520px; margin: 0 auto; padding: 48px var(--gutter) 64px; flex: 1; }
.step { display: flex; flex-direction: column; gap: 26px; }
.step[hidden] { display: none; }
.step__title { font-size: clamp(34px, 9vw, 46px); text-transform: uppercase; letter-spacing: .06em; line-height: 1.08; font-weight: 300; }
.step .label { color: var(--deep-sage); }

.seats { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.seats__num { font-size: 44px; font-weight: 300; line-height: 1; }
.question { font-style: italic; font-size: 26px; text-align: center; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--forest); }
.segmented[hidden] { display: none; }
.segmented button {
  min-height: 52px; border: 0; background: transparent; color: var(--forest); cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  transition: background .25s, color .25s;
}
.segmented button + button { border-left: 1px solid var(--forest); }
.segmented button[aria-pressed="true"] { background: var(--forest); color: var(--ivory); }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stepper[hidden] { display: none; }
.stepper__controls { display: flex; align-items: center; gap: 4px; }
.stepper__btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 20px; cursor: pointer; }
.stepper__btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper__value { min-width: 40px; text-align: center; font-size: 32px; font-weight: 300; }

.field { display: flex; flex-direction: column; gap: 2px; }
.field label { color: var(--deep-sage); font-family: var(--sans); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 10px 0;
  border: 0; border-bottom: 1px solid rgba(31, 36, 32, .3); border-radius: 0; background: transparent;
  font-family: var(--serif); font-size: 22px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--forest); }
.field input[aria-invalid="true"] { border-bottom-color: var(--error); }
.field ::placeholder { color: rgba(31, 36, 32, .35); }

.notice { padding: 18px 20px; background: var(--paper); font-size: 18px; display: flex; flex-direction: column; gap: 8px; }
.notice[hidden] { display: none; }
.notice__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.notice select { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); background: var(--ivory); font-family: var(--serif); font-size: 18px; color: var(--ink); }
.notice__ok { color: var(--deep-sage); font-style: italic; }
.error { color: var(--error); font-size: 17px; }
.error:empty { display: none; }

.done { align-items: center; text-align: center; }
.done__mark { font-style: italic; font-weight: 300; font-size: 64px; line-height: .8; color: var(--sage); }
.done__list { width: 100%; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.done__list ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.done__list li { font-size: 24px; font-weight: 300; text-transform: uppercase; letter-spacing: .08em; }

.rsvp-footer { text-align: center; padding: 0 var(--gutter) 40px; }
.loading { text-align: center; color: var(--muted); padding: 32px 0; font-style: italic; }
