/* mujun.io - Dark Neon Editorial Design */
/* Colors: #0a0a14, #14102a, #c8c0d8, #6a5f8a, #ff2d78, #00e5ff, #ffd700, #e8e4f0 */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0a0a14;
  color: #c8c0d8;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(15px, 1.1vw, 19px);
  line-height: 1.75;
  overflow-x: hidden;
}

/* ===== ANIMATIONS ===== */

@keyframes bounce-enter {
  0% { opacity: 0; transform: translateY(60px) scale(0.95); }
  50% { opacity: 1; transform: translateY(-12px) scale(1.02); }
  70% { transform: translateY(4px) scale(0.99); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes neon-pulse {
  0%, 100% { opacity: 0.7; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.3); }
}

@keyframes bokeh-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(var(--drift-x), var(--drift-y)); }
}

@keyframes star-twinkle {
  0%, 100% { opacity: var(--star-opacity); }
  50% { opacity: calc(var(--star-opacity) * 0.4); }
}

@keyframes kanji-reveal {
  0% { opacity: 0; }
  100% { opacity: 0.4; }
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ===== SPREAD LAYOUT ===== */

.spread {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  margin-bottom: 200px;
}

.spread:last-child {
  margin-bottom: 0;
}

.spread-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  will-change: transform;
}

.spread-fg-layer {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  will-change: transform;
}

.spread-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 64px);
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(16px, 2vw, 32px);
  align-items: center;
}

/* ===== STAR FIELD ===== */

.star-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #e8e4f0;
  opacity: 0;
  animation: fade-in 1s ease forwards;
}

.star.bright-magenta {
  box-shadow: 0 0 12px 4px rgba(255, 45, 120, 0.4);
}

.star.bright-cyan {
  box-shadow: 0 0 12px 4px rgba(0, 229, 255, 0.3);
}

.star.twinkle {
  animation: fade-in 1s ease forwards, star-twinkle 4s ease-in-out infinite;
}

/* ===== CONSTELLATION ===== */

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

.constellation-svg line {
  stroke: rgba(200, 192, 216, 0.15);
  stroke-width: 1;
  stroke-dasharray: 4 8;
  opacity: 0;
  transition: opacity 2s ease;
}

.constellation-svg line.visible {
  opacity: 1;
}

/* ===== BOKEH ===== */

.bokeh-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bokeh-circle {
  position: absolute;
  border-radius: 50%;
  animation: bokeh-drift ease-in-out infinite alternate;
  pointer-events: none;
}

/* ===== NEON LINES ===== */

.neon-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 3;
}

.neon-line-magenta {
  background: linear-gradient(90deg, transparent, #ff2d78, transparent);
  animation: neon-pulse 3s ease-in-out infinite;
}

.neon-line-cyan {
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  animation: neon-pulse 3s ease-in-out infinite;
  animation-delay: 1s;
}

.neon-line-gold {
  background: linear-gradient(90deg, transparent, #ffd700, transparent);
  animation: neon-pulse 3s ease-in-out infinite;
  animation-delay: 2s;
}

/* ===== TYPOGRAPHY ===== */

.domain-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: clamp(48px, 10vw, 160px);
  letter-spacing: 0.02em;
  color: #e8e4f0;
  line-height: 1.05;
  text-shadow: 0 0 40px rgba(255, 45, 120, 0.15), 0 0 80px rgba(0, 229, 255, 0.08);
}

.domain-title-inverted {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: clamp(48px, 10vw, 160px);
  letter-spacing: 0.02em;
  color: #14102a;
  line-height: 1.05;
  text-shadow: 0 0 60px rgba(255, 45, 120, 0.3), 0 0 120px rgba(0, 229, 255, 0.2);
}

.kanji-watermark {
  position: absolute;
  font-family: 'Noto Serif JP', serif;
  font-weight: 900;
  font-size: clamp(300px, 50vw, 800px);
  color: rgba(20, 16, 42, 0.6);
  line-height: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  animation: kanji-reveal 4000ms ease forwards;
  animation-delay: 500ms;
  z-index: 1;
  transition: opacity 2s ease, transform 2s ease;
}

.kanji-watermark.scrolled {
  opacity: 0.2;
  transform: translate(-50%, -50%) scale(1.05);
}

.kanji-large {
  font-family: 'Noto Serif JP', serif;
  font-weight: 900;
  font-size: clamp(200px, 30vw, 500px);
  color: #14102a;
  line-height: 0.9;
  text-shadow: 0 0 80px rgba(255, 45, 120, 0.12), 2px 2px 0 rgba(200, 192, 216, 0.08);
  overflow: hidden;
}

.caption-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a5f8a;
  display: block;
  margin-bottom: 12px;
}

.body-text {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(15px, 1.1vw, 19px);
  line-height: 1.75;
  color: #c8c0d8;
  max-width: 38ch;
  margin-bottom: 1em;
}

.body-text em {
  font-style: italic;
  color: #e8e4f0;
}

.marginalia {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a5f8a;
  margin-top: 24px;
}

.marginalia-text {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #6a5f8a;
  line-height: 1.7;
  max-width: 32ch;
}

/* ===== BOUNCE TARGET ===== */

.bounce-target {
  opacity: 0;
  transform: translateY(60px) scale(0.95);
}

.bounce-target.entered {
  animation: bounce-enter 800ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ===== SPREAD 1: OPENING ===== */

.spread-opening {
  background: #0a0a14;
}

.opening-content {
  min-height: 100vh;
  align-items: center;
}

.opening-left {
  grid-column: 1 / 7;
  padding: clamp(40px, 8vh, 120px) 0;
  position: relative;
  z-index: 2;
}

.opening-right {
  grid-column: 6 / 13;
  position: relative;
  min-height: 60vh;
}

/* ===== SPREAD 2: PARADOX ===== */

.spread-paradox {
  background: #0a0a14;
}

.paradox-content {
  min-height: 100vh;
  align-items: center;
}

.paradox-left {
  grid-column: 1 / 7;
  overflow: hidden;
  position: relative;
}

.paradox-right {
  grid-column: 6 / 13;
  padding: clamp(40px, 8vh, 80px) 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
  position: relative;
  z-index: 2;
}

.paradox-text-block {
  background: rgba(10, 10, 20, 0.7);
  padding: clamp(24px, 3vw, 48px);
  border-left: 1px solid rgba(255, 45, 120, 0.3);
}

.paradox-annotation {
  padding-left: clamp(24px, 3vw, 48px);
  border-left: 1px solid rgba(0, 229, 255, 0.2);
}

/* ===== SPREAD 3: STARS ===== */

.spread-stars {
  background: #0a0a14;
}

.stars-content {
  min-height: 100vh;
  align-items: start;
  padding-top: 10vh;
  padding-bottom: 10vh;
  position: relative;
}

.callout {
  background: rgba(10, 10, 20, 0.75);
  padding: clamp(20px, 2.5vw, 40px);
  position: relative;
}

.callout-1 {
  grid-column: 1 / 5;
  align-self: start;
  margin-top: 8vh;
}

.callout-2 {
  grid-column: 8 / 12;
  align-self: start;
  margin-top: 20vh;
}

.callout-3 {
  grid-column: 2 / 6;
  align-self: end;
  margin-top: 15vh;
}

.callout-4 {
  grid-column: 9 / 13;
  align-self: end;
  margin-top: 5vh;
}

/* ===== SPREAD 4: CLOSING ===== */

.spread-closing {
  background: #0a0a14;
  margin-bottom: 0;
}

.neon-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 45, 120, 0.08) 0%, rgba(0, 229, 255, 0.05) 30%, transparent 70%);
  pointer-events: none;
}

.closing-content {
  min-height: 100vh;
  align-items: center;
  justify-items: center;
}

.closing-center {
  grid-column: 3 / 11;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.closing-marginalia {
  margin-top: 16px;
}

.closing-paradox {
  max-width: 40ch;
  text-align: center;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .spread-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .opening-left,
  .opening-right,
  .paradox-left,
  .paradox-right,
  .callout-1,
  .callout-2,
  .callout-3,
  .callout-4,
  .closing-center {
    grid-column: 1 / -1;
  }

  .kanji-large {
    font-size: clamp(120px, 40vw, 300px);
  }

  .kanji-watermark {
    font-size: clamp(180px, 60vw, 400px);
  }

  .spread {
    margin-bottom: 100px;
  }

  .callout {
    margin-top: 24px;
  }
}
