/* ==========================================================================
   Polish layer — loaded AFTER style.css. Overrides only; safe to delete
   to return to the base design. Kept separate so parallel edits to
   style.css don't collide.
   ========================================================================== */

:root {
  --ease-lux: cubic-bezier(0.22, 1, 0.36, 1);
  --gold-foil: linear-gradient(110deg, #9a7425 0%, #e8c978 22%, #fff3c9 38%, #d4af37 52%, #aa771c 72%, #e8c978 100%);
  --ink: #1c2a1f;
}

::selection { background: rgba(212, 175, 55, 0.35); color: var(--ink); }

body {
  background-image:
    radial-gradient(1200px 600px at 8% 0%, rgba(94, 114, 90, 0.07), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(212, 175, 55, 0.08), transparent 60%);
}

/* Fine film grain over everything for a printed-paper feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Scroll progress hairline ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--gold-foil);
  z-index: 1100;
  pointer-events: none;
}

/* ---------- Navbar: floating glass ---------- */
.navbar {
  background: rgba(250, 248, 243, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
.navbar.scrolled {
  background: rgba(250, 248, 243, 0.86);
  box-shadow: 0 10px 30px -12px rgba(28, 42, 31, 0.18);
}
.nav-links a { letter-spacing: 1.2px; font-size: 0.78rem; text-transform: uppercase; font-weight: 600; }
.nav-links .nav-rsvp-btn {
  background: var(--gold-foil);
  background-size: 200% 100%;
  color: #3a2a06 !important;
  transition: background-position 0.8s var(--ease-lux), transform 0.3s var(--ease-lux), box-shadow 0.3s;
}
.nav-links .nav-rsvp-btn:hover { background-position: 100% 0; }

/* ---------- Hero: cinematic ---------- */
.hero-section {
  background-attachment: scroll; /* fixed breaks on iOS / jitters on mobile */
  isolation: isolate;
}
.hero-overlay {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(250, 248, 243, 0.55) 0%, rgba(250, 248, 243, 0.88) 70%),
    linear-gradient(180deg, rgba(63, 80, 61, 0.25), rgba(250, 248, 243, 0.9) 100%);
}
.hero-container {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(250, 248, 243, 0.72));
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 28px;
  box-shadow:
    0 40px 80px -30px rgba(28, 42, 31, 0.35),
    0 0 0 8px rgba(255, 255, 255, 0.35),
    0 0 0 9px rgba(212, 175, 55, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.couple-names { letter-spacing: -0.5px; }
.name-groom, .name-bride {
  background: linear-gradient(180deg, #3F503D 0%, #1c2a1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.name-ampersand {
  background: var(--gold-foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: foilSweep 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(170, 119, 28, 0.25));
}
@keyframes foilSweep {
  0%, 100% { background-position: 0% 0; }
  50%      { background-position: 100% 0; }
}

.sub-greeting, .section-tag { letter-spacing: 5px; }

.wedding-tag {
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.16), transparent);
  border: none;
  border-top: 1px solid rgba(212, 175, 55, 0.6);
  border-bottom: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 0;
  padding: 7px 34px;
}

.quran-verse {
  background: transparent;
  border: none;
  position: relative;
}
.arabic-quote { font-size: 1.4rem; }

/* Countdown: jewel tiles */
.countdown-container {
  background: transparent;
  border: none;
  box-shadow: none;
  gap: 8px;
  max-width: 520px;
}
.countdown-unit {
  min-width: 78px;
  padding: 14px 6px 10px;
  border-radius: 16px;
  background: linear-gradient(160deg, #4a5e47, #2c3a2a);
  border: 1px solid rgba(232, 201, 120, 0.5);
  box-shadow: 0 14px 28px -14px rgba(28, 42, 31, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.count-number {
  background: var(--gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}
.count-label { color: rgba(250, 248, 243, 0.78) !important; letter-spacing: 2.5px; }
.countdown-colon { color: var(--gold-medium); opacity: 0.7; }

/* ---------- Buttons ---------- */
.btn { transition: transform 0.35s var(--ease-lux), box-shadow 0.35s var(--ease-lux), background-position 0.8s var(--ease-lux); letter-spacing: 1.2px; }
.btn-gold {
  background: var(--gold-foil);
  background-size: 220% 100%;
  color: #3a2a06;
  border: 1px solid rgba(154, 116, 37, 0.5);
  box-shadow: 0 12px 28px -10px rgba(170, 119, 28, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-gold:hover { background-position: 100% 0; transform: translateY(-3px); box-shadow: 0 18px 36px -12px rgba(170, 119, 28, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible, .form-input:focus-visible, .form-select:focus-visible, .form-textarea:focus-visible,
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 3px;
}

/* ---------- Section rhythm ---------- */
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.gold-ornament .line { background: linear-gradient(90deg, transparent, var(--gold-medium), transparent); }
.gold-ornament .star { color: var(--gold-primary); filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.6)); }

/* ---------- Cards ---------- */
.event-card, .guide-card, .masjid-real-card, .map-card-frame, .flyer-card-frame {
  transition: transform 0.6s var(--ease-lux), box-shadow 0.6s var(--ease-lux), border-color 0.4s;
}
.event-card {
  border-radius: 22px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 24px 50px -28px rgba(28, 42, 31, 0.35);
  overflow: hidden;
}
.event-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 40px 70px -30px rgba(28, 42, 31, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.25);
}
.event-img { transition: transform 1.4s var(--ease-lux); }
.event-card:hover .event-img { transform: scale(1.06); }
.event-image-wrap { overflow: hidden; }

.guide-card {
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  position: relative;
}
.guide-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(232, 201, 120, 0.9), transparent 40%, transparent 60%, rgba(232, 201, 120, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.guide-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(28, 42, 31, 0.4); }
.guide-card:hover::before { opacity: 1; }
.guide-icon { transition: transform 0.6s var(--ease-lux); }
.guide-card:hover .guide-icon { transform: scale(1.15) rotate(-6deg); }

.flyer-card-frame { box-shadow: 0 50px 90px -40px rgba(28, 42, 31, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.35); }

/* ---------- Timeline: glowing active step ---------- */
.timeline-step.active .step-time {
  background: var(--gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- RSVP form ---------- */
.rsvp-card-border {
  background: var(--gold-foil);
  background-size: 300% 300%;
  animation: foilSweep 10s ease-in-out infinite;
  box-shadow: 0 50px 100px -40px rgba(28, 42, 31, 0.5);
}
.form-input, .form-select, .form-textarea {
  border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s, transform 0.3s var(--ease-lux);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18), 0 10px 24px -14px rgba(170, 119, 28, 0.5);
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.footer-names {
  background: var(--gold-foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: foilSweep 8s ease-in-out infinite;
}

/* ---------- Scroll reveal (JS adds .js-reveal then .in) ---------- */
.js-reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(4px);
  transition: opacity 1s var(--ease-lux), transform 1s var(--ease-lux), filter 1s var(--ease-lux);
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- Floating gold dust (hero) ---------- */
.gold-dust {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.gold-dust i {
  position: absolute;
  bottom: -12px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c9 0%, #d4af37 55%, transparent 70%);
  opacity: 0;
  animation: dustRise var(--d) linear var(--delay) infinite;
}
@keyframes dustRise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  12%  { opacity: 0.85; }
  100% { transform: translate3d(var(--x), -105vh, 0); opacity: 0; }
}

@media (max-width: 768px) {
  .hero-container { box-shadow: 0 30px 60px -28px rgba(28, 42, 31, 0.4), 0 0 0 5px rgba(255, 255, 255, 0.35), 0 0 0 6px rgba(212, 175, 55, 0.35); }
  .countdown-unit { min-width: 62px; }
  .nav-links a { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .gold-dust { display: none; }
  .name-ampersand, .rsvp-card-border, .footer-names { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Opened-envelope view (revealed card)
   ========================================================================== */

/* Frame matches the flyer's 731x1024 proportions: no letterbox strip */
.envelope-wrapper.is-revealed .envelope {
  height: min(64vh, 600px);
  width: min(88vw, calc(min(64vh, 600px) * 0.7139)); /* flyer is 731x1024; explicit so width can transition */
}
.envelope-wrapper.is-revealed .envelope-flyer-img { object-fit: cover; object-position: center; background: transparent; }
.envelope-wrapper.is-revealed .envelope-card {
  border: none;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(184, 139, 74, 0.6),
    0 0 0 7px rgba(250, 248, 243, 0.9),
    0 0 0 8px rgba(184, 139, 74, 0.5),
    0 40px 80px -24px rgba(22, 34, 26, 0.55);
}
@media (max-width: 480px) {
  .envelope-wrapper.is-revealed .envelope { height: min(58vh, 480px); width: min(88vw, calc(min(58vh, 480px) * 0.7139)); }
}

/* Countdown: emerald capsule, foil numerals */
.revealed-countdown-pill {
  background: linear-gradient(160deg, #2b3d2f, #16221a);
  border: 1px solid rgba(229, 200, 136, 0.65);
  color: rgba(244, 240, 232, 0.8);
  border-radius: 999px;
  padding: 10px 22px;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 0.7rem;
  box-shadow: 0 18px 34px -16px rgba(22, 34, 26, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.revealed-countdown-pill strong {
  background: var(--gold-foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.15rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.countdown-pill-icon { display: none; }

/* Action row: one hero CTA, three quiet secondary actions */
.revealed-card-actions { max-width: 460px; }
.revealed-buttons-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.revealed-buttons-row #revealedRsvpBtn {
  grid-column: 1 / -1;
  padding: 14px 24px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
}
.revealed-buttons-row .btn-ghost-gold,
.revealed-buttons-row .btn-outline-sage,
.revealed-buttons-row .btn-refold-envelope {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  white-space: nowrap;
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(184, 139, 74, 0.55);
  border-radius: 999px;
  box-shadow: none;
}
.revealed-buttons-row .btn-ghost-gold:hover,
.revealed-buttons-row .btn-outline-sage:hover,
.revealed-buttons-row .btn-refold-envelope:hover {
  background: #fff;
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}
.revealed-buttons-row svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 380px) {
  .revealed-buttons-row .btn-ghost-gold, .revealed-buttons-row .btn-outline-sage, .revealed-buttons-row .btn-refold-envelope { font-size: 0.68rem; gap: 5px; }
  .revealed-buttons-row svg { display: none; }
}

/* Sound pill: quieter, matches the foil language */
.envelope-audio-pill {
  background: rgba(250, 248, 243, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(184, 139, 74, 0.55);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.68rem;
}

/* Align controls to the card's width; let the vinyl peek out fully */
.revealed-card-actions { max-width: min(88vw, 430px); }
@media (min-width: 601px) {
  .envelope-wrapper.is-revealed .vinyl-record-widget { right: -96px; }
  .envelope-wrapper.is-revealed .vinyl-record-widget.is-playing { right: -104px; }
  .vinyl-pill-badge { right: -8px; bottom: -14px; }
}
