/**
 * Section Styles — 各章节专属样式
 */

/* ═══════════════════════════════════════════════════
   Section 1: Hero
   ═══════════════════════════════════════════════════ */

.hero {
  background: linear-gradient(
    175deg,
    #2d1a2e 0%,
    #3d1f3a 20%,
    #4a2545 40%,
    #3b1e3e 70%,
    #2a1528 100%
  );
  color: #fff;
  overflow: hidden;
  flex-direction: column;
}

.hero .hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(15, 10, 20, 0.5) 100%);
  pointer-events: none;
  z-index: 1;
}

.rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.firefly-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero__subtitle {
  font-size: var(--fs-body);
  color: rgba(255, 200, 210, 0.7);
  letter-spacing: 0.2em;
  font-weight: 400;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  font-weight: 900;
  letter-spacing: 0.15em;
  line-height: 1.2;
  color: #ffd6e0;
  text-shadow:
    0 0 60px rgba(255, 160, 180, 0.5),
    0 0 120px rgba(255, 130, 160, 0.2),
    0 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
}

.hero__title .char-reveal {
  background: linear-gradient(
    135deg,
    #ffd6e0 0%,
    #fff0f3 20%,
    #e8a598 40%,
    #ffd6e0 60%,
    #fff5f7 80%,
    #ffd6e0 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: char-reveal-in 1s var(--ease-out-back) forwards, hero-title-shimmer 6s ease-in-out 1s infinite;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255, 160, 180, 0.15) 0%, transparent 70%);
  animation: hero-glow-pulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.char-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) scale(0.8);
}

.hero__title .char-reveal[data-delay="200"] { animation-delay: 200ms, 1.2s; }
.hero__title .char-reveal[data-delay="400"] { animation-delay: 400ms, 1.4s; }

.hero__tagline {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: rgba(255, 190, 200, 0.45);
  letter-spacing: 0.1em;
}

.hero__scroll-hint {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: rgba(255, 190, 210, 0.4);
  font-size: var(--fs-small);
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(255, 190, 210, 0.4);
  border-bottom: 2px solid rgba(255, 190, 210, 0.4);
  transform: rotate(45deg);
  animation: bounce-down 2s ease-in-out infinite;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-in-up 1s var(--ease-out-expo) forwards;
}

.fade-in-up[data-delay="600"]  { animation-delay: 600ms; }
.fade-in-up[data-delay="900"]  { animation-delay: 900ms; }
.fade-in-up[data-delay="1200"] { animation-delay: 1200ms; }

/* -- Hero epigraph poem -- */
.hero__epigraph {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255, 210, 220, 0.6);
  letter-spacing: 0.3em;
  font-weight: 400;
}


/* ═══════════════════════════════════════════════════
   Section 2: Calligraphy
   ═══════════════════════════════════════════════════ */

.calligraphy {
  background: var(--color-paper-warm);
}

.calligraphy__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.brush-canvas {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 2.2 / 1;
  background: linear-gradient(
    145deg,
    var(--color-paper) 0%,
    #faf5ec 100%
  );
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg), inset 0 0 60px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* -- Section poem (appears in every section) -- */
.section__poem {
  font-family: var(--font-serif);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: var(--space-sm);
}



/* -- Calligraphy Toolbar -- */
.calligraphy__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5em 1.2em;
  font-size: var(--fs-small);
  font-family: var(--font-serif);
  color: var(--color-accent);
  background: transparent;
  border: 1.5px solid var(--color-accent);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.toolbar-btn:hover {
  background: var(--color-accent);
  color: #fff;
  transform: scale(1.05);
}

.toolbar-btn:active {
  transform: scale(0.97);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

/* -- Color Picker -- */
.color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4em 0.8em;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 999px;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow);
  transform: scale(1.15);
}

.color-dot--ink  { background: #1a1a2e; }
.color-dot--red  { background: #c9756b; }
.color-dot--gold { background: #b8860b; }
.color-dot--blue { background: #4a6fa5; }


/* ═══════════════════════════════════════════════════
   Section 3: Languages
   ═══════════════════════════════════════════════════ */

.languages {
  background: var(--color-paper);
}

.code-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.code-card {
  background: var(--color-terminal-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition:
    transform var(--duration-fast) var(--ease-out-back),
    box-shadow var(--duration-fast) ease;
  opacity: 0;
  transform: translateY(20px);
}

.code-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--duration-normal) var(--ease-out-expo),
    transform var(--duration-normal) var(--ease-out-expo);
}

.code-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.code-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6em 1em;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-card__lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.code-card__index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-terminal-comment);
}

.code-card__body {
  padding: 1em 1.2em;
}

.code-card__code {
  font-family: var(--font-mono);
  font-size: var(--fs-code);
  color: var(--color-terminal-text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-card__code .keyword {
  color: var(--color-terminal-keyword);
}

.code-card__code .string {
  color: var(--color-terminal-string);
}

.code-card__code .type {
  color: #89b4fa;
}

.code-card__code .punctuation {
  color: #6c7086;
}


/* ═══════════════════════════════════════════════════
   Section 4: Characters
   ═══════════════════════════════════════════════════ */

.characters {
  background: linear-gradient(
    180deg,
    var(--color-paper-warm) 0%,
    var(--color-paper) 100%
  );
}

.char-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.char-card {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration-fast) var(--ease-out-back),
    box-shadow var(--duration-fast) ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.char-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.char-card__symbol {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--color-ink);
  background: linear-gradient(
    145deg,
    var(--color-paper-warm) 0%,
    var(--color-paper-dark) 100%
  );
  position: relative;
  overflow: hidden;
}

.char-card__symbol::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 50%,
    var(--color-accent-glow) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.char-card:hover .char-card__symbol::after {
  opacity: 1;
}

.char-card__body {
  padding: var(--space-md);
}

.char-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-sm);
}

.char-card__details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4em 1em;
  font-size: var(--fs-small);
  line-height: 1.8;
}

.char-card__details dt {
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}

.char-card__details dd {
  color: var(--color-text);
}


/* ═══════════════════════════════════════════════════
   Section 5: Letter (Terminal)
   ═══════════════════════════════════════════════════ */

.letter {
  background: var(--color-ink);
}

.letter .section__heading {
  color: #fff;
}

.letter .heading-deco {
  color: var(--color-accent-light);
}

.letter .section__desc {
  color: rgba(255, 255, 255, 0.4);
}

.letter__terminal {
  max-width: 640px;
  margin: 0 auto;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(166, 227, 161, 0.06);
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #181825;
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot--red    { background: #f38ba8; }
.terminal__dot--yellow { background: #f9e2af; }
.terminal__dot--green  { background: #a6e3a1; }

.terminal__title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-terminal-comment);
}

.terminal__body {
  background: var(--color-terminal-bg);
  padding: var(--space-md);
  min-height: 320px;
  font-family: var(--font-mono);
  font-size: var(--fs-code);
  line-height: 1.9;
  color: var(--color-terminal-text);
}

.terminal__body .line {
  opacity: 0;
  transform: translateX(-8px);
  animation: terminal-line-in 0.4s var(--ease-out-expo) forwards;
  white-space: pre-wrap;
}

.terminal__body .line--comment {
  color: var(--color-terminal-comment);
}

.terminal__body .line--keyword {
  color: var(--color-terminal-keyword);
}

.terminal__body .line--string {
  color: var(--color-terminal-string);
}

.terminal__body .line--result {
  color: var(--color-accent-light);
  font-weight: 600;
}

.terminal__body .line--empty {
  height: 1.9em;
}

.terminal__body .cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--color-terminal-text);
  vertical-align: text-bottom;
  animation: cursor-blink 1s step-end infinite;
  margin-left: 2px;
}


/* ═══════════════════════════════════════════════════
   Section: Generative Art
   ═══════════════════════════════════════════════════ */

.generative {
  background: linear-gradient(
    180deg,
    var(--color-paper-warm) 0%,
    #fef0f3 40%,
    var(--color-paper) 100%
  );
  padding-bottom: 0;
  flex-direction: column;
}

.generative .section__inner {
  position: relative;
  z-index: 2;
  padding-bottom: var(--space-md);
}

.section__heading--light {
  color: var(--color-ink);
}

.heading-deco--light {
  color: var(--color-accent);
}

.section__desc--light {
  color: var(--color-text-muted);
}

.generative__canvas-wrap {
  width: 100%;
  height: 72vh;
  min-height: 450px;
  position: relative;
}

.generative__canvas-wrap canvas {
  display: block;
}


/* ═══════════════════════════════════════════════════
   Section: Sakura overlay canvas (on languages)
   ═══════════════════════════════════════════════════ */

.sakura-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.sakura-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.languages {
  position: relative;
  overflow: hidden;
}

.languages .section__inner {
  position: relative;
  z-index: 1;
}


/* ═══════════════════════════════════════════════════
   Section: Constellation
   ═══════════════════════════════════════════════════ */

.constellation {
  background: #0f0f23;
  overflow: hidden;
}

/* -- Constellation overlay -- */
.constellation__overlay {
  position: absolute;
  bottom: var(--space-lg);
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.constellation__poem {
  font-family: var(--font-serif);
  font-size: var(--fs-small);
  color: rgba(255, 200, 210, 0.35);
  letter-spacing: 0.2em;
}

.constellation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}


/* ═══════════════════════════════════════════════════
   Section: Ending — Hearts + Heartbeat
   ═══════════════════════════════════════════════════ */

.hearts-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ending__heart-beat {
  margin: var(--space-sm) 0;
}

.heart-icon {
  display: inline-block;
  font-size: 3rem;
  color: var(--color-accent);
  animation: heartbeat 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 18px var(--color-accent-glow));
}


/* ═══════════════════════════════════════════════════
   Section: Ending
   ═══════════════════════════════════════════════════ */

.ending {
  background: linear-gradient(
    175deg,
    #2d1a2e 0%,
    #3d1f3a 25%,
    #4a2545 50%,
    #3b1e3e 75%,
    #2a1528 100%
  );
  min-height: 100vh;
  text-align: center;
  overflow: hidden;
  color: #fff;
}

.sparkle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ending__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.ending__poetry-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.ending__poem {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: rgba(255, 210, 220, 0.9);
  letter-spacing: 0.35em;
  text-shadow: 0 0 30px rgba(255, 160, 180, 0.3);
}

.ending__poem-author {
  font-family: var(--font-serif);
  font-size: var(--fs-small);
  color: rgba(255, 190, 210, 0.4);
  letter-spacing: 0.2em;
}

.ending__verse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
}

.ending__verse-line {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255, 200, 210, 0.65);
  letter-spacing: 0.25em;
  line-height: 2;
}

.ending__code-snippet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  padding: 1.2em 2em;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 200, 210, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.ending__code-line {
  font-family: var(--font-mono);
  font-size: var(--fs-code);
  color: rgba(166, 227, 161, 0.8);
  letter-spacing: 0.05em;
}

.ending__result {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, #ffd6e0, #e8a598, #ffd6e0);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-title-shimmer 3s ease-in-out infinite;
  letter-spacing: 0.08em;
}

.ending__divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 200, 210, 0.5),
    transparent
  );
  margin: var(--space-sm) 0;
}

.ending__final {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #ffd6e0;
  letter-spacing: 0.12em;
  text-shadow: 0 0 40px rgba(255, 160, 180, 0.4), 0 0 80px rgba(255, 130, 160, 0.2);
}

.ending__eternal {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  background: linear-gradient(135deg, #ffd6e0, #e8a598, #c9756b, #e8a598, #ffd6e0);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-title-shimmer 4s ease-in-out infinite;
  letter-spacing: 0.3em;
  font-weight: 600;
}

.ending__seal {
  margin-top: var(--space-md);
}

.ending__seal-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 2px solid rgba(201, 117, 107, 0.6);
  border-radius: 4px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 900;
  color: rgba(201, 117, 107, 0.8);
  transform: rotate(-8deg);
  box-shadow: 0 0 20px rgba(201, 117, 107, 0.15);
  text-shadow: 0 0 8px rgba(201, 117, 107, 0.3);
  animation: seal-breathe 3s ease-in-out infinite;
}


/* ═══════════════════════════════════════════════════
   Interactive Elements
   ═══════════════════════════════════════════════════ */

/* -- Draw hint for calligraphy -- */
.draw-hint {
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
  margin-top: var(--space-xs);
}

.draw-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -- Code card 3D tilt + toast -- */
.code-card {
  cursor: pointer;
  transform-style: preserve-3d;
  transition:
    transform 0.15s ease,
    box-shadow var(--duration-fast) ease;
}

.code-card__toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(166, 227, 161, 0.95);
  color: #1e1e2e;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4em 1.2em;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.code-card__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.code-card {
  position: relative;
}

/* -- Character card 3D + expand -- */
.char-card {
  cursor: pointer;
  transform-style: preserve-3d;
  transition:
    transform var(--duration-fast) var(--ease-out-back),
    box-shadow var(--duration-fast) ease;
}

.char-card__glyph {
  display: block;
  position: relative;
  z-index: 1;
  transition: transform 0.4s var(--ease-out-back);
}

.char-card:hover .char-card__glyph {
  transform: scale(1.08);
}

.char-card__secret {
  font-size: 0.8rem;
  color: var(--color-accent);
  margin-top: var(--space-sm);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.char-card.is-expanded .char-card__secret {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.char-card__extra {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s var(--ease-out-expo), opacity 0.4s ease, margin 0.3s ease;
  margin-top: 0;
}

.char-card.is-expanded .char-card__extra {
  max-height: 200px;
  opacity: 1;
  margin-top: var(--space-sm);
}

.char-card__extra p {
  font-size: var(--fs-small);
  color: var(--color-text);
  line-height: 1.8;
}

/* -- Interactive terminal input -- */
.line--input-line {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: var(--space-xs);
  opacity: 1;
  transform: none;
  animation: none;
}

.input-prompt {
  color: var(--color-terminal-keyword);
  font-weight: 600;
  white-space: pre;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-terminal-text);
  font-family: var(--font-mono);
  font-size: var(--fs-code);
  caret-color: var(--color-terminal-text);
  padding: 0;
}

.terminal-input::placeholder {
  color: var(--color-terminal-comment);
  font-style: italic;
}

.line--hint {
  animation: glow-pulse 2s ease-in-out infinite !important;
  opacity: 1 !important;
}

/* -- Generative art section interaction hint -- */
.generative__canvas-wrap {
  cursor: pointer;
}

/* -- Constellation section -- */
.constellation-canvas {
  cursor: crosshair;
}

/* -- Glassmorphism for section headings -- */
.section__heading {
  position: relative;
}

/* -- Ending floating glow orbs -- */
.ending::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 170, 0.15) 0%, transparent 70%);
  top: 15%;
  left: 8%;
  z-index: 0;
  animation: float 10s ease-in-out infinite;
  pointer-events: none;
}

.ending::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 160, 255, 0.12) 0%, transparent 70%);
  bottom: 20%;
  right: 10%;
  z-index: 0;
  animation: float 7s ease-in-out 3s infinite;
  pointer-events: none;
}

/* -- Hero floating glow orbs -- */
.hero::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 170, 0.12) 0%, transparent 70%);
  top: 20%;
  left: 10%;
  z-index: 0;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

.hero::before {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 160, 255, 0.1) 0%, transparent 70%);
  bottom: 15%;
  right: 15%;
  z-index: 0;
  animation: float 6s ease-in-out 2s infinite;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════
   Progress Indicator (Side Dots)
   ═══════════════════════════════════════════════════ */

.progress-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9980;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.progress-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.progress-nav__dots {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  margin: 0;
}

.progress-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 200, 210, 0.3);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.35s ease;
}

.progress-dot::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: rgba(255, 200, 210, 0.2);
  transition: all 0.35s ease;
}

.progress-dot:hover {
  border-color: rgba(255, 200, 210, 0.7);
  transform: scale(1.3);
}

.progress-dot:hover .progress-dot__label {
  opacity: 1;
  transform: translateX(-8px);
}

.progress-dot.is-active {
  border-color: var(--color-accent-light);
}

.progress-dot.is-active::before {
  background: var(--color-accent-light);
}

.progress-dot__label {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  margin-right: 12px;
  white-space: nowrap;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  color: rgba(255, 200, 210, 0.6);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

@media (max-width: 640px) {
  .progress-nav { display: none; }
}


/* ═══════════════════════════════════════════════════
   Music Toggle Button
   ═══════════════════════════════════════════════════ */

.music-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9990;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 20, 35, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 200, 210, 0.15);
  color: rgba(255, 200, 210, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.music-toggle:hover {
  background: rgba(60, 40, 55, 0.8);
  color: rgba(255, 200, 210, 0.9);
  border-color: rgba(255, 200, 210, 0.3);
  transform: scale(1.08);
  box-shadow: 0 4px 30px rgba(201, 117, 107, 0.2);
}

.music-toggle.is-playing {
  color: var(--color-accent-light);
  border-color: rgba(201, 117, 107, 0.4);
  animation: music-pulse 2s ease-in-out infinite;
}

.music-toggle__hint {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 12px;
  white-space: nowrap;
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: rgba(255, 200, 210, 0.7);
  letter-spacing: 0.08em;
  opacity: 0;
  animation: hint-fade 4s ease-in-out 2s forwards;
  pointer-events: none;
}

@keyframes hint-fade {
  0% { opacity: 0; transform: translateY(-50%) translateX(8px); }
  15% { opacity: 1; transform: translateY(-50%) translateX(0); }
  85% { opacity: 1; transform: translateY(-50%) translateX(0); }
  100% { opacity: 0; transform: translateY(-50%) translateX(8px); }
}

@keyframes music-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(201, 117, 107, 0.15); }
  50% { box-shadow: 0 4px 30px rgba(201, 117, 107, 0.35), 0 0 15px rgba(201, 117, 107, 0.1); }
}


/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .section {
    padding: var(--space-lg) var(--space-sm);
  }

  .code-cards {
    grid-template-columns: 1fr;
  }

  .char-cards {
    grid-template-columns: 1fr;
  }

  .char-card__symbol {
    font-size: 3.5rem;
    padding: var(--space-md);
  }

  .terminal__body {
    padding: var(--space-sm);
    font-size: 0.78rem;
  }
}
