/* Base: tokens, type, buttons, the gate, the music pill, reduced motion.
   Scene-specific styles live in scenes.css. */
:root {
  --night: #080C22;
  --cream: #FFF8EC;
  --ivory: #F7F0E4;
  --ink: #23180F;
  --ink-soft: #5E4A3B;
  --gold: #D9B266;
  --gold-2: #F1D79A;
  --gold-deep: #A57C35;
  --silk: #C9452F;
  --silk-2: #DD5E3A;
  --silk-deep: #8E1F24;
  --maroon: #3B0C14;
  --rose: #E2445E;
  --f-display: 'Fraunces', 'Iowan Old Style', 'Times New Roman', serif;
  --f-hand: 'Caveat', 'Segoe Script', cursive;
  --f-ta: 'Kavivanar', 'Noto Sans Tamil', 'Tamil Sangam MN', sans-serif;
  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(20px, 5.4vw, 80px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --soft: 'opsz' 144, 'SOFT' 100;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--night); color: var(--cream); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--f-ui);
  background: var(--night);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 70% at 50% 0%, #1B2654 0%, rgba(14, 21, 54, 0) 62%),
    radial-gradient(90% 60% at 80% 100%, #131C45 0%, rgba(8, 12, 34, 0) 70%),
    var(--night);
}
body.is-locked { overflow: hidden; }
img, svg { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#fx { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
main { position: relative; z-index: 1; }

/* ───────── type ───────── */
.eyebrow { font: 600 11.5px/1.3 var(--f-ui); letter-spacing: .28em; text-transform: uppercase; color: var(--gold-2); }
.ta { font-family: var(--f-ta); }
.hrt { display: inline-block; fill: var(--rose); }
.name-heart, .card-heart, .foot-heart { width: .62em; height: .58em; vertical-align: .06em; margin: 0 .12em; }
.hey-heart { width: .5em; height: .46em; vertical-align: .18em; margin-left: .08em; transform-origin: 50% 60%; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.18); } 28% { transform: scale(1); } 42% { transform: scale(1.12); } }
.cue-line { position: relative; width: 44px; height: 1px; background: rgba(241, 215, 154, .35); overflow: hidden; }
.cue-line::after { content: ''; position: absolute; inset: 0; background: var(--gold-2); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ───────── buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  font: 650 15px/1 var(--f-ui); letter-spacing: .02em; text-decoration: none;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), background-color .28s;
  user-select: none;
}
.btn-gold {
  color: #2B1A08;
  background: linear-gradient(180deg, #F6DFA6 0%, #E1BC6E 55%, #CFA251 100%);
  box-shadow: 0 10px 30px -12px rgba(217, 178, 102, .75), inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -1px 0 rgba(120, 80, 20, .25);
}
.btn-ghost { color: var(--gold-2); background: rgba(255, 248, 236, .04); box-shadow: inset 0 0 0 1px rgba(241, 215, 154, .5); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn-ghost:hover { background: rgba(241, 215, 154, .12); }
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible, .moon-btn:focus-visible, .chip-btn:focus-visible, .cal-menu a:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }

/* ═════════ GATE ═════════ */
#gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; touch-action: none;
  background:
    radial-gradient(90% 55% at 50% 46%, rgba(40, 56, 118, .55) 0%, rgba(14, 21, 54, 0) 70%),
    radial-gradient(140% 90% at 50% 40%, #121A42 0%, #0A0F2B 55%, #05081A 100%);
}
.garland { position: absolute; top: 0; left: 0; width: 100%; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.g-str { animation: sway 5s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.gate-inner {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(10px, 1.8svh, 18px); padding: 13svh var(--gutter) 4svh;
}
.hey { font: 700 clamp(58px, 16vw, 112px)/.9 var(--f-hand); color: var(--cream); text-shadow: 0 0 30px rgba(255, 226, 170, .25); margin-bottom: -.06em; }
.moon-btn {
  position: relative; width: min(58vw, 40svh, 340px); aspect-ratio: 1;
  margin: clamp(6px, 1.6svh, 16px) 0; border: 0; border-radius: 50%; background: none;
}
.moon-svg { position: relative; z-index: 1; width: 100%; height: 100%; transition: transform .6s var(--ease); }
@media (hover: hover) { .moon-btn:hover .moon-svg { transform: scale(1.03); } }
.moon-halo {
  position: absolute; inset: -46%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 238, 196, .46) 0%, rgba(255, 228, 176, .16) 30%, rgba(255, 220, 160, 0) 62%);
  transform: scale(calc(1 + var(--beat, 0) * .14)); animation: halo 5.5s ease-in-out infinite;
}
@keyframes halo { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }
.moon-ping { position: absolute; inset: -6%; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 1px rgba(241, 215, 154, .6); animation: ping 2.8s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.94); opacity: 0; } 25% { opacity: .9; } 100% { transform: scale(1.32); opacity: 0; } }
.gate-names { font: italic 400 clamp(25px, 6.8vw, 42px)/1.12 var(--f-display); font-variation-settings: var(--soft); color: var(--cream); }
.gate-open { margin-top: 4px; }
.gate-hint { display: flex; align-items: center; gap: 8px; font: 500 12.5px/1.3 var(--f-ui); color: rgba(255, 248, 236, .6); }
.gate-hint svg { width: 16px; height: 16px; flex: none; }

/* ═════════ music pill ═════════ */
.chip {
  position: fixed; z-index: 90; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(94vw, 420px);
  padding: 7px 20px 7px 7px; border-radius: 999px; background: rgba(10, 14, 36, .84); color: var(--cream);
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(241, 215, 154, .3);
  animation: chipIn .9s var(--ease) both .6s;
}
@keyframes chipIn { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.chip-btn { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #2B1A08; background: linear-gradient(180deg, #F6DFA6, #CFA251); transition: transform .25s var(--ease); }
.chip-btn:active { transform: scale(.92); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.bars i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: 50% 100%; animation: bar 1.1s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -.3s; } .bars i:nth-child(3) { animation-delay: -.6s; } .bars i:nth-child(4) { animation-delay: -.85s; }
@keyframes bar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.ico-play { display: none; width: 18px; height: 18px; margin-left: 2px; fill: currentColor; }
.chip.paused .bars { display: none; }
.chip.paused .ico-play { display: block; }
.chip-txt { min-width: 0; transition: opacity .26s, transform .26s var(--ease); }
.chip-txt.swap { opacity: 0; transform: translateY(5px); }
.chip-txt.sung .chip-title { font: 400 15px/1.3 var(--f-ta), var(--f-ui); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chip-title { font: italic 400 16px/1.2 var(--f-display); font-variation-settings: 'opsz' 36, 'SOFT' 100; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-sub { margin-top: 2px; font: 600 11px/1.3 var(--f-ui); color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 900px) { .chip { bottom: 22px; } }

/* ═════════ reduced motion: every scene simply sits still ═════════ */
.rm *, .rm *::before, .rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
.rm .hero-photo { clip-path: none; }
.rm .hero-copy { opacity: 1 !important; visibility: visible !important; }
.rm #hero .stage { height: auto; min-height: 100svh; overflow: visible; }
.rm #hero .hero-photo { position: relative; height: 100svh; }
.rm .note { position: relative; opacity: 1; padding: 60px var(--gutter); }
.rm .note-text .w { opacity: 1; }
.rm #moons .stage, .rm #promise .stage, .rm #hands .stage {
  height: auto; min-height: 100svh; padding: 80px var(--gutter);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; overflow: visible;
}
.rm .orb.him, .rm .orb.her, .rm .orb-ring, .rm .orb-label, .rm .moons-intro, .rm .arch-line { display: none; }
.rm .orb.both { position: relative; opacity: 1; width: min(80vw, 520px); aspect-ratio: 1; }
.rm .caption { position: relative; left: auto; right: auto; bottom: auto; }
.rm .caption .ta, .rm .caption .ta .w, .rm .caption .en { opacity: 1; }
.rm .arch-clip { position: relative; inset: auto; width: min(80vw, 460px); aspect-ratio: 2 / 3; border-radius: 999px 999px 8px 8px; }
.rm .arch-clip .color { opacity: 1; }
.rm .album-stage { height: auto; padding: 80px 0; overflow-x: auto; }
.rm .album-track { height: auto; }
.rm .signature text { stroke-dashoffset: 0; fill-opacity: 1; }
