/* ---------- Base ---------- */
:root {
  --ivory: #f2ebde;
  --ivory-light: #f7f1e6;
  --ivory-deep: #ece2cf;
  --ink: #211d18;
  --ink-soft: #33302a;
  --muted: #6b6558;
  --muted-light: #837c6c;
  --gold: #8d7c56;
  --gold-light: #b9ab89;
  --rule: #a99c81;
  --frame: 22px;
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

p, h1 { margin: 0; }

/* ---------- Fixed frame ---------- */
.frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
.frame-line {
  position: absolute;
  border: 1px solid var(--gold-light);
}
.frame-line--outer { inset: var(--frame); opacity: .7; }
.frame-line--inner { inset: calc(var(--frame) + 7px); opacity: .3; }

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 0 solid var(--gold);
}
.corner--tl { top: var(--frame); left: var(--frame); border-top-width: 1.5px; border-left-width: 1.5px; }
.corner--tr { top: var(--frame); right: var(--frame); border-top-width: 1.5px; border-right-width: 1.5px; }
.corner--bl { bottom: var(--frame); left: var(--frame); border-bottom-width: 1.5px; border-left-width: 1.5px; }
.corner--br { bottom: var(--frame); right: var(--frame); border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 60px;
  scroll-snap-align: start;
}
.section--hero {
  background: radial-gradient(120% 90% at 50% 20%, var(--ivory-light) 0%, var(--ivory) 60%, var(--ivory-deep) 100%);
}
.section--details {
  background: radial-gradient(120% 90% at 50% 80%, var(--ivory-light) 0%, var(--ivory) 60%, var(--ivory-deep) 100%);
}
.section--closing {
  background: var(--ivory);
  padding-bottom: 160px;
}

/* ---------- Hero ---------- */
.monogram {
  height: 90px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 14px;
  font-family: 'Playfair Display', serif;
  color: #2a2621;
  line-height: 1;
}
.monogram-a { font-size: 78px; }
.monogram-s {
  font-size: 44px;
  position: relative;
  top: -30px;
  margin-left: -8px;
}

.label {
  font-size: 15px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #4a453d;
}
.label + .name { margin-top: 10px; }
.name + .label { margin-top: 20px; }

.name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 9vw, 72px);
  font-weight: 600;
  letter-spacing: 4px;
  line-height: 1.1;
  color: var(--ink);
}

.parents {
  margin-top: 22px;
  font-size: 17px;
  letter-spacing: .5px;
  color: #4a453d;
}
.address {
  margin-top: 6px;
  font-size: 16px;
  letter-spacing: 1.2px;
  color: var(--muted-light);
}
.hero-date {
  margin-top: 30px;
  font-style: italic;
  font-size: 22px;
  color: var(--muted);
}

.scroll-cue {
  position: absolute;
  bottom: 46px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ---------- Details ---------- */
.insha {
  font-style: italic;
  font-size: 27px;
  color: #453f34;
}
.big-date {
  margin-top: 18px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(44px, 9vw, 66px);
  letter-spacing: 6px;
  color: var(--ink);
}
.rule {
  width: 140px;
  height: 1px;
  margin: 36px 0;
  background: var(--rule);
}
.rule--wide { width: 160px; margin: 46px 0 30px; }

.detail {
  margin-top: 10px;
  font-size: 21px;
  color: var(--ink-soft);
}
.rule + .detail { margin-top: 0; }
.detail--tight { margin-top: 4px; }

.map-btn {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  min-height: 44px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: #5c5240;
  background: transparent;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background .3s ease, color .3s ease;
}
.map-btn:hover,
.map-btn:focus-visible {
  background: var(--gold);
  color: var(--ivory-light);
  outline: none;
}

.note {
  margin-top: 22px;
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
}

/* ---------- Closing ---------- */
.invite {
  max-width: 580px;
  font-style: italic;
  font-size: 22px;
  line-height: 1.7;
  color: #453f34;
}
.host {
  margin-top: 40px;
  font-size: 25px;
  color: var(--ink);
}
.host .late { font-size: 18px; letter-spacing: 1px; }
.rule--wide + .note { margin-top: 0; }
.host--small { margin-top: 8px; }
.sign-off {
  margin-top: 60px;
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--gold);
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* Hero plays on load */
.hero-anim { opacity: 0; animation: fadeUp 1.1s ease forwards; }
.hero-anim.d0 { animation-delay: .1s; }
.hero-anim.d1 { animation-delay: .5s; }
.hero-anim.d2 { animation-delay: .9s; }
.hero-anim.d3 { animation-delay: 1.3s; }
.hero-anim.d4 { animation-delay: 1.7s; }
.hero-anim.d5 { animation-delay: 2.1s; }

.monogram.hero-anim {
  animation: fadeUp 1.1s ease .1s forwards, floatY 5s ease-in-out 1.2s infinite;
}
.scroll-cue.hero-anim {
  animation: fadeUp 1.1s ease 2.1s forwards, bob 2s ease-in-out 3.2s infinite;
}

/* Scroll reveals — only hidden once script.js confirms it's running,
   so content is never stuck invisible */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s ease, transform 1s ease;
}
.js .reveal-line {
  transform: scaleX(0);
  transition: transform 1.2s ease;
}
.js .reveal.in-view { opacity: 1; transform: none; }
.js .reveal-line.in-view { transform: scaleX(1); }

.js .d1 { transition-delay: .1s; }
.js .d2 { transition-delay: .2s; }
.js .d3 { transition-delay: .3s; }
.js .d4 { transition-delay: .4s; }

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-anim, .monogram.hero-anim, .scroll-cue.hero-anim { animation: none; opacity: 1; }
  .js .reveal, .js .reveal-line { opacity: 1; transform: none; transition: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  :root { --frame: 12px; }
  .section { padding: 90px 32px; }
  .section--closing { padding-bottom: 120px; }
  .corner { width: 22px; height: 22px; }
  .label { font-size: 13px; letter-spacing: 4px; }
  .monogram-a { font-size: 64px; }
  .monogram-s { font-size: 36px; top: -24px; }
  .parents { font-size: 16px; }
  .address { font-size: 14px; }
  .hero-date { font-size: 20px; }
  .detail { font-size: 19px; }
  .invite { font-size: 19px; }
  .invite br { display: none; }
  .host { font-size: 21px; }
  .scroll-cue { bottom: 34px; }
}
