:root {
  --sunset-apricot: #f4a261;
  --plum-rose: #e76f51;
  --imperial-gold: #e9c46a;
  --warm-cream: #faf3e8;
  --twilight-mauve: #2a1f3d;
  --soft-charcoal: #3d3229;
  --warm-taupe: #8a7d6b;
  --sakura-blush: #f8c8c4;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  color: var(--soft-charcoal);
  background-color: var(--warm-cream);
  overflow-x: hidden;
  line-height: 1.85;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

/* ===== SECTION BACKDROP ===== */
.section-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-color: var(--warm-cream);
  transition: background-color 800ms ease;
}

.section-backdrop.bg-warm-cream { background-color: var(--warm-cream); }
.section-backdrop.bg-warm-cream-rose { background-color: #faf0ec; }
.section-backdrop.bg-apricot-light { background-color: #fdf0e0; }
.section-backdrop.bg-gold-warm { background-color: #faf3dc; }
.section-backdrop.bg-twilight { background-color: var(--twilight-mauve); }

/* ===== FLOATING ELEMENTS ===== */
.floaters-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--imperial-gold), var(--sunset-apricot));
}

.floater.blob {
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.floater.bg-layer {
  z-index: 0;
  opacity: 0.12;
  filter: blur(6px);
  animation: floatSlow 16s ease-in-out infinite alternate;
}

.floater.mid-layer {
  z-index: 5;
  opacity: 0.25;
  filter: blur(2px);
  animation: floatMed 12s ease-in-out infinite alternate;
}

.floater.fg-layer {
  z-index: 15;
  opacity: 0.45;
  background: radial-gradient(circle at 30% 30%, var(--imperial-gold), var(--plum-rose));
  animation: floatFast 8s ease-in-out infinite alternate;
}

@keyframes floatSlow {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(30px, -40px) rotate(8deg); }
}

@keyframes floatMed {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-20px, 25px) rotate(-5deg); }
}

@keyframes floatFast {
  0% { transform: translate(0, 0); }
  100% { transform: translate(15px, -15px); }
}

/* ===== KANJI NAVIGATION ===== */
.kanji-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanji-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sunset-apricot), var(--plum-rose));
  color: #fff;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  box-shadow:
    inset 0 -2px 4px rgba(0,0,0,0.08),
    inset 0 2px 4px rgba(255,255,255,0.2),
    0 4px 12px rgba(231, 111, 81, 0.25);
  opacity: 0.5;
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.kanji-pill.active {
  opacity: 1;
  animation: pillPulse 2.5s ease-in-out infinite;
}

@keyframes pillPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 -2px 4px rgba(0,0,0,0.08),
      inset 0 2px 4px rgba(255,255,255,0.2),
      0 4px 12px rgba(231, 111, 81, 0.25);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      inset 0 -2px 4px rgba(0,0,0,0.08),
      inset 0 2px 4px rgba(255,255,255,0.2),
      0 6px 20px rgba(231, 111, 81, 0.4);
  }
}

/* ===== SECTIONS ===== */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.section-inner {
  max-width: 960px;
  width: 100%;
  padding: 80px 40px;
  margin: 0 auto;
}

/* ===== KANJI HERO ===== */
.kanji-hero {
  text-align: center;
  margin-bottom: 48px;
}

.kanji-3d {
  display: inline-block;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
  font-size: clamp(6rem, 15vw, 12rem);
  line-height: 1.1;
  color: var(--warm-cream);
  background: linear-gradient(135deg, var(--sunset-apricot) 0%, var(--plum-rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 24px rgba(231, 111, 81, 0.35))
          drop-shadow(0 2px 4px rgba(231, 111, 81, 0.2));
  transform: perspective(800px) rotateX(2deg) rotateY(-1deg);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.kanji-3d:hover {
  transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(1.03);
  filter: drop-shadow(0 16px 40px rgba(231, 111, 81, 0.4))
          drop-shadow(0 4px 8px rgba(231, 111, 81, 0.25));
}

/* ===== SECTION CONTENT ===== */
.section-content {
  max-width: 640px;
  margin: 0 auto;
}

.section-subtitle {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: 0.08em;
  color: var(--soft-charcoal);
  margin-bottom: 8px;
}

.section-romaji {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--warm-taupe);
  margin-bottom: 24px;
}

.section-text {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  color: var(--soft-charcoal);
  margin-bottom: 20px;
}

.section-closing {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--imperial-gold);
  text-align: center;
  margin-top: 48px;
  filter: drop-shadow(0 2px 8px rgba(233, 196, 106, 0.4));
}

.light-text {
  color: var(--warm-cream) !important;
}

.light-text.section-romaji {
  color: var(--sakura-blush) !important;
}

/* ===== PROGRESSIVE DISCLOSURE ===== */
.reveal-element {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-element.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.kanji-hero.reveal-element {
  transition-duration: 1200ms;
}

.kanji-hero.reveal-element .kanji-3d {
  transform: perspective(800px) rotateX(2deg) rotateY(-1deg) scale(0.7);
  filter: drop-shadow(0 0 0 transparent);
  transition: transform 1200ms cubic-bezier(0.22, 1, 0.36, 1),
              filter 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.kanji-hero.reveal-element.revealed .kanji-3d {
  transform: perspective(800px) rotateX(2deg) rotateY(-1deg) scale(1);
  filter: drop-shadow(0 8px 24px rgba(231, 111, 81, 0.35))
          drop-shadow(0 2px 4px rgba(231, 111, 81, 0.2));
}

/* ===== INFLATED 3D SURFACE ===== */
.inflated {
  background: linear-gradient(135deg, var(--sunset-apricot) 0%, var(--plum-rose) 100%);
  border-radius: 24px;
  box-shadow:
    inset 0 -4px 8px rgba(0,0,0,0.08),
    inset 0 4px 8px rgba(255,255,255,0.25),
    0 8px 24px rgba(231, 111, 81, 0.3),
    0 2px 4px rgba(231, 111, 81, 0.15);
  transform: perspective(800px) rotateX(2deg) rotateY(-1deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
}

.inflated:hover {
  transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(1.03);
  box-shadow:
    inset 0 -2px 4px rgba(0,0,0,0.05),
    inset 0 6px 12px rgba(255,255,255,0.3),
    0 16px 40px rgba(231, 111, 81, 0.35),
    0 4px 8px rgba(231, 111, 81, 0.2);
}

/* ===== TIMELINE (Section 3) ===== */
.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 32px -40px;
  padding: 20px 40px;
  -webkit-overflow-scrolling: touch;
}

.timeline-scroll::-webkit-scrollbar {
  height: 6px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: rgba(244, 162, 97, 0.1);
  border-radius: 3px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  background: var(--sunset-apricot);
  border-radius: 3px;
}

.timeline-track {
  display: flex;
  gap: 20px;
  min-width: max-content;
  padding-bottom: 8px;
}

.date-pill {
  flex: 0 0 200px;
  padding: 28px 24px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill-year {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.05em;
}

.pill-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.pill-detail {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* ===== ICON GALLERY (Section 4) ===== */
.icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 16px;
  color: #fff;
  text-align: center;
}

.icon-svg {
  width: 64px;
  height: 64px;
  color: #fff;
  filter: drop-shadow(4px 6px 8px rgba(231, 111, 81, 0.25));
}

.icon-label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== SUN CIRCLE (Section 5) ===== */
.sun-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(200px, 40vw, 320px);
  height: clamp(200px, 40vw, 320px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--imperial-gold), var(--sunset-apricot), var(--plum-rose));
  box-shadow:
    inset 0 -8px 20px rgba(0,0,0,0.1),
    inset 0 8px 20px rgba(255,255,255,0.2),
    0 0 80px rgba(244, 162, 97, 0.4),
    0 0 160px rgba(233, 196, 106, 0.2);
  animation: sunPulse 4s ease-in-out infinite;
}

.sun-circle .kanji-3d {
  -webkit-text-fill-color: var(--twilight-mauve);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  filter: none;
}

@keyframes sunPulse {
  0%, 100% {
    box-shadow:
      inset 0 -8px 20px rgba(0,0,0,0.1),
      inset 0 8px 20px rgba(255,255,255,0.2),
      0 0 80px rgba(244, 162, 97, 0.4),
      0 0 160px rgba(233, 196, 106, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow:
      inset 0 -8px 20px rgba(0,0,0,0.1),
      inset 0 8px 20px rgba(255,255,255,0.2),
      0 0 100px rgba(244, 162, 97, 0.5),
      0 0 200px rgba(233, 196, 106, 0.3);
    transform: scale(1.04);
  }
}

/* ===== SECTION-SPECIFIC ===== */
.section-hi {
  color: var(--warm-cream);
}

.section-hi .section-subtitle,
.section-hi .section-text {
  color: var(--warm-cream);
}

.section-hi .section-romaji {
  color: var(--sakura-blush);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .kanji-nav {
    right: 12px;
    gap: 8px;
  }

  .kanji-pill {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 10px;
  }

  .section-inner {
    padding: 60px 24px;
  }

  .icon-gallery {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }

  .icon-card {
    padding: 20px 12px;
  }

  .date-pill {
    flex: 0 0 170px;
    padding: 20px 18px;
  }

  .timeline-scroll {
    margin: 24px -24px;
    padding: 16px 24px;
  }
}

@media (max-width: 480px) {
  .kanji-nav {
    right: 8px;
    gap: 6px;
  }

  .kanji-pill {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 8px;
  }

  .section-inner {
    padding: 48px 16px;
  }

  .icon-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
