/* =============================================
   kaguya.quest — Styles
   Palette: creamy-pastel aurora, Heian maximalist
   ============================================= */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=DM+Sans:wght@300;400;500&display=swap');

/* --- CSS Variables / Palette --- */
:root {
  --pearl-cream: #FAF3E8;
  --lotus-blush: #F2E2F0;
  --ice-aurora: #D4EEF7;
  --blush-gold: #C9A96E;
  --aurora-teal: #7ECDC4;
  --heian-violet: #B89BC8;
  --sakura-pink: #F7C5D8;
  --deep-ink: #2A1F3D;
  --soft-charcoal: #4A3F5C;
  --sidebar-width: 48px;
}

/* Sakura pink accent — used in petal glow, hover overlays */
/* #F7C5D8 — Sakura Pink (petal blush, used in micro-motif overlays) */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--deep-ink);
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--soft-charcoal);
}

/* ============================================
   SIDEBAR RIBBON
   ============================================ */
.sidebar-ribbon {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(250, 243, 232, 0.85);
  border-right: 1px solid rgba(201, 169, 110, 0.3);
  backdrop-filter: blur(8px);
}

.sidebar-icon {
  color: var(--blush-gold);
  opacity: 0.6;
  transition: opacity 300ms ease, filter 300ms ease;
  cursor: default;
}

.sidebar-icon:hover {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.6));
}

/* ============================================
   PANEL NAVIGATION
   ============================================ */
.panel-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--blush-gold);
  background: transparent;
  cursor: pointer;
  transition: background 300ms ease, transform 300ms ease, box-shadow 300ms ease;
  padding: 0;
}

.nav-dot.active {
  background: var(--blush-gold);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(201, 169, 110, 0.7);
}

.nav-dot:hover {
  background: rgba(201, 169, 110, 0.5);
}

.nav-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blush-gold);
  margin-left: 6px;
  opacity: 0.8;
  min-width: 140px;
}

/* ============================================
   EMAKI SCROLL CONTAINER
   ============================================ */
.emaki-scroll {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-left: var(--sidebar-width);
  scrollbar-width: thin;
  scrollbar-color: var(--blush-gold) var(--pearl-cream);
}

.emaki-scroll::-webkit-scrollbar {
  height: 4px;
}

.emaki-scroll::-webkit-scrollbar-track {
  background: var(--pearl-cream);
}

.emaki-scroll::-webkit-scrollbar-thumb {
  background: var(--blush-gold);
  border-radius: 2px;
}

/* ============================================
   PANELS — BASE
   ============================================ */
.panel {
  flex: 0 0 calc(100vw - var(--sidebar-width));
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

/* Aurora SVG overlay — fullscreen, pointer-events none */
.aurora-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Panel gold frame inset */
.panel-frame {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  pointer-events: none;
  z-index: 10;
  border-radius: 1px;
}

.panel-frame-gold {
  border-color: rgba(201, 169, 110, 0.7);
  box-shadow: inset 0 0 40px rgba(201, 169, 110, 0.1);
}

/* Chrysanthemum vine borders (top & bottom) */
.kiku-border {
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  pointer-events: none;
  z-index: 11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24'%3E%3Cpath d='M0 12 Q10 6 20 12 Q30 18 40 12 Q50 6 60 12 Q70 18 80 12 Q90 6 100 12 Q110 18 120 12' stroke='%23C9A96E' stroke-width='1' fill='none' opacity='0.25'/%3E%3Ccircle cx='20' cy='12' r='3' fill='none' stroke='%23C9A96E' stroke-width='0.75' opacity='0.25'/%3E%3Ccircle cx='60' cy='12' r='3' fill='none' stroke='%23C9A96E' stroke-width='0.75' opacity='0.25'/%3E%3Ccircle cx='100' cy='12' r='3' fill='none' stroke='%23C9A96E' stroke-width='0.75' opacity='0.25'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  opacity: 1;
}

.kiku-border-top {
  top: 0;
}

.kiku-border-bottom {
  bottom: 0;
  transform: scaleY(-1);
}

/* ============================================
   PANEL COLORS / BACKGROUNDS
   ============================================ */
.panel-1 {
  background:
    radial-gradient(ellipse 60% 50% at 70% 30%, rgba(126, 205, 196, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(184, 155, 200, 0.1) 0%, transparent 60%),
    var(--pearl-cream);
}

.panel-2 {
  background:
    radial-gradient(ellipse 55% 45% at 30% 40%, rgba(184, 155, 200, 0.15) 0%, transparent 65%),
    radial-gradient(ellipse 40% 35% at 70% 65%, rgba(126, 205, 196, 0.1) 0%, transparent 55%),
    var(--lotus-blush);
}

.panel-3 {
  background:
    radial-gradient(ellipse 50% 40% at 50% 25%, rgba(126, 205, 196, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 45% 35% at 40% 70%, rgba(212, 238, 247, 0.2) 0%, transparent 55%),
    var(--ice-aurora);
}

.panel-4 {
  background:
    radial-gradient(ellipse 50% 45% at 50% 50%, rgba(126, 205, 196, 0.2) 0%, rgba(184, 155, 200, 0.15) 40%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 25% 20%, rgba(126, 205, 196, 0.15) 0%, transparent 60%),
    var(--deep-ink);
}

.panel-5 {
  background:
    radial-gradient(ellipse 55% 45% at 65% 30%, rgba(201, 169, 110, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 70% 65%, rgba(126, 205, 196, 0.07) 0%, transparent 55%),
    var(--pearl-cream);
}

.panel-6 {
  background:
    linear-gradient(135deg,
      var(--pearl-cream) 0%,
      #F7C5D8 20%,
      var(--lotus-blush) 35%,
      rgba(126, 205, 196, 0.3) 55%,
      var(--ice-aurora) 80%,
      rgba(184, 155, 200, 0.4) 100%
    );
}

/* ============================================
   PANEL CONTENT LAYOUT
   ============================================ */
.panel-content {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
}

.panel-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aurora-teal);
  margin-bottom: 16px;
}

.panel-label.light {
  color: rgba(201, 169, 110, 0.7);
}

/* ============================================
   PANEL 1 — HERO
   ============================================ */
.panel-1-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 8% 60px calc(48px + 5%);
  width: 55%;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(72px, 8vw, 120px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--deep-ink);
  margin-bottom: 24px;
}

.letter-fade {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: letter-appear 600ms forwards;
}

@keyframes letter-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.letter-dot {
  color: var(--blush-gold);
}

.hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aurora-teal);
  opacity: 0;
  animation: fade-in 800ms 1000ms forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* Moon disc */
.moon-disc {
  position: absolute;
  top: 8%;
  right: 5%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pearl-cream) 0%, rgba(250, 243, 232, 0) 70%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
  animation: moon-float 20s ease-in-out infinite;
}

@keyframes moon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Icon constellation right half */
.icon-constellation {
  position: absolute;
  right: 0;
  top: 0;
  width: 45%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

.icon-orbit {
  position: absolute;
}

.icon-orbit-1 { top: 12%; left: 20%; }
.icon-orbit-2 { top: 30%; left: 55%; }
.icon-orbit-3 { top: 10%; left: 60%; }
.icon-orbit-4 { top: 55%; left: 35%; }
.icon-orbit-5 { top: 72%; left: 65%; }
.icon-orbit-6 { top: 42%; left: 78%; }
.icon-orbit-7 { top: 62%; left: 15%; }

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.kamon-icon {
  animation: icon-breathe 8s ease-in-out infinite;
  display: block;
}

@keyframes icon-breathe {
  0%, 100% { transform: scale(1.0); }
  50% { transform: scale(1.04); }
}

.kamon-icon:hover {
  filter: drop-shadow(0 0 8px rgba(201, 169, 110, 0.8));
}

/* Scattered petals layer */
.petals-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* ============================================
   PANEL 2 — LUNAR COURT
   ============================================ */
.panel-2-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  padding: 60px 5% 60px calc(48px + 4%);
  gap: 4%;
}

.pull-quote-side {
  width: 50%;
  flex-shrink: 0;
}

.pull-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--deep-ink);
  border-left: 2px solid var(--blush-gold);
  padding-left: 28px;
  margin: 0 0 20px 0;
  quotes: none;
}

.quote-attribution {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blush-gold);
  padding-left: 30px;
}

.icon-grid-side {
  flex: 1;
  position: relative;
}

.celestial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 20px;
  align-items: center;
  justify-items: center;
  height: 380px;
}

.grid-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============================================
   PANEL 3 — SILK CHAMBER
   ============================================ */
.panel-3-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  height: 100%;
  padding: 60px 6% 60px calc(48px + 5%);
  position: relative;
}

.panel-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--deep-ink);
  margin-bottom: 48px;
}

.badge-cluster {
  display: flex;
  align-items: center;
  gap: 28px;
  position: absolute;
}

.badge-cluster-1 {
  top: 20%;
  left: calc(48px + 5%);
}

.badge-cluster-2 {
  top: 48%;
  left: 30%;
}

.badge-cluster-3 {
  top: 68%;
  left: calc(48px + 8%);
}

.icon-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(250, 243, 232, 0.8);
  border: 1px solid rgba(201, 169, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 20px rgba(201, 169, 110, 0.1);
}

.badge-text {
  max-width: 260px;
}

.badge-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blush-gold);
  margin-bottom: 6px;
}

.badge-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--soft-charcoal);
}

.triangle-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ============================================
   PANEL 4 — TREASURE ROOM (DARK)
   ============================================ */
.panel-4-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  padding: 60px 5% 60px calc(48px + 5%);
  gap: 5%;
}

.treasure-text {
  width: 50%;
  flex-shrink: 0;
}

.treasure-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--pearl-cream);
  margin-bottom: 32px;
}

.treasure-body {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(250, 243, 232, 0.75);
  margin-bottom: 16px;
}

.treasure-icons {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.treasure-kamon {
  animation: icon-breathe 8s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(201, 169, 110, 0.5));
}

.treasure-kamon:nth-child(odd) {
  animation-delay: -3s;
}

.treasure-kamon:nth-child(3n) {
  animation-delay: -6s;
}

/* ============================================
   PANEL 5 — GARDEN OF SUITORS
   ============================================ */
.panel-5-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  padding: 60px 3% 60px calc(48px + 4%);
  gap: 3%;
}

.suitors-text {
  width: 55%;
  flex-shrink: 0;
}

.panel-heading-sm {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--deep-ink);
  margin-bottom: 32px;
}

.two-col-text {
  display: flex;
  gap: 16px;
}

.text-col {
  flex: 1;
}

.text-col p {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--soft-charcoal);
  text-align: left;
}

/* Icon mosaic */
.icon-mosaic {
  flex: 1;
  position: relative;
  height: 80vh;
  min-width: 0;
}

.mosaic-icon {
  position: absolute;
}

.m-1  { top: 5%;  left: 10%; }
.m-2  { top: 8%;  left: 35%; }
.m-3  { top: 3%;  left: 62%; }
.m-4  { top: 18%; left: 22%; }
.m-5  { top: 15%; left: 55%; }
.m-6  { top: 25%; left: 80%; }
.m-7  { top: 35%; left: 5%;  }
.m-8  { top: 32%; left: 40%; }
.m-9  { top: 28%; left: 70%; }
.m-10 { top: 48%; left: 18%; }
.m-11 { top: 45%; left: 55%; }
.m-12 { top: 42%; left: 82%; }
.m-13 { top: 62%; left: 8%;  }
.m-14 { top: 60%; left: 38%; }
.m-15 { top: 58%; left: 68%; }
.m-16 { top: 75%; left: 20%; }
.m-17 { top: 72%; left: 52%; }
.m-18 { top: 70%; left: 78%; }

.mosaic-icon .kamon-icon {
  animation: icon-breathe 8s ease-in-out infinite;
}

.mosaic-icon:nth-child(even) .kamon-icon { animation-delay: -4s; }
.mosaic-icon:nth-child(3n) .kamon-icon   { animation-delay: -2s; }
.mosaic-icon:nth-child(5n) .kamon-icon   { animation-delay: -6s; }

/* ============================================
   PANEL 6 — CELESTIAL ASCENT
   ============================================ */
.panel-6-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 60px 5%;
  text-align: center;
}

.ascent-text {
  margin-bottom: 60px;
}

.ascent-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(56px, 6vw, 80px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--deep-ink);
  margin-bottom: 24px;
}

.ascent-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--soft-charcoal);
  opacity: 0.8;
}

/* Kamon finale band */
.kamon-finale {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(201, 169, 110, 0.35);
  border-bottom: 1px solid rgba(201, 169, 110, 0.35);
  overflow: hidden;
  max-width: 100%;
}

.finale-icon {
  color: var(--blush-gold);
  flex-shrink: 0;
  opacity: 0.8;
  animation: icon-breathe 8s ease-in-out infinite;
  transition: opacity 300ms, filter 300ms;
}

.finale-icon:nth-child(even)   { animation-delay: -4s; }
.finale-icon:nth-child(3n)     { animation-delay: -2s; }
.finale-icon:nth-child(5n)     { animation-delay: -6s; }

.finale-icon:hover {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.7));
}

/* ============================================
   AURORA BAND ANIMATIONS
   ============================================ */
@keyframes aurora-drift {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

.aurora-band-1 {
  animation: aurora-drift 14s ease-in-out infinite;
  animation-delay: 0s;
}

.aurora-band-2 {
  animation: aurora-drift 14s ease-in-out infinite;
  animation-delay: -4s;
}

.aurora-band-3 {
  animation: aurora-drift 14s ease-in-out infinite;
  animation-delay: -8s;
}

/* ============================================
   STAGGERED LETTER ANIMATION DELAYS
   (applied via JS or nth-child)
   ============================================ */
.hero-title .letter-fade:nth-child(1)  { animation-delay: 0ms; }
.hero-title .letter-fade:nth-child(2)  { animation-delay: 60ms; }
.hero-title .letter-fade:nth-child(3)  { animation-delay: 120ms; }
.hero-title .letter-fade:nth-child(4)  { animation-delay: 180ms; }
.hero-title .letter-fade:nth-child(5)  { animation-delay: 240ms; }
.hero-title .letter-fade:nth-child(6)  { animation-delay: 300ms; }
.hero-title .letter-fade:nth-child(7)  { animation-delay: 360ms; }
.hero-title .letter-fade:nth-child(8)  { animation-delay: 420ms; }
.hero-title .letter-fade:nth-child(9)  { animation-delay: 480ms; }
.hero-title .letter-fade:nth-child(10) { animation-delay: 540ms; }
.hero-title .letter-fade:nth-child(11) { animation-delay: 600ms; }
.hero-title .letter-fade:nth-child(12) { animation-delay: 660ms; }

/* ============================================
   PETAL MICRO-MOTIF (generated by JS)
   ============================================ */
.petal {
  position: absolute;
  pointer-events: none;
  opacity: 0.1;
}
