/* ═══════════════════════════════════════════════════════════
   index.css — Harry Potter Wedding Site (shared / global styles)
   Harry Potter theme: dark reds, wood browns, candlelight amber,
   near-blacks. Slightly cartoonish, lighthearted.

   Feature-specific styles live in:
     feat/password/password.css  — gate screen, Fat Lady, door swing
     feat/room/room.css          — common room scene, items, sprite
     feat/pensieve/pensieve.css  — pensieve gallery panel
     feat/clock/clock.css        — Weasley clock panel
     feat/map/map.css            — Marauder's Map panel
     feat/rsvp/rsvp.css          — owl intro, RSVP panel
═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --hp-black:        #0d0a08;
  --hp-near-black:   #151009;
  --hp-dark-red:     #6b1515;
  --hp-red:          #8b2020;
  --hp-gold:         #c9993c;
  --hp-gold-light:   #f7e4a8;
  --hp-amber:        #d4892a;
  --hp-cream:        #f7ede0;
  --hp-parchment:    #e8d5b0;
  --hp-wood:         #4a2a10;
  --hp-wood-light:   #7a4822;
  --hp-wood-mid:     #5a3418;
  --hp-ink:          #f0e4cc;
  --hp-shadow:       rgba(0,0,0,0.5);
  --hp-glow:         rgba(255, 220, 120, 0.25);
  --hp-candle-on:    rgba(255, 200, 80, 0.72);
  --hp-candle-off:   rgba(255, 200, 80, 0);

  font-size: 16px;
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background: var(--hp-black);
  color: var(--hp-ink);
  font-family: "Manrope", sans-serif;
  cursor: none; /* replaced by wand */
  overflow: hidden;
}

/* ── Wand cursor canvas ─────────────────────────────────── */
.wandCanvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ── Reset button ───────────────────────────────────────── */
.resetBtn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(201, 153, 60, 0.36);
  border-radius: 50%;
  background: rgba(13, 10, 8, 0.78);
  backdrop-filter: blur(10px);
  color: var(--hp-gold-light);
  font-size: 1.25rem;
  cursor: none;
  transition: border-color 180ms ease, background 180ms ease, transform 120ms ease;
}

.resetBtn:hover {
  border-color: rgba(201, 153, 60, 0.64);
  background: rgba(30, 20, 10, 0.88);
  transform: scale(1.08);
}

.resetBtn:focus-visible {
  outline: 2px solid var(--hp-gold);
  outline-offset: 3px;
}

/* ── Music toggle ───────────────────────────────────────── */
.musicToggle {
  position: fixed;
  top: 18px;
  left: 70px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(201, 153, 60, 0.36);
  border-radius: 50%;
  background: rgba(13, 10, 8, 0.78);
  backdrop-filter: blur(10px);
  color: var(--hp-gold-light);
  font-size: 1.1rem;
  cursor: none;
  transition: border-color 180ms ease, background 180ms ease, transform 120ms ease;
}

.musicToggle:hover {
  border-color: rgba(201, 153, 60, 0.64);
  background: rgba(30, 20, 10, 0.88);
  transform: scale(1.08);
}

.musicToggle:focus-visible {
  outline: 2px solid var(--hp-gold);
  outline-offset: 3px;
}

.musicIcon { display: block; line-height: 1; }
.musicIconOff { display: none; }

.musicToggle[data-muted] .musicIconOn  { display: none; }
.musicToggle[data-muted] .musicIconOff { display: block; }

/* ── main wrapper ───────────────────────────────────────── */
.experience {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   Feature-specific styles live in feat/*/
   Gate + door swing  → feat/password/password.css
   Room scene + items → feat/room/room.css
   Owl intro + RSVP   → feat/rsvp/rsvp.css
   Pensieve panel     → feat/pensieve/pensieve.css
   Clock panel        → feat/clock/clock.css
   Map panel          → feat/map/map.css
══════════════════════════════════════════════════════════ */

/* ── Owl CSS art (shared: room item button + rsvp owl) ─── */
.owlBody {
  position: relative;
  width: 44px;
  height: 54px;
  border-radius: 50% 50% 48% 48%;
  background: radial-gradient(ellipse at 50% 40%, #c8b070, #7a5820 50%, #4a3410 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.owlBodyLarge { width: 60px; height: 74px; }

.owlHead {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 34px;
  border-radius: 50% 50% 44% 44%;
  background: radial-gradient(ellipse at 50% 40%, #d4bc80, #7a5820 60%, #4a3410 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.owlHeadLarge {
  width: 50px;
  height: 46px;
  top: -34px;
}

.owlEye {
  position: absolute;
  top: 28%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe88a, #e8a800 50%, #6a4200 100%);
  border: 1.5px solid #3a2800;
}
.owlEyeLeft  { left: 16%; }
.owlEyeRight { right: 16%; }

.owlBeak {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid #b07830;
  transform: translateX(-50%);
}

.owlWing {
  position: absolute;
  top: 28%;
  width: 38%;
  height: 54%;
  border-radius: 50% 20% 50% 20%;
  background: linear-gradient(180deg, #a08040, #5a3810);
}
.owlWingLeft  { left: -16%; transform: rotate(-18deg); }
.owlWingRight { right: -16%; transform: rotate(18deg);  }

.owlFeet {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 8px;
  background: #b07830;
  border-radius: 0 0 4px 4px;
}

.owlStandPole {
  width: 6px;
  height: 40px;
  background: linear-gradient(180deg, var(--hp-wood-light), var(--hp-wood));
  border-radius: 2px;
  margin-top: 8px;
}

.owlStandBase {
  width: 36px;
  height: 8px;
  background: var(--hp-wood);
  border-radius: 4px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

/* ══════════════════════════════════════════════════════════
   ENVELOPE (shared for intro + rsvp panel)
══════════════════════════════════════════════════════════ */
.envelopeBody {
  position: relative;
  width: min(480px, 92vw);
  min-height: 320px;
  background:
    radial-gradient(circle at 50% 32%, rgba(255,244,224,0.72), transparent 42%),
    linear-gradient(180deg, rgba(249,235,209,0.98), rgba(214,189,149,0.98));
  border: 1px solid rgba(91,56,26,0.22);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(255,245,229,0.22);
  overflow: hidden;
}

.envelopeFlapTop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(214,189,149,0.98), rgba(232,213,180,0.98));
  border-bottom: 1px solid rgba(91,56,26,0.22);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.envelopeFlapTop.is-open {
  transform: perspective(600px) rotateX(-180deg);
}

.envelopeInner {
  position: relative;
  padding: 0;
  z-index: 1;
}

.envelopeFormWrapper {
  width: 100%;
  min-height: 320px;
}

.rsvpFormEmbed {
  display: block;
  width: 100%;
  min-height: 480px;
  border: none;
}

/* ══════════════════════════════════════════════════════════
   PANELS (overlays for pensieve / clock / map / rsvp)
══════════════════════════════════════════════════════════ */
.overlayLayer {
  position: relative;
  z-index: 50;
}

.panel {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  background: rgba(10, 7, 5, 0.56);
  backdrop-filter: blur(6px);
}

.panel[hidden] { display: none; }

.panelClose {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  pointer-events: auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 153, 60, 0.3);
  border-radius: 50%;
  background: rgba(13, 10, 8, 0.78);
  color: var(--hp-gold-light);
  font-size: 1rem;
  cursor: none;
  backdrop-filter: blur(8px);
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.panelClose:hover {
  border-color: rgba(201, 153, 60, 0.6);
  background: rgba(30, 18, 8, 0.9);
  transform: scale(1.1);
}

.panelClose:focus-visible {
  outline: 2px solid var(--hp-gold);
  outline-offset: 3px;
}

.panelSurface {
  flex: 1;
  min-height: 0;
  pointer-events: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION (shared transitions only — animations are
   in each feat/*/*.css)
══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .envelopeFlapTop {
    transition: none !important;
  }
  .panelClose {
    transition: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE (global layout only — feature breakpoints are
   in each feat/*/*.css)
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .musicToggle {
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
  }
}
