/* ==========================================================================
   SARAHI'S 16TH BIRTHDAY - THEME: DISNEY'S BRAVE (VALIENTE) / DUNBROCH
   Celtic Medieval Highland Fantasy Stylesheet - Light Theme Edition
   ========================================================================== */

/* Root Variables & Theme Tokens - Elegant Light Parchment Palette */
:root {
  --color-parchment-base: #FAF7F2;
  --color-parchment-cream: #F5EFEB;
  --color-parchment-pure: #FFFDF9;
  --color-charcoal-main: #1C2826;
  --color-charcoal-soft: #232E2A;
  --color-slate-celtic: #2D3748;
  --color-slate-muted: #4A5568;
  --color-gold-celtic: #C5A059;
  --color-gold-royal: #B38F39;
  --color-gold-deep: #8C6D23;
  --color-gold-light: #E5D4AF;
  --color-forest-green: #135713;
  --color-forest-deep: #0D3B1E;
  --color-forest-glow: #1f7a1f;
  --color-wisp-blue: #0284c7;
  --color-wisp-glow: #38bdf8;
  --color-wisp-core: #e0f2fe;
  --color-card-bg: rgba(255, 255, 255, 0.92);
  --color-card-border: rgba(197, 160, 89, 0.45);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: var(--color-parchment-cream);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-gold-celtic) 0%, var(--color-gold-royal) 50%, var(--color-gold-deep) 100%);
  border-radius: 6px;
  border: 2px solid var(--color-parchment-base);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-deep);
}

/* Base and Typography */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-parchment-base);
  color: var(--color-charcoal-main);
  overflow-x: hidden;
  font-family: 'Montserrat', sans-serif;
  padding-bottom: 0;
}

/* ==========================================================================
   GLOBAL KEYBOARD FOCUS RING (WCAG 2.4.7 / 2.4.11)
   Defined exactly once, here, for every interactive control. Component
   styles must NOT suppress it (no `outline: none` on :focus-visible).
   Two-tone so the ring reads on either surface:
   - inner 2px light band (#FFFDF9) -> visible over the dark modal overlay
   - outer 2px forest outline (#135713 = 8.19:1 on parchment) -> visible
     over the light parchment surfaces
   ========================================================================== */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #135713;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #FFFDF9;
}

/* Selection */
::selection {
  background: rgba(197, 160, 89, 0.35);
  color: var(--color-charcoal-main);
}

/* Celtic Typography Classes */
.font-celtic-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
}

.font-celtic-royal {
  font-family: 'Cinzel', serif;
}

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

/* Celtic Gold Text Shimmer for Light Theme
   Gradient stops must clear WCAG 1.4.3 against the #FAF7F2 parchment (large text >= 3:1):
   #6E5316 = 6.75:1, #8C6D23 = 4.54:1, #7A5E1C = 5.70:1, #6E5316 = 6.75:1 */
.text-shimmer-gold {
  background: linear-gradient(135deg, #6E5316 0%, var(--color-gold-deep) 45%, #7A5E1C 70%, #6E5316 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: celtic-shimmer 6s linear infinite;
}

.text-shimmer-flame {
  background: linear-gradient(135deg, var(--color-forest-green) 0%, var(--color-gold-deep) 45%, var(--color-gold-celtic) 80%, var(--color-forest-green) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: celtic-shimmer 5s ease-in-out infinite;
}

.text-shimmer-wisp {
  background: linear-gradient(135deg, #0369a1 0%, var(--color-wisp-blue) 45%, var(--color-wisp-glow) 75%, #0369a1 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: celtic-shimmer 4s ease-in-out infinite;
}

/* Glow Shadows */
.glow-gold {
  filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.45));
}

.glow-flame {
  filter: drop-shadow(0 0 12px rgba(19, 87, 19, 0.35));
}

.glow-wisp {
  filter: drop-shadow(0 0 10px rgba(2, 132, 199, 0.4));
}

.box-glow-gold {
  box-shadow: 0 0 25px rgba(197, 160, 89, 0.2), inset 0 0 12px rgba(197, 160, 89, 0.08);
}

.box-glow-flame {
  box-shadow: 0 0 25px rgba(19, 87, 19, 0.18), inset 0 0 12px rgba(19, 87, 19, 0.08);
}

.box-glow-wisp {
  box-shadow: 0 0 22px rgba(2, 132, 199, 0.2), inset 0 0 12px rgba(2, 132, 199, 0.08);
}

/* Dunbroch Tartan & Plaid Light Parchment Background Pattern */
.bg-celtic-tartan {
  background-color: var(--color-parchment-base);
  background-image: 
    repeating-linear-gradient(0deg, rgba(197, 160, 89, 0.06) 0px, rgba(197, 160, 89, 0.06) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(197, 160, 89, 0.06) 0px, rgba(197, 160, 89, 0.06) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(0deg, rgba(19, 87, 19, 0.04) 0px, rgba(19, 87, 19, 0.04) 2px, transparent 2px, transparent 80px),
    repeating-linear-gradient(90deg, rgba(19, 87, 19, 0.04) 0px, rgba(19, 87, 19, 0.04) 2px, transparent 2px, transparent 80px);
}

/* Celtic Borders & Cards */
.celtic-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-card-border);
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px -4px rgba(28, 40, 38, 0.06), 0 2px 8px rgba(197, 160, 89, 0.08);
}

.celtic-card:hover {
  border-color: var(--color-gold-royal);
  box-shadow: 0 14px 38px -6px rgba(28, 40, 38, 0.1), 0 0 15px rgba(197, 160, 89, 0.15);
}

/* Corner Knots for Cards */
.celtic-corners::before,
.celtic-corners::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  border-color: var(--color-gold-celtic);
  z-index: 5;
}

.celtic-corners::before {
  top: 5px;
  left: 5px;
  border-top: 2px solid var(--color-gold-celtic);
  border-left: 2px solid var(--color-gold-celtic);
  border-top-left-radius: 11px;
}

.celtic-corners::after {
  bottom: 5px;
  right: 5px;
  border-bottom: 2px solid var(--color-gold-celtic);
  border-right: 2px solid var(--color-gold-celtic);
  border-bottom-right-radius: 11px;
}

.celtic-corners-full {
  position: relative;
}

.corner-knot {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 6;
  opacity: 0.85;
}

.corner-knot.top-left {
  top: -2px;
  left: -2px;
}

.corner-knot.top-right {
  top: -2px;
  right: -2px;
  transform: rotate(90deg);
}

.corner-knot.bottom-right {
  bottom: -2px;
  right: -2px;
  transform: rotate(180deg);
}

.corner-knot.bottom-left {
  bottom: -2px;
  left: -2px;
  transform: rotate(270deg);
}

/* Hero Frame with Celtic Arch */
.hero-portrait-frame {
  position: relative;
  padding: 8px;
  background: radial-gradient(circle at center, rgba(229, 212, 175, 0.5) 0%, rgba(245, 239, 235, 0.85) 70%, var(--color-parchment-base) 100%);
  border-radius: 1.5rem 1.5rem 1rem 1rem;
  border: 2px solid var(--color-gold-celtic);
  box-shadow: 0 15px 35px -5px rgba(28, 40, 38, 0.12), 0 0 25px rgba(197, 160, 89, 0.2);
}

.hero-portrait-frame::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 1.8rem 1.8rem 1.3rem 1.3rem;
  border: 1px dashed rgba(197, 160, 89, 0.55);
  pointer-events: none;
}

/* Button Celtic Styling
   White label text must clear WCAG 1.4.3 (4.5:1) on every gradient stop:
   #8C6D23 = 4.85:1, #7A5E1C = 6.10:1, #6E5316 = 7.21:1 */
.btn-celtic-primary {
  background: linear-gradient(135deg, var(--color-gold-deep) 0%, #7A5E1C 50%, #6E5316 100%);
  color: #ffffff;
  border: 1px solid var(--color-gold-light);
  box-shadow: 0 4px 18px rgba(179, 143, 57, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-celtic-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(179, 143, 57, 0.45), 0 0 12px rgba(197, 160, 89, 0.3);
}

.btn-celtic-primary:active {
  transform: translateY(1px);
}

.btn-celtic-secondary {
  background: var(--color-parchment-pure);
  color: var(--color-forest-green);
  border: 1.5px solid var(--color-gold-celtic);
  box-shadow: 0 4px 14px rgba(28, 40, 38, 0.06), inset 0 0 10px rgba(197, 160, 89, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-celtic-secondary:hover {
  background: var(--color-forest-green);
  color: var(--color-parchment-pure);
  border-color: var(--color-forest-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(19, 87, 19, 0.25), 0 0 15px rgba(197, 160, 89, 0.2);
}

.btn-celtic-wisp {
  background: rgba(2, 132, 199, 0.08);
  color: #0369a1;
  border: 1.5px solid rgba(2, 132, 199, 0.4);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-celtic-wisp:hover {
  background: rgba(2, 132, 199, 0.16);
  border-color: var(--color-wisp-blue);
  color: var(--color-wisp-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.25);
}

/* Sound Wave Animation for Audio Button */
.sound-bar {
  width: 3px;
  height: 14px;
  background-color: var(--color-gold-deep);
  border-radius: 2px;
  animation: soundwave 1.2s ease-in-out infinite;
}

.sound-bar:nth-child(1) { animation-delay: 0.1s; height: 10px; }
.sound-bar:nth-child(2) { animation-delay: 0.3s; height: 16px; }
.sound-bar:nth-child(3) { animation-delay: 0.2s; height: 12px; }
.sound-bar:nth-child(4) { animation-delay: 0.4s; height: 8px; }

.sound-bar.paused {
  animation-play-state: paused;
  height: 4px !important;
  opacity: 0.4;
}

/* Countdown: minimal style — no boxes; grid `divide-x` in the markup draws
   the thin vertical gold separators between the units. */

/* Interactive Archery Scroll Trail */
.archery-track {
  position: relative;
}

.archery-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: repeating-linear-gradient(to bottom, 
    var(--color-gold-celtic) 0, 
    var(--color-gold-celtic) 6px, 
    transparent 6px, 
    transparent 12px
  );
  transform: translateX(-50%);
  opacity: 0.55;
  z-index: 1;
}

.archery-arrow-follower {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: top 0.1s ease-out;
  z-index: 10;
  pointer-events: none;
}

#archery-timeline-track > ol > li {
  z-index: 2;
}

/* Will-o'-the-wisps Canvas */
#wisps-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
}

/* Timeline specific styles */
.timeline-dot {
  position: relative;
  z-index: 4;
  transition: all 0.3s ease;
}

/* Color Swatches for Dress Code */
.swatch-reserved {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--color-gold-celtic);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.22);
}

.swatch-reserved::after {
  content: "RESERVADO";
  position: absolute;
  top: 27px;
  right: 19px;
  width: 110px;
  text-align: center;
  line-height: 1;
  padding: 5px 0;
  font-size: 0.6rem;
  background: var(--color-gold-deep);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: rotate(-45deg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-family: 'Montserrat', sans-serif;
}

.swatch-reserved-forest::after {
  background: var(--color-forest-green);
}

/* Gallery artwork trigger (component class).
   Extracted from the three identical class strings that sat on each gallery
   <button>:
     relative block w-full text-left rounded-2xl overflow-hidden border
     border-gold-celtic/40 bg-parchment-pure shadow-lg
     hover:shadow-[0_10px_25px_rgba(197,160,89,0.25)] transition-all
     duration-300 cursor-pointer
   Every declaration below mirrors those utilities 1:1, except the two empty
   `0 0 #0000` slots Tailwind adds for ring support, which render nothing.
   No rule in tailwind.css targets these buttons any more, so loading order
   (style.css before tailwind.css) cannot flip any of these values. */
.artwork-trigger {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 1rem;
  background-color: var(--color-parchment-pure);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 0.3s;
  cursor: pointer;
}

.artwork-trigger:hover {
  box-shadow: 0 10px 25px rgba(197, 160, 89, 0.25);
}

/* Form Styles */
.celtic-input {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(197, 160, 89, 0.45);
  color: var(--color-charcoal-main);
  transition: all 0.25s ease;
}

/* Focus feedback comes from the global :focus-visible ring above; this rule
   only adds the field-level accent (border + background), and must never
   re-declare outline/box-shadow or it would override that ring. */
.celtic-input:focus {
  border-color: var(--color-gold-deep);
  background: #ffffff;
}

.celtic-input::placeholder {
  color: rgba(45, 55, 72, 0.45);
}

/* Layout shell shared by every RSVP field (inputs, selects, textarea).
   Extracted from the markup (w-full px-4 py-3 rounded-xl text-sm) so the four
   fields carry one component class instead of four repeated utilities. The
   textarea keeps `py-2.5` in the markup: Tailwind utilities load after this
   file, so that longhand still wins over the py-3 shorthand declared here. */
.celtic-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Toast Notification */
#celtic-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-parchment-pure);
  border: 1.5px solid var(--color-gold-celtic);
  color: var(--color-charcoal-main);
  padding: 0.85rem 1.6rem;
  border-radius: 9999px;
  box-shadow: 0 12px 35px rgba(28, 40, 38, 0.15), 0 0 20px rgba(197, 160, 89, 0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

#celtic-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Keyframes */
@keyframes celtic-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes flame-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(19, 87, 19, 0.3));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(19, 87, 19, 0.6));
    transform: scale(1.02);
  }
}

@keyframes wisp-drift {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-8px) translateX(4px);
    opacity: 1;
  }
}

@keyframes arrow-flight {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@keyframes soundwave {
  0%, 100% {
    transform: scaleY(0.4);
  }
  50% {
    transform: scaleY(1);
  }
}


/* Reveal Animations on Scroll
   Scoped to .js (set by an inline head script) so content is never stuck at
   opacity:0 when JavaScript fails to load or execute. */
.js .reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.js .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Artwork Lightbox Modal */
#artwork-modal.flex {
  display: flex !important;
}
#artwork-modal.hidden {
  display: none !important;
}

/* Modal title contrast (scoped to the dialog only).
   The page-wide .text-shimmer-gold gradient is tuned for #FAF7F2 parchment
   (>= 4.54:1) and must NOT be changed. The modal title sits on the lore box
   background #F5EFEB, where the lightest stop #8C6D23 only reaches 4.26:1.
   Darkened stops used here, all against #F5EFEB (sRGB relative luminance,
   (L1+0.05)/(L2+0.05)):
     #7A5E1C = 5.35:1  (lightest stop, the WCAG bottleneck)
     #74591A = 5.78:1
     #6E5316 = 6.33:1
   Minimum = 5.35:1 >= 4.5:1 (WCAG 1.4.3, normal text). */
#modal-artwork-title.text-shimmer-gold {
  background-image: linear-gradient(135deg, #6E5316 0%, #7A5E1C 45%, #74591A 70%, #6E5316 100%);
}
