/*
 * Template 01: Elegant Romance (version 1.2.0)
 * Warm ivory, clay accent. Parisienne script for headings, Cormorant Garamond for display text,
 * Jost for body text. Fixed layout. Fonts and images are local files, so this works offline.
 * Motion: staged hero entrance, slow hero zoom, parallax (hero, story photo, photo band),
 * drifting petals, scroll reveals from the sides, drawn heading lines, a countdown, a scroll
 * progress line, button shimmer and image zoom on hover. Everything stops for reduced motion.
 */

@font-face { font-family: 'Parisienne'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/parisienne-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../assets/fonts/cormorant-garamond-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('../assets/fonts/cormorant-garamond-italic-400.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../assets/fonts/jost-normal-400.woff2') format('woff2'); }

:root {
  --bg: #FAF6F0;
  --soft: #F1E9DF;
  --surface: #FFFFFF;
  --ink: #2E2724;
  --muted: #6B5F58;
  --accent: #8A5A45;
  --accent-ink: #FFFFFF;
  --line: #E4D8CB;
  --script: 'Parisienne', 'Snell Roundhand', 'Brush Script MT', cursive;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --wrap: 1080px;
  --bar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

/* ---------- Scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #C98E78, var(--accent)); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(250, 246, 240, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); transition: box-shadow 300ms ease, background-color 300ms ease; }
.topbar.stuck { box-shadow: 0 6px 24px rgba(46, 39, 36, .08); background: rgba(250, 246, 240, .97); }
.topbar-inner { width: min(var(--wrap), 100% - 40px); margin-inline: auto; height: var(--bar); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: var(--script); font-size: 2rem; line-height: 1; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 26px; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 0; position: relative; }
.nav a:not(.btn)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform 300ms var(--ease-out); }
.nav a.btn { color: var(--accent-ink); padding: 8px 18px; }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 500 .95rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; padding: 16px 30px; border-radius: 999px; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease; }
.btn:active { transform: scale(0.97); }
.btn::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); pointer-events: none; }
.btn-sm { font-size: .8rem; padding: 10px 20px; }
.btn-light { background: #fff; border-color: #fff; color: var(--ink); }
.btn-outline { background: transparent; color: var(--accent); }
.link-arrow { display: inline-block; color: var(--accent); text-decoration: none; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow::after { content: ' \2192'; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(92vh, 900px); display: grid; place-items: center; text-align: center; color: #fff; isolation: isolate; overflow: hidden; }
.hero-media { position: absolute; inset: -20% 0; will-change: transform; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(34, 24, 20, .32) 0%, rgba(34, 24, 20, .5) 100%); }
.hero-inner { position: relative; z-index: 2; padding: 80px 20px; display: grid; justify-items: center; gap: 18px; }
.eyebrow { font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }
.hero .eyebrow { color: rgba(255, 255, 255, .85); }
.hero h1 { font-family: var(--script); font-weight: 400; font-size: clamp(4rem, 14vw, 8.5rem); line-height: 1.2; text-shadow: 0 4px 30px rgba(34, 24, 20, .35); }
.hero-date { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3.6vw, 2rem); margin-bottom: 14px; }

/* Petals and scroll cue */
.petals { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.petals i { position: absolute; top: -8%; left: var(--x); width: var(--s); height: calc(var(--s) * 1.35); background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, .95), rgba(240, 200, 190, .75)); border-radius: 80% 0 80% 0; opacity: 0; }
.petals i:nth-child(1) { --x: 6%;  --s: 14px; --d: 13s; --t: -2s;  --w: 60px; }
.petals i:nth-child(2) { --x: 19%; --s: 10px; --d: 17s; --t: -9s;  --w: -50px; }
.petals i:nth-child(3) { --x: 33%; --s: 16px; --d: 15s; --t: -5s;  --w: 70px; }
.petals i:nth-child(4) { --x: 47%; --s: 11px; --d: 19s; --t: -12s; --w: -60px; }
.petals i:nth-child(5) { --x: 61%; --s: 15px; --d: 14s; --t: -7s;  --w: 55px; }
.petals i:nth-child(6) { --x: 74%; --s: 9px;  --d: 18s; --t: -3s;  --w: -70px; }
.petals i:nth-child(7) { --x: 86%; --s: 13px; --d: 16s; --t: -10s; --w: 50px; }
.petals i:nth-child(8) { --x: 94%; --s: 11px; --d: 20s; --t: -14s; --w: -55px; }
.scroll-cue { position: absolute; z-index: 2; bottom: 26px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid rgba(255, 255, 255, .75); border-radius: 14px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: #fff; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-soft { background: var(--soft); }
.section-head { text-align: center; display: grid; justify-items: center; gap: 10px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section h2 { font-family: var(--script); font-weight: 400; font-size: clamp(3rem, 7.5vw, 4.6rem); line-height: 1.2; color: var(--accent); }
.section-head h2::after { content: ''; display: block; width: 44px; height: 1px; background: var(--accent); margin: 14px auto 0; }
.lead { max-width: 560px; color: var(--muted); }

/* Our story */
.story-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.story-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px 8px 8px; overflow: hidden; background: var(--soft); }
.story-photo img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; will-change: transform; }
.story-text { display: grid; gap: 14px; }
.story-text h2::after { content: ''; display: block; width: 44px; height: 1px; background: var(--accent); margin-top: 14px; }
.prose { display: grid; gap: 1em; color: var(--muted); }
.prose p { max-width: 60ch; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery-item { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; background: var(--line); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }

/* Parallax photo band with countdown */
.band { position: relative; isolation: isolate; overflow: hidden; color: #fff; text-align: center; padding-block: clamp(5rem, 14vw, 9rem); }
.band-media { position: absolute; inset: -18% 0; z-index: -2; will-change: transform; }
.band-media img { width: 100%; height: 100%; object-fit: cover; }
.band::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(34, 24, 20, .5); }
.band-inner { display: grid; justify-items: center; gap: 10px; padding-inline: 20px; }
.band .eyebrow { color: rgba(255, 255, 255, .85); }
.band-date { font-family: var(--script); font-size: clamp(3rem, 9vw, 5.4rem); line-height: 1.25; text-shadow: 0 4px 24px rgba(34, 24, 20, .35); }
.countdown { display: flex; justify-content: center; gap: clamp(14px, 4vw, 40px); margin-top: 12px; }
.countdown li { display: grid; justify-items: center; min-width: 64px; }
.countdown b { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .8); }

/* Venue */
.venue-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.venue-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1.75rem, 4vw, 2.75rem); text-align: center; display: grid; justify-items: center; gap: 10px; }
.venue-label { font-size: .8rem; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.venue-card h3 { font-family: var(--script); font-weight: 400; font-size: clamp(2.2rem, 4.6vw, 2.9rem); line-height: 1.25; }
.venue-address { white-space: pre-line; color: var(--muted); margin-bottom: 8px; }

/* Gifts */
.gifts-inner { max-width: 720px; }
.gift-list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gift-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; }
.gift-item + .gift-item { border-top: 1px solid var(--line); }
.gift-name { font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; }
.gift-external { text-align: center; margin-top: 28px; }

/* RSVP */
.rsvp-inner { max-width: 620px; }
.rsvp-form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; gap: 20px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; transition: border-color 160ms ease, box-shadow 200ms ease; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(138, 90, 69, .18); }
.field textarea { resize: vertical; }
.choice { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
.choice legend { grid-column: 1 / -1; margin-bottom: 4px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer; background: var(--bg); transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out); }
.pill span:active { transform: scale(0.97); }
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsvp-form .btn { justify-self: start; }
.form-status { min-height: 1.4em; color: var(--muted); }
.form-status.ok { color: #2F6B3F; }
.form-status.err { color: #A33A3A; }

/* Footer */
.footer { text-align: center; padding: 56px 20px 64px; border-top: 1px solid var(--line); }
.footer-names { font-family: var(--script); font-size: 3rem; line-height: 1.3; }
.footer-date { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.2rem; }

/* ---------- Motion ---------- */
/* Scroll reveals. Content is visible by default; the .js class is added in <head>. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 800ms var(--ease-soft), transform 800ms var(--ease-out); transition-delay: var(--delay, 0ms); }
.js .reveal.from-left { transform: translateX(-44px); }
.js .reveal.from-right { transform: translateX(44px); }
.js .reveal.in { opacity: 1; transform: none; }
.js .gallery-item:nth-child(3n+2) { --delay: 100ms; }
.js .gallery-item:nth-child(3n+3) { --delay: 200ms; }

/* Heading lines draw in */
.section-head h2::after, .story-text h2::after { transition: transform 900ms var(--ease-out) 350ms; }
.js .section-head.reveal h2::after, .js .story-text.reveal h2::after { transform: scaleX(0); }
.js .story-text.reveal h2::after { transform-origin: 0 50%; }
.js .section-head.reveal.in h2::after, .js .story-text.reveal.in h2::after { transform: none; }

/* Hero entrance: staged, names fade up out of a soft blur */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes names-in { from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
.js .hero-inner > * { opacity: 0; animation: rise 900ms var(--ease-out) forwards; }
.js .hero-inner > :nth-child(1) { animation-delay: 150ms; }
.js .hero-inner > :nth-child(2) { animation: names-in 1400ms var(--ease-out) 350ms forwards; }
.js .hero-inner > :nth-child(3) { animation-delay: 900ms; }
.js .hero-inner > :nth-child(4) { animation-delay: 1150ms; }

/* Slow hero zoom (on the image, so it does not fight the parallax on the wrapper) */
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-media img { animation: kenburns 24s ease-out forwards; }

/* Petals drift down; scroll cue nudges */
@keyframes petal { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); } 8% { opacity: .9; } 50% { transform: translate3d(var(--w), 55vh, 0) rotate(200deg); } 92% { opacity: .8; } 100% { opacity: 0; transform: translate3d(calc(var(--w) * -0.4), 112vh, 0) rotate(420deg); } }
.petals i { animation: petal var(--d) linear var(--t) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
.scroll-cue span { animation: cue 1.8s ease-in-out infinite; }
.js .scroll-cue { opacity: 0; animation: rise 800ms var(--ease-out) 1.6s forwards; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #744833; border-color: #744833; }
  .btn:hover::after { left: 130%; transition: left 700ms var(--ease-out); }
  .btn-light:hover { background: var(--soft); border-color: var(--soft); }
  .btn-outline:hover { background: var(--accent); color: var(--accent-ink); }
  .nav a:not(.btn):hover { color: var(--ink); }
  .nav a:not(.btn):hover::after { transform: scaleX(1); }
  .gallery-item:hover img { transform: scale(1.07); }
  .venue-card { transition: opacity 800ms var(--ease-soft), transform 400ms var(--ease-out), box-shadow 400ms ease; }
  .venue-card.in:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(46, 39, 36, .1); }
  .gift-item { transition: background-color 250ms ease; }
  .gift-item:hover { background: var(--bg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.from-left, .js .reveal.from-right { transform: none; transition: opacity 200ms ease; }
  .js .hero-inner > * { opacity: 1; animation: none; }
  .js .section-head.reveal h2::after, .js .story-text.reveal h2::after { transform: none; transition: none; }
  .hero-media img, .petals i, .scroll-cue span, .btn::after { animation: none; }
  .petals, .scroll-cue, .progress { display: none; }
  .hero-media, .band-media, .story-photo img, .hero-inner { transform: none !important; }
  .gallery-item img, .venue-card { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-photo { max-width: 420px; width: 100%; margin-inline: auto; }
  .venue-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav a:not(.btn) { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gift-item { padding: 16px 18px; }
  .countdown li { min-width: 56px; }
  .scroll-cue { bottom: 18px; }
  .js .reveal.from-left, .js .reveal.from-right { transform: translateY(26px); }
}

/* ---------- Version 1.2.0 additions: wedding party, schedule, times, dress code ---------- */
.nav { gap: 20px; }

/* Wedding party */
.party-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 32px 24px; }
.person { display: grid; justify-items: center; text-align: center; gap: 4px; }
.person img { width: min(100%, 164px); aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; border: 5px solid var(--surface); box-shadow: 0 10px 30px rgba(46, 39, 36, .12); margin-bottom: 12px; transition: transform 500ms var(--ease-out), box-shadow 500ms ease; }
.person h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.2; }
.person-role { font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.js .person:nth-child(6n+2) { --delay: 80ms; }
.js .person:nth-child(6n+3) { --delay: 160ms; }
.js .person:nth-child(6n+4) { --delay: 240ms; }
.js .person:nth-child(6n+5) { --delay: 320ms; }
.js .person:nth-child(6n+6) { --delay: 400ms; }

/* Schedule timeline */
.schedule-inner { max-width: 720px; }
.timeline { position: relative; }
.event { position: relative; display: grid; grid-template-columns: 112px 28px 1fr; column-gap: 8px; padding-bottom: 30px; }
.event:last-child { padding-bottom: 0; }
.event::before { content: ''; grid-column: 2; grid-row: 1; align-self: start; justify-self: center; width: 13px; height: 13px; margin-top: .72rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--soft), 0 0 0 6px var(--accent); position: relative; z-index: 1; }
.event::after { content: ''; position: absolute; left: 134px; top: 1.3rem; bottom: -.7rem; width: 1px; background: var(--accent); opacity: .45; }
.event:last-child::after { display: none; }
.event-time { grid-column: 1; grid-row: 1; text-align: right; font-family: var(--serif); font-style: italic; font-size: 1.6rem; line-height: 1.5; color: var(--accent); font-variant-numeric: tabular-nums; }
.event-body { grid-column: 3; grid-row: 1; display: grid; gap: 2px; }
.event h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.3; }
.event p { color: var(--muted); }
.js .event::before { transform: scale(0); transition: transform 500ms var(--ease-out) 250ms; }
.js .event.in::before { transform: none; }
.js .event::after { transform: scaleY(0); transform-origin: 50% 0; transition: transform 900ms var(--ease-out) 500ms; }
.js .event.in::after { transform: none; }

/* Venue times and dress code */
.venue-time { font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.3; color: var(--ink); }
.venue-note { white-space: pre-line; text-align: center; max-width: 620px; margin: 36px auto 0; color: var(--muted); }
.venue-note::before { content: 'Dress code and notes'; display: block; margin-bottom: 6px; font-size: .8rem; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .person:hover img { transform: translateY(-6px) scale(1.04); box-shadow: 0 16px 36px rgba(46, 39, 36, .18); }
}

@media (prefers-reduced-motion: reduce) {
  .js .event::before, .js .event::after { transform: none; transition: none; }
  .person img { transition: none; }
}

@media (max-width: 700px) {
  .party-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  .event { grid-template-columns: 74px 24px 1fr; column-gap: 6px; }
  .event::after { left: 92px; }
  .event-time { font-size: 1.3rem; }
  .event h3 { font-size: 1.35rem; }
}
