/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Deep dark palette */
  --bg-primary: #0a0a12;
  --bg-secondary: #0e0e1a;

  /* Pastel accents */
  --pastel-lavender: #c4b5fd;
  --pastel-rose: #fda4af;
  --pastel-sky: #7dd3fc;
  --pastel-mint: #86efac;
  --pastel-peach: #fdba74;
  --pastel-lilac: #d8b4fe;

  /* Text */
  --text-primary: #e8e6f0;
  --text-muted: rgba(232, 230, 240, 0.45);
  --text-dim: rgba(232, 230, 240, 0.15);

  /* Gradients */
  --gradient-superlative: linear-gradient(135deg, var(--pastel-sky), var(--pastel-lavender));
  --gradient-adjective: linear-gradient(135deg, var(--pastel-rose), var(--pastel-peach), var(--pastel-lilac));

  /* Timing */
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ========================================
   BACKGROUND EFFECTS
   ======================================== */

/* Subtle grid overlay */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Floating gradient orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--pastel-lavender), transparent 70%);
  top: -10%;
  left: -5%;
  animation: float-1 25s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--pastel-rose), transparent 70%);
  bottom: -15%;
  right: -5%;
  animation: float-2 30s ease-in-out infinite;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--pastel-sky), transparent 70%);
  top: 50%;
  right: 20%;
  animation: float-3 20s ease-in-out infinite;
}

.orb-4 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--pastel-mint), transparent 70%);
  bottom: 20%;
  left: 15%;
  animation: float-4 22s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 30px) scale(0.95); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -40px) scale(1.05); }
  66% { transform: translate(50px, -70px) scale(0.9); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, 50px) scale(1.15); }
}

@keyframes float-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(60px, -40px) scale(1.1); }
  80% { transform: translate(-30px, 20px) scale(0.95); }
}

/* ========================================
   MAIN LAYOUT
   ======================================== */

.container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.phrase-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.phrase {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--text-muted);
}

.phrase-second {
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
}

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

.punctuation {
  color: var(--text-dim);
  font-weight: 300;
}

/* ========================================
   DYNAMIC WORDS
   ======================================== */

.dynamic-word {
  display: inline-block;
  font-weight: 600;
  position: relative;
  background: var(--gradient-superlative);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.1s;
}

.dynamic-word--emphasis {
  font-weight: 700;
  font-size: 1.15em;
  background: var(--gradient-adjective);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: brightness(1.1);
}

/* ---- Animation Classes ---- */

/* Fade up */
.anim-fade-up-enter {
  animation: fadeUpIn 0.6s var(--transition-smooth) forwards;
}
.anim-fade-up-exit {
  animation: fadeUpOut 0.4s var(--transition-smooth) forwards;
}

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes fadeUpOut {
  from { opacity: 1; transform: translateY(0); filter: blur(0); }
  to   { opacity: 0; transform: translateY(-20px); filter: blur(4px); }
}

/* Scale pop */
.anim-scale-pop-enter {
  animation: scalePopIn 0.5s var(--transition-smooth) forwards;
}
.anim-scale-pop-exit {
  animation: scalePopOut 0.35s var(--transition-smooth) forwards;
}

@keyframes scalePopIn {
  from { opacity: 0; transform: scale(0.6); filter: blur(6px); }
  60%  { transform: scale(1.08); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes scalePopOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.7); filter: blur(4px); }
}

/* Slide right */
.anim-slide-right-enter {
  animation: slideRightIn 0.5s var(--transition-smooth) forwards;
}
.anim-slide-right-exit {
  animation: slideRightOut 0.4s var(--transition-smooth) forwards;
}

@keyframes slideRightIn {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideRightOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* Blur reveal */
.anim-blur-reveal-enter {
  animation: blurRevealIn 0.6s var(--transition-smooth) forwards;
}
.anim-blur-reveal-exit {
  animation: blurRevealOut 0.35s var(--transition-smooth) forwards;
}

@keyframes blurRevealIn {
  from { opacity: 0; filter: blur(16px); transform: scale(1.1); }
  to   { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes blurRevealOut {
  from { opacity: 1; filter: blur(0); }
  to   { opacity: 0; filter: blur(16px); transform: scale(0.95); }
}

/* Typewriter-ish */
.anim-typewriter-enter {
  animation: typewriterIn 0.5s steps(12, end) forwards;
}
.anim-typewriter-exit {
  animation: typewriterOut 0.3s var(--transition-smooth) forwards;
}

@keyframes typewriterIn {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to   { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes typewriterOut {
  from { opacity: 1; clip-path: inset(0 0 0 0); }
  to   { opacity: 0; clip-path: inset(0 0 0 100%); }
}

/* Flip */
.anim-flip-enter {
  animation: flipIn 0.6s var(--transition-smooth) forwards;
  transform-origin: center bottom;
}
.anim-flip-exit {
  animation: flipOut 0.4s var(--transition-smooth) forwards;
  transform-origin: center top;
}

@keyframes flipIn {
  from { opacity: 0; transform: rotateX(-80deg); }
  to   { opacity: 1; transform: rotateX(0); }
}
@keyframes flipOut {
  from { opacity: 1; transform: rotateX(0); }
  to   { opacity: 0; transform: rotateX(80deg); }
}

/* Glitch */
.anim-glitch-enter {
  animation: glitchIn 0.5s steps(4, end) forwards;
}
.anim-glitch-exit {
  animation: glitchOut 0.3s var(--transition-smooth) forwards;
}

@keyframes glitchIn {
  0%   { opacity: 0; transform: translate(-4px, 2px) skewX(-5deg); filter: hue-rotate(90deg); }
  25%  { opacity: 0.7; transform: translate(3px, -1px) skewX(3deg); filter: hue-rotate(45deg); }
  50%  { opacity: 0.9; transform: translate(-2px, 1px) skewX(-2deg); filter: hue-rotate(0); }
  75%  { opacity: 1; transform: translate(1px, 0) skewX(1deg); }
  100% { opacity: 1; transform: translate(0, 0) skewX(0); filter: hue-rotate(0); }
}
@keyframes glitchOut {
  from { opacity: 1; transform: translate(0); }
  50%  { opacity: 0.5; transform: translate(3px, -2px) skewX(4deg); filter: hue-rotate(60deg); }
  to   { opacity: 0; transform: translate(-5px, 3px) skewX(-6deg); }
}

/* Drop bounce */
.anim-drop-enter {
  animation: dropIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.anim-drop-exit {
  animation: dropOut 0.35s var(--transition-smooth) forwards;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-50px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dropOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(30px) scale(0.9); }
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress-bar {
  width: 200px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pastel-lavender), var(--pastel-rose));
  border-radius: 2px;
  transition: none;
}

.progress-bar__fill--animate {
  transition: width 5s linear;
  width: 100%;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.footer__tagline {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--pastel-sky), var(--pastel-lavender), var(--pastel-rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.4s var(--transition-smooth), filter 0.4s var(--transition-smooth);
}

.footer__tagline--exit {
  opacity: 0;
  filter: blur(4px);
}

.footer__tagline--enter {
  animation: taglineFadeIn 0.6s var(--transition-smooth) forwards;
}

@keyframes taglineFadeIn {
  from { opacity: 0; filter: blur(4px); }
  to   { opacity: 1; filter: blur(0); }
}

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

@media (max-width: 640px) {
  .container {
    padding: 1.5rem;
  }

  .orb {
    filter: blur(80px);
    opacity: 0.18;
  }

  .orb-1 { width: 300px; height: 300px; }
  .orb-2 { width: 250px; height: 250px; }
  .orb-3 { width: 200px; height: 200px; }
  .orb-4 { width: 180px; height: 180px; }

  .progress-bar {
    width: 120px;
  }
}
