:root {
  color-scheme: dark;
  --midnight: #050510;
  --midnight-soft: #08071c;
  --champagne: #f6d28b;
  --rose: #ff6fae;
  --ice: #c7e7ff;
  --active-accent: #f6d28b;
  --text: #f9fbff;
  --muted: #c7c9dc;
  --panel: rgba(10, 9, 22, 0.8);
  --panel-tint: #14142b;
  --timeline-line: rgba(255, 255, 255, 0.15);
  --glow: rgba(255, 255, 255, 0.4);
}

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--midnight);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

body.pre-entry {
  height: 100vh;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.background-layers {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -2;
}

.parallax-backdrop {
  position: absolute;
  inset: 0;
  background: url("assets/sparkle-pattern.svg") repeat;
  background-size: 320px;
  opacity: 0.15;
  transition: transform 0.6s ease;
}

#confettiCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gradient-mesh {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 20% 20%, rgba(246, 210, 139, 0.35), transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(255, 111, 174, 0.25), transparent 35%),
    radial-gradient(circle at 40% 80%, rgba(144, 206, 255, 0.2), transparent 45%),
    linear-gradient(120deg, rgba(5, 5, 16, 0.9), rgba(7, 7, 26, 0.95));
  filter: blur(40px);
  animation: gradientFlow 16s ease-in-out infinite alternate;
}

.orb {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.4;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 60%);
  animation: float 12s ease-in-out infinite;
}

.orb-one {
  top: 15%;
  left: 10%;
}

.orb-two {
  bottom: 20%;
  right: 15%;
  animation-duration: 18s;
}

.orb-three {
  top: 40%;
  left: 60%;
  animation-duration: 22s;
}

.cursor-glow {
  position: fixed;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  margin-left: -100px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 60%);
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
  opacity: 0.6;
  z-index: 20;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.hero-content {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 2.5rem;
  background: rgba(5, 5, 16, 0.35);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  animation: shimmer 6s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1.2;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

.subtext {
  font-size: 1.05rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.cta {
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px) scale(1.02);
}

.cta:hover::after,
.cta:focus-visible::after {
  opacity: 1;
}

.cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.cta.primary {
  background: linear-gradient(120deg, var(--champagne), var(--rose));
  color: #050510;
  box-shadow: 0 0 30px rgba(246, 210, 139, 0.4);
}

.cta.ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
  box-shadow: 0 0 25px rgba(255, 111, 174, 0.2);
}

.cta.subtle {
  border-color: rgba(255, 255, 255, 0.2);
  text-transform: none;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  padding: 0.65rem 1.6rem;
  background: rgba(5, 5, 16, 0.4);
}

.experience {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.stage {
  background: rgba(6, 6, 18, 0.6);
  border-radius: 32px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stage h2 {
  font-size: 2rem;
}

.timeline-track {
  position: relative;
  padding: 2rem 1rem 1rem;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 60px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--timeline-line);
}

.timeline-progress {
  position: absolute;
  top: 60px;
  left: 5%;
  height: 2px;
  background: linear-gradient(90deg, var(--active-accent), var(--rose));
  width: 0;
  transition: width 0.6s ease;
}

.month-nodes {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  position: relative;
  z-index: 2;
}

.month-node {
  border-radius: 20px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
  position: relative;
  overflow: hidden;
  animation: float 10s ease-in-out infinite;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.month-node .month-name {
  font-size: 1.1rem;
  font-weight: 500;
}

.month-node .month-mood {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.7);
}

.month-node::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.month-node:hover,
.month-node:focus-visible {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 35px rgba(255, 111, 174, 0.25);
}

.month-node:hover::after,
.month-node:focus-visible::after {
  opacity: 1;
}

.month-node.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--active-accent);
  box-shadow: 0 15px 40px rgba(246, 210, 139, 0.25);
}

.month-panel {
  background: linear-gradient(160deg, rgba(5, 5, 16, 0.85), var(--panel-tint));
  border-radius: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  backdrop-filter: blur(25px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.month-status h3 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.3;
}

.animated-divider {
  margin: 1.5rem 0 2rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--active-accent), transparent);
  background-size: 200% 100%;
  animation: shimmerLine 6s linear infinite;
}

.month-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.month-block {
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  min-height: 140px;
  transition: transform 0.4s ease, background 0.4s ease;
}

.month-block h4 {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  margin-bottom: 0.6rem;
  color: rgba(255, 255, 255, 0.7);
}

.month-block:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.05);
}

.final {
  max-width: 900px;
  margin: 0 auto 6rem;
  padding: 4rem 1.5rem;
  text-align: center;
  border-radius: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(160deg, rgba(5, 5, 16, 0.75), rgba(10, 7, 30, 0.95));
  position: relative;
  overflow: hidden;
  opacity: 0;
}

.final h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.final p {
  font-size: 1.05rem;
}

.final-sparkles::before,
.final-sparkles::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 45%);
  opacity: 0;
  animation: sparkleRain 10s linear infinite;
}

.final-sparkles::after {
  animation-delay: 3s;
}

.final.show {
  opacity: 1;
  transition: opacity 1.5s ease;
}

.final.show .final-sparkles::before,
.final.show .final-sparkles::after {
  opacity: 1;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(246, 210, 139, 0.8));
  border-radius: 999px;
  animation: drop 4s linear infinite;
}

/* Motion helpers */
@keyframes gradientFlow {
  from {
    transform: translate3d(-10px, -10px, 0);
  }
  to {
    transform: translate3d(10px, 10px, 0);
  }
}

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

@keyframes shimmer {
  0% {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
  }
  50% {
    box-shadow: 0 0 80px rgba(255, 255, 255, 0.12);
  }
  100% {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
  }
}

@keyframes shimmerLine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes sparkleRain {
  0% {
    transform: translateY(-10%);
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(10%);
    opacity: 0.3;
  }
}

@keyframes drop {
  0% {
    transform: translateY(-20vh) scaleX(0.5);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) scaleX(1);
    opacity: 0;
  }
}

/* Responsive tweaks */
@media (min-width: 992px) {
  .experience {
    grid-template-columns: 0.95fr 1.05fr;
    align-items: start;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding-top: 4.5rem;
    padding-bottom: 3rem;
    place-items: start;
  }

  .hero-content {
    text-align: left;
    align-items: flex-start;
    gap: 1.2rem;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .experience {
    padding: 3rem 1rem 4rem;
  }

  .stage {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .month-panel {
    padding: 1.75rem;
  }

  .timeline-track {
    padding: 1.5rem 0 0.5rem;
  }

  .timeline-track::before,
  .timeline-progress {
    display: none;
  }

  .month-nodes {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0 1.25rem 1rem;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1.25rem;
    scroll-padding-right: 1.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .month-nodes::-webkit-scrollbar {
    display: none;
  }

  .month-node {
    flex: 0 0 220px;
    min-width: 220px;
    scroll-snap-align: start;
  }

  .month-blocks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 599px) {
  .hero-content {
    padding: 1.6rem;
  }

  .month-panel {
    padding: 1.5rem;
  }

  .stage {
    padding: 1.35rem 0 1.5rem;
    margin-left: -1rem;
    margin-right: -1rem;
  }

  .month-nodes {
    padding: 0 1rem 1rem;
    scroll-padding-left: 1rem;
    scroll-padding-right: 1rem;
  }

  .month-node {
    flex: 0 0 200px;
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .stage {
    padding: 1.25rem 0.9rem 1.5rem;
    margin: 0;
    border-radius: 28px;
  }

  .stage-header,
  .timeline-track {
    padding-left: 0;
    padding-right: 0;
  }

  .timeline-track {
    padding-top: 1.2rem;
  }

  .month-nodes {
    padding: 0 0.5rem 0.8rem;
    scroll-padding-left: 0.5rem;
    scroll-padding-right: 0.5rem;
  }

  .month-node {
    flex: 0 0 min(240px, 78vw);
    min-width: min(240px, 78vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor-glow {
    display: none;
  }
}
