/* =========================================================
   Clara & Julian — styles.css
   Base polish + subtle motion. Works alongside Tailwind CDN.
   ========================================================= */

:root {
  --cream: #F5E6D8;
  --ivory: #FAF4EE;
  --navy: #173A5E;
  --navy-dark: #0F2944;
  --gold: #E5A93B;
  --gold-soft: #FAD089;
  --rust: #A6522B;
  --olive: #7D8423;
  --peri: #7FA7CE;
  --marigold: #F2A855;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.25, 1);
}

html { scroll-padding-top: 5rem; }

body {
  background-color: var(--cream);
  color: var(--navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
}

.font-editorial { font-family: 'Cormorant Garamond', Georgia, serif; }

/* Artwork images: never draggable/selectable */
.botanical {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: #D49B35; border-radius: 4px; }

/* ---------------------------------------------------------
   1. NAVIGATION
   --------------------------------------------------------- */
#navbar { transition: box-shadow .5s var(--ease-out), background-color .5s var(--ease-out); }
#navbar .nav-inner { transition: height .5s var(--ease-out); }
#navbar.is-scrolled { box-shadow: 0 10px 30px -18px rgba(23, 58, 94, .25); }
#navbar.is-scrolled .nav-inner { height: 4rem; }

.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .5s var(--ease-out);
}
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--rust); }

/* Mobile menu slide */
#mobile-menu {
  display: block;
  max-height: 0;
  overflow: hidden;
  padding-top: 0; padding-bottom: 0;
  border-bottom-width: 0;
  transition: max-height .5s var(--ease-out), padding .5s var(--ease-out);
}
#mobile-menu.is-open { max-height: 320px; padding-top: 1.25rem; padding-bottom: 1.25rem; border-bottom-width: 1px; }
@media (min-width: 1024px) { #mobile-menu { display: none; } }

/* ---------------------------------------------------------
   2. HERO ENTRANCE (plays once on load)
   --------------------------------------------------------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes frameIn {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes lineGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes bloomIn {
  from { opacity: 0; transform: scale(.88) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}

.hero-frame   { animation: frameIn 1.4s var(--ease-out) both; }
.hero-in      { animation: riseIn 1.2s var(--ease-out) both; animation-delay: var(--d, 0ms); }
.hero-line    { transform-origin: center; animation: lineGrow 1.3s var(--ease-out) both; animation-delay: var(--d, 0ms); }
.bloom-in     { animation: bloomIn 1.8s var(--ease-out) both; animation-delay: var(--d, 0ms); transform-origin: 30% 30%; }

/* Slow gold shimmer on the hero ampersand */
@keyframes goldShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.amp-shimmer {
  background: linear-gradient(110deg, var(--gold) 0%, var(--gold) 35%, var(--gold-soft) 50%, var(--gold) 65%, var(--gold) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goldShimmer 7s var(--ease-soft) infinite;
}

/* ---------------------------------------------------------
   3. BOTANICAL SWAY
   Outer wrapper handles parallax (translate), inner image sways (rotate).
   --------------------------------------------------------- */
@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(var(--sway, 1.6deg)); }
}
.sway {
  transform-origin: var(--origin, bottom left);
  animation: sway var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--sway-delay, 0s);
}

[data-parallax] {
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

/* ---------------------------------------------------------
   4. DRIFTING PETALS (hero only, created by script.js)
   --------------------------------------------------------- */
.petal-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.petal {
  position: absolute;
  top: -24px;
  width: var(--size, 10px);
  height: calc(var(--size, 10px) * 1.5);
  background: var(--c, var(--marigold));
  border-radius: 0 100% 0 100%;
  opacity: 0;
  animation: petalFall var(--fall, 18s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes petalFall {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  10%  { opacity: var(--alpha, .55); }
  50%  { transform: translate3d(var(--drift, 40px), 50vh, 0) rotate(180deg); }
  90%  { opacity: var(--alpha, .55); }
  100% { opacity: 0; transform: translate3d(calc(var(--drift, 40px) * -0.5), 100vh, 0) rotate(340deg); }
}

/* ---------------------------------------------------------
   5. SCROLL REVEAL
   Only hidden when JS is running (html.js), so content is never lost.
   --------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

.js .reveal-line {
  transform: scaleX(0);
  transition: transform 1.2s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal-line.is-visible { transform: scaleX(1); }
.reveal-line.origin-left { transform-origin: left center; }

/* Photo: soft settle from slight zoom */
.js .reveal-photo img { transform: scale(1.08); transition: transform 2.2s var(--ease-out); }
.js .reveal-photo.is-visible img { transform: scale(1); }
.reveal-photo:hover img { transform: scale(1.025) !important; transition-duration: 1.2s; }

/* Divider: sprig unfurls from centre */
.js .divider-art { opacity: 0; transform: scale(.85); transition: opacity 1.2s var(--ease-out), transform 1.4s var(--ease-out); }
.js .divider-art.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------
   6. CARDS & BUTTONS
   --------------------------------------------------------- */
.lift {
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out), background-color .4s ease;
}
.lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px -26px rgba(23, 58, 94, .35);
}
.lift .emblem { transition: transform .8s var(--ease-out); }
.lift:hover .emblem { transform: rotate(-8deg) scale(1.06); }

.btn-sheen { position: relative; overflow: hidden; }
.btn-sheen::before {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(250, 208, 137, .35), transparent);
  transform: skewX(-20deg);
  transition: left .9s var(--ease-out);
}
.btn-sheen:hover::before { left: 120%; }

.swatch { transition: transform .5s var(--ease-out); }
.swatch:hover { transform: translateY(-3px) scale(1.06); }

/* ---------------------------------------------------------
   7. COUNTDOWN TICK
   --------------------------------------------------------- */
@keyframes tick {
  from { opacity: .35; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}
.cd-num { display: inline-block; }
.cd-num.tick { animation: tick .55s var(--ease-out); }

/* ---------------------------------------------------------
   8. MODAL & TOAST
   --------------------------------------------------------- */
#rsvp-modal { opacity: 0; transition: opacity .45s var(--ease-out); }
#rsvp-modal .modal-panel { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); }
#rsvp-modal.is-open { opacity: 1; }
#rsvp-modal.is-open .modal-panel { opacity: 1; transform: none; }

@keyframes softPop {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.state-in { animation: softPop .7s var(--ease-out) both; }

/* Check mark draws itself on confirmation */
.check-draw path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.state-in .check-draw path { animation: drawCheck .8s .25s var(--ease-out) forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

#toast-banner {
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
  pointer-events: none;
}
#toast-banner.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* Meal section collapse */
.collapsible { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .5s var(--ease-out), opacity .4s ease; }
.collapsible > div { overflow: hidden; }
.collapsible.is-collapsed { grid-template-rows: 0fr; opacity: 0; }

/* Party-size stepper: hide native number spinners */
.stepper-input { -moz-appearance: textfield; appearance: textfield; }
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input.tick { animation: tick .45s var(--ease-out); }
.stepper:focus-within { border-color: var(--navy); }

/* Livestream 'live' dot: soft pulse */
.live-dot {
  position: relative;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--marigold);
}
.live-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--marigold);
  animation: livePulse 2.4s var(--ease-out) infinite;
}
@keyframes livePulse {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(3); opacity: 0; }
}

/* ---------------------------------------------------------
   9. ACCESSIBILITY — respect reduced motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .petal-layer { display: none; }
  [data-parallax] { transform: none !important; }
  .js .reveal, .js .reveal-line, .js .divider-art { opacity: 1; transform: none; }
}
