/* ========================================
   conc.quest - Design Language Stylesheet
   ======================================== */

/* CSS Custom Properties - Color Palette */
:root {
  --bubblegum: #FF6B9D;
  --lavender-pop: #C084FC;
  --cyan-fizz: #67E8F9;
  --lemon-drop: #FDE047;
  --tangerine: #FB923C;
  --cream-cloud: #FFF8F0;
  --soft-peach: #FEE2E2;
  --plum-deep: #4A1D5E;
  --dusty-grape: #7C6D8E;

  /* Typography */
  --font-display: "Baloo 2", sans-serif;
  --font-body: "Nunito", sans-serif;
  --font-accent: "Fredoka", sans-serif;

  /* Blob border-radius values */
  --blob-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;

  /* Spacing */
  --spacing-lg: clamp(2rem, 5vw, 4rem);
}

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

/* ===========================
   Base Styles
   =========================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream-cloud);
  color: var(--plum-deep);
  overflow-x: hidden;
  position: relative;
}

/* Paper-grain texture overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' seed='2' /%3E%3CfeColorMatrix type='saturate' values='0.3'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* ===========================
   Quest Path SVG (Fixed)
   =========================== */

#quest-path {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#quest-trail {
  stroke: url(#pathGradient);
  stroke-dasharray: 20 12;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear;
}

/* ===========================
   Floating Decorations
   =========================== */

.floating-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Floating stars */
.floating-star {
  position: absolute;
  width: var(--size, 24px);
  height: var(--size, 24px);
  pointer-events: none;
}

.floating-star::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--color, var(--bubblegum));
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  stroke: var(--plum-deep);
  animation: floatRotate var(--rot-dur, 25s) linear infinite,
    floatDrift var(--drift-dur, 12s) ease-in-out infinite,
    floatOpacity 6s ease-in-out infinite;
}

/* Floating dots */
.floating-dot {
  position: absolute;
  width: var(--size, 12px);
  height: var(--size, 12px);
  border-radius: 50%;
  background-color: var(--color, var(--cyan-fizz));
  pointer-events: none;
  animation: floatDrift var(--drift-dur, 12s) ease-in-out infinite,
    floatOpacity 6s ease-in-out infinite;
}

/* Floating wobble circles */
.floating-wobble {
  position: absolute;
  width: var(--size, 50px);
  height: var(--size, 50px);
  border-radius: var(--blob-radius);
  background-color: var(--color, var(--lavender-pop));
  pointer-events: none;
  animation: floatRotate var(--rot-dur, 30s) linear infinite,
    floatDrift var(--drift-dur, 13s) ease-in-out infinite,
    floatOpacity 7s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes floatRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes floatDrift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(var(--drift-range, 15px));
  }
}

@keyframes floatOpacity {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

/* ===========================
   Quest Sections & Layout
   =========================== */

.quest-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  overflow: hidden;
  z-index: 2;
}

.interstitial {
  min-height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

/* ===========================
   Hero Section
   =========================== */

.hero-section {
  min-height: 100vh;
  flex-direction: column;
  gap: 2rem;
}

.hero-content {
  text-align: center;
  z-index: 10;
  position: relative;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--plum-deep);
  word-break: break-word;
  display: inline-block;
  max-width: 90vw;
}

.letter-o {
  position: relative;
  display: inline-block;
  margin: 0 0.05em;
}

.ring-letter {
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
}

.ring-inner,
.ring-mid,
.ring-outer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0.15em solid;
}

.ring-inner {
  width: 0.3em;
  height: 0.3em;
  border-color: var(--bubblegum);
  animation: ringPulse 4s ease-in-out infinite;
}

.ring-mid {
  width: 0.55em;
  height: 0.55em;
  border-color: var(--lavender-pop);
  animation: ringPulse 4s ease-in-out infinite 150ms;
}

.ring-outer {
  width: 0.8em;
  height: 0.8em;
  border-color: var(--cyan-fizz);
  animation: ringPulse 4s ease-in-out infinite 300ms;
}

.letter-o:hover .ring-inner,
.letter-o:hover .ring-mid,
.letter-o:hover .ring-outer {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ringPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--dusty-grape);
  margin-top: 1rem;
  font-weight: 400;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.bounce-arrow svg {
  animation: bounceArrow 2s ease-in-out infinite;
}

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

/* ===========================
   Ring Sets (Decorations)
   =========================== */

.ring-set {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 800px;
  max-height: 800px;
  pointer-events: none;
  z-index: 0;
}

.ring-set-hero {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vw;
  max-width: 100vh;
  max-height: 100vh;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid;
  opacity: 0.15;
}

.ring-1 {
  width: 20%;
  height: 20%;
  border-color: var(--bubblegum);
  --ring-color: var(--bubblegum);
  animation: ringOrbit 8s linear infinite;
}

.ring-2 {
  width: 40%;
  height: 40%;
  border-color: var(--lavender-pop);
  --ring-color: var(--lavender-pop);
  animation: ringOrbit 12s linear infinite reverse;
}

.ring-3 {
  width: 60%;
  height: 60%;
  border-color: var(--cyan-fizz);
  --ring-color: var(--cyan-fizz);
  animation: ringOrbit 16s linear infinite;
}

.ring-4 {
  width: 80%;
  height: 80%;
  border-color: var(--lemon-drop);
  --ring-color: var(--lemon-drop);
  animation: ringOrbit 20s linear infinite reverse;
}

.ring-5 {
  width: 100%;
  height: 100%;
  border-color: var(--tangerine);
  --ring-color: var(--tangerine);
  animation: ringOrbit 24s linear infinite;
}

@keyframes ringOrbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.ring-set-bg .ring {
  opacity: 0.08;
}

/* ===========================
   Quest Nodes & Blob Containers
   =========================== */

.quest-node {
  position: relative;
  z-index: 5;
  opacity: 0;
  transform: scale(0);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.quest-node[data-animate="bounce"] {
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceEnter {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  70% {
    opacity: 1;
    transform: scale(1.15);
  }
  85% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.blob-container {
  padding: clamp(2rem, 4vw, 3rem);
  border-radius: var(--blob-radius);
  background-color: var(--soft-peach);
  max-width: 90%;
  width: 100%;
  max-width: 600px;
  box-shadow: 8px 8px 0px var(--lavender-pop);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  left: 0;
}

.blob-left {
  margin-left: clamp(-5vw, -8%, 0);
}

.blob-right {
  margin-right: clamp(-5vw, -8%, 0);
  margin-left: auto;
}

.blob-container:hover {
  transform: rotate(-2deg) scale(1.03);
  box-shadow: 4px 12px 0px var(--lavender-pop);
}

.blob-container.blob-right:hover {
  transform: rotate(2deg) scale(1.03);
  box-shadow: -4px 12px 0px var(--lavender-pop);
}

/* Alternate shadow colors */
.blob-container:nth-child(2) {
  box-shadow: 8px 8px 0px var(--cyan-fizz);
}

.blob-container:nth-child(2):hover {
  box-shadow: 4px 12px 0px var(--cyan-fizz);
}

.blob-container:nth-child(3) {
  box-shadow: 8px 8px 0px var(--lemon-drop);
}

.blob-container:nth-child(3):hover {
  box-shadow: 4px 12px 0px var(--lemon-drop);
}

.blob-container:nth-child(4) {
  box-shadow: 8px 8px 0px var(--tangerine);
}

.blob-container:nth-child(4):hover {
  box-shadow: 4px 12px 0px var(--tangerine);
}

/* ===========================
   Typography within Nodes
   =========================== */

.quest-label {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dusty-grape);
  margin-bottom: 0.5rem;
}

.blob-container h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--plum-deep);
  margin-bottom: 1rem;
}

.blob-container p {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--plum-deep);
}

/* ===========================
   Quest Markers
   =========================== */

.quest-marker {
  margin-top: 1.5rem;
  display: inline-block;
}

/* ===========================
   Interstitial Elements
   =========================== */

.spinning-shape {
  animation: spinContinuous 8s linear infinite;
  cursor: pointer;
  opacity: 0;
  transform: scale(0);
}

.spinning-shape[data-animate="bounce"] {
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    spinContinuous 8s linear infinite 600ms;
}

.spinning-slow {
  animation-duration: 12s !important;
}

@keyframes spinContinuous {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.color-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bubblegum), var(--lavender-pop));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(255, 107, 157, 0.3);
  animation: orbFloat 3s ease-in-out infinite;
  opacity: 0;
  transform: scale(0);
}

.color-orb[data-animate="bounce"] {
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    orbFloat 3s ease-in-out infinite 600ms;
}

.orb-inner {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background-color: var(--cyan-fizz);
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.interstitial-word {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--bubblegum);
  letter-spacing: 0.05em;
  text-transform: lowercase;
  opacity: 0;
  transform: scale(0);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bouncing-word {
  opacity: 0;
  transform: scale(0);
}

.bouncing-word[data-animate="bounce"] {
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bouncing-word span {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--lavender-pop);
  display: block;
  animation: bounceVertical 2s ease-in-out infinite;
}

@keyframes bounceVertical {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* ===========================
   Closing Section
   =========================== */

.closing-section {
  position: relative;
  min-height: 100vh;
}

.closing-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  height: 90vw;
  max-width: 800px;
  max-height: 800px;
  z-index: 0;
}

.closing-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid;
  opacity: 0.2;
}

.closing-ring-1 {
  width: 90%;
  height: 90%;
  border-color: var(--bubblegum);
  animation: ringOrbit 6s linear infinite;
}

.closing-ring-2 {
  width: 70%;
  height: 70%;
  border-color: var(--lavender-pop);
  animation: ringOrbit 8s linear infinite reverse;
}

.closing-ring-3 {
  width: 50%;
  height: 50%;
  border-color: var(--cyan-fizz);
  animation: ringOrbit 10s linear infinite;
}

.closing-ring-4 {
  width: 30%;
  height: 30%;
  border-color: var(--lemon-drop);
  animation: ringOrbit 12s linear infinite reverse;
}

.closing-ring-5 {
  width: 10%;
  height: 10%;
  border-color: var(--tangerine);
  animation: ringOrbit 14s linear infinite;
}

.closing-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.closing-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--plum-deep);
  opacity: 0;
  transform: scale(0);
}

.closing-text-1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.closing-text-2 {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  color: var(--bubblegum);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards 150ms;
}

.closing-text-3 {
  font-size: clamp(1rem, 3vw, 2rem);
  color: var(--lavender-pop);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards 300ms;
}

.closing-text-4 {
  font-size: clamp(0.875rem, 2.5vw, 1.5rem);
  color: var(--cyan-fizz);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards 450ms;
}

.closing-text-5 {
  font-size: clamp(0.75rem, 2vw, 1.25rem);
  color: var(--lemon-drop);
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards 600ms;
}

.closing-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--tangerine);
  margin-top: 1rem;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--tangerine);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(251, 146, 60, 0);
  }
}

/* ===========================
   Responsive Behavior
   =========================== */

@media (max-width: 768px) {
  .quest-section {
    min-height: auto;
    padding: var(--spacing-lg);
  }

  .blob-container {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .ring-set {
    opacity: 0.03;
    width: 80vw;
    height: 80vw;
  }

  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
  }
}

/* ===========================
   Focus and Interaction States
   =========================== */

.blob-container:focus-within {
  outline: 3px solid var(--bubblegum);
  outline-offset: 4px;
}

/* Intersection Observer - adds animation trigger class */
.quest-node.in-view {
  animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.quest-node.focused {
  transform: scale(1.02);
}
