.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 10;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

:root {
  /* Button sizing: change only --kh-btn-scale to resize the button across views */
  --kh-btn-scale: 0.7;
  --kh-btn-desktop-font: 15px;
  --kh-btn-desktop-padding-y: 10px;
  --kh-btn-desktop-padding-x: 20px;
  --kh-btn-desktop-gap: 14px;
  --kh-btn-desktop-icon-h: 36px;
  --kh-btn-desktop-border-radius: 0;

  /* Mobile bases (used inside the mobile media query) */
  --kh-btn-mobile-font: 13px;
  --kh-btn-mobile-padding-y: 10px;
  --kh-btn-mobile-padding-x: 20px;
  --kh-btn-mobile-gap: 10px;
  --kh-btn-mobile-icon-h: 28px;
}

/* ── Home header ── */
.home-header {
  padding: 16px 24px 0;
  transition: padding 0.3s ease;
}
.header-logo {
  position: fixed;
  top: 28px;
  left: 24px;
  width: 2rem;
  height: 2rem;
  z-index: 11;
  transform: translateX(0);
  transition: top 0.4s ease, left 0.4s ease, width 0.4s ease, height 0.4s ease,
    transform 0.4s ease;
}

/* ── Hero ── */
.home-hero {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 40px 48px 60px;
  position: relative;
  overflow: hidden;
  transition: padding 0.4s ease, gap 0.4s ease;
}
.hero-content {
  flex-grow: 1;
  flex-shrink: 0;
  flex-basis: 0%;
  max-width: min(500px, 85%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: flex-grow 0.4s ease, max-width 0.4s ease;
}
.hero-content h1 {
  font-family: var(--kh-font-cinzel);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 1px;
  transition: font-size 0.4s ease, margin-bottom 0.4s ease;
  line-height: 1.15;
  --ks: #fff;
}
.hero-content h1 .line > span {
  color: var(--kh-gold);
  --ks: var(--kh-gold);
}
.hero-content h1 .line,
.hero-content .sub .line {
  white-space: nowrap;
}
.hero-content .sub {
  font-size: 0.8rem;
  color: #9a8ab0;
  margin-bottom: 32px;
  max-width: min(480px, 90%);
  line-height: 1.3;
  font-style: italic;
  transition: max-width 0.4s ease, font-size 0.4s ease, margin-bottom 0.4s ease;
}
.hero-content .sub strong {
  color: var(--kh-gold);
  font-weight: 600;
}
.hero-character {
  flex: 0 0 auto;
  width: 300px;
  height: 460px;
  position: relative;
  opacity: 1;
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
}
.hero-char {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(18px 10px 10px rgba(0, 0, 0, 0.8));
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}
.hero-char--sora {
  width: 100%;
}
.hero-char--riku {
  width: 78%;
  left: 40px;
}
.hero-char--kairi {
  width: 72%;
  left: 20px;
}
.hero-char--roxas {
  width: 120%;
  left: -50px;
  top: -25px;
}
.hero-char.active {
  opacity: 1;
}
/* ── Cone background: clipped triangle inside home-page ── */
.home-cone-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.home-cone-bg > * {
  position: absolute;
  inset: 0;
}
.cone-rim-shadow {
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
}
.cone-canvas-watermark {
  z-index: 0;
  filter: grayscale(1) invert(1);
  opacity: 0.08;
}
.cone-wash {
  z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.04),
    rgba(212, 175, 55, 0.01)
  );
}
.cone-canvas-posters {
  z-index: 2;
  transform: perspective(2000px) rotateY(25deg);
  transform-origin: right center;
}
.cone-fade {
  z-index: 2;
}
/* ── Timeline button ── */
.kh-timeline-btn {
  background: #141116;
  border: 1.5px solid #cca64b;
  border-radius: calc(
    var(--kh-btn-desktop-border-radius) * var(--kh-btn-scale)
  );
  padding: calc(var(--kh-btn-desktop-padding-y) * var(--kh-btn-scale))
    calc(var(--kh-btn-desktop-padding-x) * var(--kh-btn-scale));
  color: #cca64b;
  font-family: var(--kh-font-cinzel);
  font-size: calc(var(--kh-btn-desktop-font) * var(--kh-btn-scale));
  font-weight: 500;
  letter-spacing: 2px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--kh-btn-desktop-gap) * var(--kh-btn-scale));
  text-decoration: none;
  transition: color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              background 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              border-color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              text-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 0 8px rgba(204, 166, 75, 0.05);
  /* Keep the label on a single line at every width. Without this, just above
     the mobile breakpoint the squeezed content column forces "ENTER THE
     TIMELINE" to wrap onto two lines. */
  white-space: nowrap;
}
.kh-timeline-btn .btn-text {
  white-space: nowrap;
}
.kh-timeline-btn:hover {
  background: #19151c;
  color: #ffdf91;
  border-color: #ffdf91;
  box-shadow: 0 0 20px rgba(204, 166, 75, 0.35);
  text-shadow: 0 0 4px rgba(255, 223, 145, 0.4);
}
.kh-timeline-btn:active {
  transform: scale(0.98);
  box-shadow: 0 0 10px rgba(204, 166, 75, 0.2);
}
/* ── Button border shimmer ── */
.kh-timeline-btn {
  position: relative;
  overflow: hidden;
}
.kh-timeline-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 223, 145, 0.12) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  pointer-events: none;
  border-radius: inherit;
}
.keyblade-icon {
  height: calc(var(--kh-btn-desktop-icon-h) * var(--kh-btn-scale));
  color: #cca64b;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0.85;
  flex-shrink: 0;
}
.keyblade-icon.right {
  transform: scaleX(-1);
}
.kh-timeline-btn:hover .keyblade-icon {
  color: #ffdf91;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(255, 223, 145, 0.5));
}
.kh-timeline-btn:hover .keyblade-icon.left {
  transform: translateX(-4px);
}
.kh-timeline-btn:hover .keyblade-icon.right {
  transform: scaleX(-1) translateX(-4px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .home-hero {
    flex-direction: row;
    text-align: center;
    padding: 75px 24px;
    gap: 0px;
  }
  .hero-content {
    flex-grow: 0;
    flex-shrink: 1;
    flex-basis: auto;
    max-width: 100%;
  }
  .hero-content h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    /* Dense dark halo for readability over bright poster content. */
    text-shadow: 0 0 14px rgba(8, 4, 14, 1), 0 0 28px rgba(8, 4, 14, 0.9),
      0 2px 16px rgba(8, 4, 14, 0.85), 0 0 40px rgba(212, 175, 55, 0.25);
  }
  .hero-content .sub {
    max-width: 90vw;
    font-size: 0.9rem;
    margin-bottom: 26px;
    text-shadow: 0 1px 10px rgba(8, 4, 14, 1), 0 0 8px rgba(8, 4, 14, 0.9);
  }
  .hero-character {
    width: 0;
    height: 0;
    opacity: 0;
    animation: none;
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
  }
  .hero-char {
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .hero-char.active {
    transform: translateX(100vw);
  }
  .kh-timeline-btn {
    padding: calc(var(--kh-btn-mobile-padding-y) * var(--kh-btn-scale))
      calc(var(--kh-btn-mobile-padding-x) * var(--kh-btn-scale));
    margin-top: 10px;
    font-size: calc(var(--kh-btn-mobile-font) * var(--kh-btn-scale));
    gap: calc(var(--kh-btn-mobile-gap) * var(--kh-btn-scale));
    white-space: nowrap;
    max-width: 92vw;
  }
  .kh-timeline-btn .btn-text {
    white-space: nowrap;
  }
  .kh-timeline-btn .keyblade-icon {
    height: calc(var(--kh-btn-mobile-icon-h) * var(--kh-btn-scale));
  }
  .home-header {
    padding: 12px 16px 0;
  }
  .header-logo {
    position: absolute;
    top: 20vh;
    left: 50%;
    width: 6rem;
    height: 6rem;
    transform: translateX(-50%);
    /* The logo sits over the cone's bright content on mobile — a soft dark
       halo behind it keeps the crown legible. */
    filter: drop-shadow(0 0 6px rgba(8, 4, 14, 0.9));
  }
}

/* Take footer out of flow so hero never absorbs its height changes */
.home-page > .footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}


