/* ==========================================================================
   Wedding site — theme
   Change the colours/fonts below to match the invitation design.
   ========================================================================== */
:root {
  --paper: #fbf7f3;
  --paper-2: #f5ece6;
  --card: #fffdfb;
  --ink: #3d3233;
  --muted: #86777a;
  --rose: #c48f8d;
  --rose-deep: #9c6264;
  --blush: #ecd3cf;
  --sage: #8b9a84;
  --sage-light: #dfe5d8;
  --gold: #c8a96e;
  --line: rgba(61, 50, 51, .12);

  --serif: "EB Garamond", "Times New Roman", serif;
  --sans: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 1px 2px rgba(61, 50, 51, .04), 0 8px 30px rgba(61, 50, 51, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 300 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--rose-deep); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(34px, 6vw, 52px); font-style: italic; text-align: center; margin-bottom: .5em; }
h3 { font-size: 26px; }
p { margin: 0 0 1em; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 720px; }
.center { text-align: center; }
.lead { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 32px; }
.prose { font-size: 18px; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- Floral line art ---------- */
.sprig { display: block; width: 92px; height: 92px; margin: 0 auto 18px; color: var(--sage); overflow: visible; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 30px; border: 1px solid var(--rose-deep); border-radius: 999px;
  background: var(--rose-deep); color: #fff; font: 500 13px/1 var(--sans);
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--rose-deep); }
.btn.ghost:hover { background: var(--rose-deep); color: #fff; border-color: var(--rose-deep); }
.btn.small { padding: 10px 20px; font-size: 12px; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 64px;
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  transition: background .3s, box-shadow .3s, color .3s;
}
.topbar.scrolled { background: rgba(251, 247, 243, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.brand { font: italic 400 22px/1 var(--serif); color: var(--ink); text-decoration: none; margin-right: auto; opacity: 0; transition: opacity .3s; }
.topbar.scrolled .brand { opacity: 1; }
.nav { display: flex; gap: 26px; }
.nav a, .lang { color: var(--ink); text-decoration: none; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; }
.nav a:hover { color: var(--rose-deep); }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 500; }
.lang:hover { border-color: var(--rose-deep); color: var(--rose-deep); }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: none; padding: 10px 8px; cursor: pointer; }
.menu-btn span { display: block; height: 1.5px; background: var(--ink); margin: 6px 0; transition: transform .25s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

body:has(.hero.has-photo) .topbar:not(.scrolled) .nav a,
body:has(.hero.has-photo) .topbar:not(.scrolled) .lang { color: #fff; border-color: rgba(255,255,255,.4); }
body:has(.hero.has-photo) .topbar:not(.scrolled) .menu-btn span { background: #fff; }

@media (max-width: 820px) {
  .menu-btn { display: block; }
  .brand { opacity: 1; font-size: 20px; }
  body:has(.hero.has-photo) .topbar:not(.scrolled) .brand { color: #fff; }
  .nav {
    position: fixed; inset: 64px 0 auto; flex-direction: column; gap: 0;
    background: var(--paper); box-shadow: 0 12px 30px rgba(0,0,0,.08);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav.open { max-height: 420px; }
  .nav a, body:has(.hero.has-photo) .topbar:not(.scrolled) .nav a { color: var(--ink); padding: 16px var(--gutter); border-top: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  padding: 110px var(--gutter) 70px; text-align: center; overflow: hidden;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(236, 211, 207, .55), transparent 70%),
    radial-gradient(50% 45% at 90% 95%, rgba(223, 229, 216, .7), transparent 70%),
    var(--paper);
}
.hero-photo { position: absolute; inset: 0; background-size: cover; background-position: center 30%; transform: scale(1.04); animation: heroZoom 18s ease-out forwards; }
.hero.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,28,29,.35) 0%, rgba(40,28,29,.25) 45%, rgba(40,28,29,.6) 100%); }
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero.has-photo .hero-inner { color: #fff; }
.hero-flowers { position: absolute; inset: 0; pointer-events: none; }
.hero-flowers .sprig { position: absolute; width: clamp(170px, 30vw, 380px); height: auto; aspect-ratio: 1; margin: 0; opacity: .95; }
.hero-flowers .sprig:first-child { left: clamp(-60px, -3vw, -10px); top: clamp(40px, 6vw, 70px); transform: rotate(-12deg); }
.hero-flowers .sprig:last-child { right: clamp(-60px, -3vw, -10px); bottom: clamp(-20px, 1vw, 20px); transform: rotate(168deg); }
@media (max-width: 700px) {
  .hero-flowers .sprig { width: 150px; opacity: .7; }
  .hero-flowers .sprig:first-child { left: -50px; top: 50px; }
  .hero-flowers .sprig:last-child { right: -50px; bottom: -10px; }
}
.hero.has-photo .hero-flowers { display: none; }
.eyebrow { font-size: 13px; letter-spacing: .32em; text-transform: uppercase; margin-bottom: 18px; color: var(--muted); }
.hero.has-photo .eyebrow { color: rgba(255,255,255,.85); }
.names { font-size: clamp(54px, 13vw, 128px); font-style: italic; letter-spacing: -.01em; line-height: 1; }
.names .amp { display: block; font-size: .42em; color: var(--rose); margin: .12em 0 .08em; font-style: italic; }
.hero.has-photo .names .amp { color: var(--blush); }
.hero-date { font-family: var(--serif); font-size: clamp(22px, 3.4vw, 28px); margin: 22px 0 26px; letter-spacing: .04em; }
.hero-date::before, .hero-date::after { content: ""; display: inline-block; width: 36px; height: 1px; background: currentColor; opacity: .4; vertical-align: middle; margin: 0 16px; }
.hero-intro { max-width: 520px; margin: 26px auto 30px; color: var(--muted); }
.hero.has-photo .hero-intro { color: rgba(255,255,255,.9); }
.hero.has-photo .btn { background: #fff; color: var(--ink); border-color: #fff; }
.hero.has-photo .btn:hover { background: var(--blush); border-color: var(--blush); }

.countdown { display: inline-grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown div { min-width: 74px; padding: 12px 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.5); }
.hero.has-photo .countdown div { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); backdrop-filter: blur(4px); }
.countdown b { display: block; font: 400 32px/1 var(--serif); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.countdown.done { display: block; font: italic 30px/1.2 var(--serif); }
@keyframes heroZoom { to { transform: scale(1); } }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 12vw, 130px) 0; }
.story { background: var(--card); text-align: center; }
.story .prose { text-align: left; }
@media (min-width: 700px) { .story .prose { text-align: center; } }

.details { background: var(--paper-2); text-align: center; }
.big-date { display: flex; justify-content: center; align-items: center; gap: 18px; font: 400 clamp(44px, 9vw, 76px)/1 var(--serif); color: var(--rose-deep); margin: 10px 0 46px; }
.big-date i { width: 1px; height: .8em; background: var(--rose); opacity: .5; transform: rotate(20deg); }
.events { display: grid; gap: 24px; margin: 0 auto 36px; max-width: 860px; }
.events.n2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.event { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 28px 34px; box-shadow: var(--shadow); }
.event .sprig { width: 64px; height: 64px; margin-bottom: 10px; }
.event h3 { font-style: italic; font-size: 32px; margin-bottom: 8px; }
.event-time { font: 500 14px/1 var(--sans); letter-spacing: .2em; color: var(--rose-deep); margin-bottom: 18px; }
.event-venue { font-family: var(--serif); font-size: 22px; margin-bottom: 4px; }
.event-address { color: var(--muted); font-size: 15px; }
.event-note { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.details-note { max-width: 620px; margin: 0 auto 30px; color: var(--muted); font-size: 17px; }

/* ---------- Photos / Instagram ---------- */
.photos { text-align: center; }
.hashtag {
  display: inline-flex; align-items: center; gap: 14px; margin: 0 auto 40px; padding: 12px 14px 12px 26px;
  border: 1px dashed var(--rose); border-radius: 999px; background: var(--card); cursor: pointer;
  font: italic 400 clamp(22px, 4vw, 30px)/1 var(--serif); color: var(--rose-deep);
}
.hashtag small { font: 500 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #fff; background: var(--rose); padding: 9px 14px; border-radius: 999px; font-style: normal; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 45%), 1fr)); gap: 10px; margin: 0 0 36px; }
.ig-grid a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--paper-2); }
.ig-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.ig-grid a:hover img { transform: scale(1.05); }
.ig-grid .vid::after { content: "▶"; position: absolute; top: 8px; right: 10px; color: #fff; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* ---------- Guestbook ---------- */
.guestbook { background: var(--card); }
.guestbook > .wrap > .sprig { margin-bottom: 18px; }
.gb-form {
  max-width: 640px; margin: 0 auto 70px; padding: clamp(24px, 5vw, 44px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.field { display: block; margin-bottom: 22px; }
.field > span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.field input[type=text], .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid rgba(61,50,51,.25); background: transparent; padding: 10px 2px;
  font: 400 18px/1.5 var(--serif); color: var(--ink); border-radius: 0; resize: vertical; transition: border-color .2s;
}
.field textarea { border: 1px solid rgba(61,50,51,.2); border-radius: 4px; padding: 12px 14px; background: var(--card); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--rose-deep); }
.field.invalid input, .field.invalid textarea { border-color: #b04a4a; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.photo-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.previews { display: contents; }
.preview, .add-photo { width: 92px; height: 92px; border-radius: 6px; position: relative; overflow: hidden; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(40,28,29,.7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}
.add-photo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  border: 1px dashed rgba(61,50,51,.3); color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1.2; padding: 6px; background: var(--card);
}
.add-photo:hover { border-color: var(--rose-deep); color: var(--rose-deep); }
.add-photo svg { width: 22px; height: 22px; }
.add-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.add-photo[hidden] { display: none; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.form-foot small { color: var(--muted); font-size: 13px; }
.form-error { color: #a03c3c; background: #fbeceb; border-radius: 4px; padding: 10px 14px; font-size: 15px; }
.form-success { max-width: 640px; margin: 0 auto 60px; padding: 28px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; font: italic 24px/1.4 var(--serif); color: var(--rose-deep); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--blush); }
.progress i { display: block; height: 100%; width: 0; background: var(--rose-deep); transition: width .2s; }

.wall { columns: 3 300px; column-gap: 22px; margin: 0 auto; }
.wall.c1 { columns: 1; max-width: 440px; }
.wall.c2 { columns: 2 300px; max-width: 760px; }
.wish {
  break-inside: avoid; margin: 0 0 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); animation: wishIn .5s ease both;
}
.wish.new { box-shadow: 0 0 0 2px var(--blush), var(--shadow); }
.wish-photos { display: grid; gap: 2px; }
.wish-photos.n2 { grid-template-columns: 1fr 1fr; }
.wish-photos.n3 { grid-template-columns: 1fr 1fr; }
.wish-photos.n3 .wish-photo:first-child { grid-column: span 2; }
.wish-photos.n2 img, .wish-photos.n3 img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.wish-photos.n3 .wish-photo:first-child img { aspect-ratio: 3 / 2; }
.wish-photo { display: block; cursor: zoom-in; }
.wish-text { padding: 22px 24px 4px; font: 400 19px/1.55 var(--serif); white-space: normal; overflow-wrap: anywhere; }
.wish-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 24px 20px; }
.wish-photos + .wish-meta { padding-top: 16px; }
.wish-name { font: italic 500 18px/1.2 var(--serif); color: var(--rose-deep); }
.wish-name::before { content: "— "; }
.wish-date { font-size: 12px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.wall-empty { text-align: center; color: var(--muted); font: italic 22px var(--serif); }
@keyframes wishIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Contact ---------- */
.contact { background: var(--paper-2); text-align: center; }
.people { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.person { min-width: 240px; padding: 28px 30px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.person h3 { font-style: italic; margin-bottom: 10px; }
.person a { display: block; text-decoration: none; margin-top: 4px; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 70px var(--gutter) 60px; color: var(--muted); font-size: 15px; }
.footer .sprig { width: 70px; height: 70px; }
.footer-names { font: italic 34px/1.2 var(--serif); color: var(--ink); margin-bottom: 6px; }
.footer-tag { color: var(--rose-deep); margin-top: 6px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(26,18,19,.94); display: grid; place-items: center; padding: 50px 60px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; border-radius: 2px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 44px; line-height: 1; cursor: pointer; padding: 10px 16px; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 10px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 600px) { .lightbox { padding: 50px 8px; } }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-photo, .wish { animation: none; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .countdown { gap: 6px; }
  .countdown div { min-width: 0; padding: 10px 4px 8px; }
  .countdown b { font-size: 26px; }
  .countdown span { font-size: 9.5px; letter-spacing: .08em; }
  .hero-date::before, .hero-date::after { width: 20px; margin: 0 10px; }
  .form-foot .btn { width: 100%; }
}
