/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
  z-index: 1;
}

/* Sections that scroll over hero */
.intro,
.scroll-container,
.final-cta,
.footer {
  position: relative;
  z-index: 10;
}

.intro {
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15);
}

/* Hero Brand - measy logo */
.hero-brand {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: var(--space-sm);
  transform: translateY(-95%) scale(calc(1.4 * var(--scale)));
}

.hero-logo {
  font-family: var(--font-logo);
  font-size: var(--text-hero);
  color: var(--color-white);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.hero-logo span {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px);
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: translateY(20px);
}

/* Hero Split Content - 50/50 */
.hero-split {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--size-container);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  padding: 0 var(--space-lg);
  transform: translateY(-20%);
}

.hero-split-left,
.hero-split-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-split-left {
  justify-content: flex-end;
}

.hero-split-right {
  justify-content: flex-start;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 500;
  line-height: 1.1;
  color: var(--color-white);
  letter-spacing: -0.02em;
  text-align: left;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .word {
  display: inline-block;
  transform: translateY(120%);
}

@media (max-width: 968px) {
  .hero-split {
    flex-direction: column;
    gap: 2rem;
  }
  .hero-split-left,
  .hero-split-right {
    justify-content: center;
  }
  .hero-title {
    text-align: center;
  }
}

/* Hero decorative elements */
.hero-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-doodle {
  position: absolute;
  opacity: 0;
}

.hero-doodle-1 {
  top: 15%;
  left: 8%;
  font-size: 3rem;
}

.hero-doodle-2 {
  top: 25%;
  right: 10%;
  font-size: 2.5rem;
}

.hero-doodle-3 {
  bottom: 20%;
  left: 15%;
  font-size: 2rem;
}

.hero-doodle-4 {
  bottom: 25%;
  right: 12%;
  font-size: 2.5rem;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
}

.scroll-mouse {
  width: 26px;
  height: 40px;
  border: 2px solid currentColor;
  border-radius: 13px;
  position: relative;
}

.scroll-dot {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: currentColor;
  border-radius: 2px;
  animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

.scroll-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* Rive Animation - Fixed position element */
.hero-rive {
  position: fixed;
  top: 72%;
  left: 28%;
  transform: translate(-50%, -50%);
  z-index: 999;
  pointer-events: none;
  opacity: 1;
  will-change: top, left, opacity;
}

.hero-rive canvas {
  width: var(--size-rive-hero);
  height: var(--size-rive-hero);
}

/* Placeholder in hero split to maintain layout */
.hero-rive-placeholder {
  width: calc(var(--size-rive-hero) * 0.6);
  height: calc(var(--size-rive-hero) * 0.6);
}

@media (max-width: 968px) {
  .hero-rive {
    left: 50%;
    top: 65%;
    transform: translate(-50%, -50%);
  }

  .hero-rive canvas {
    width: clamp(280px, 60vw, 450px);
    height: clamp(280px, 60vw, 450px);
  }
}

@media (max-width: 480px) {
  .hero-rive {
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .hero-rive canvas {
    width: clamp(220px, 70vw, 320px);
    height: clamp(220px, 70vw, 320px);
  }
}

/* ===== Main Scroll Container ===== */
.scroll-container {
  position: relative;
  background: var(--color-bg-cream);
}

/* ===== Continuous Doodle Line ===== */
.doodle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.doodle-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.doodle-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 280;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doodle-line-bg {
  display: none;
}

/* ===== Intro Section ===== */
.intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--space-2xl) var(--space-md);
  position: relative;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-bg-cream) 50%);
}

.intro-content {
  max-width: min(700px, 90vw);
  margin-left: auto;
  margin-right: 10%;
  position: relative;
  z-index: 10;
  text-align: right;
}

.intro-text {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

.intro-text .brand-color {
  color: var(--color-primary);
  font-size: 200%;
}

.intro-text .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
}

/* ===== Scroll Sections ===== */
.scroll-section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--color-bg-cream);
}

.scroll-section .container {
  width: 100%;
  max-width: var(--size-container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  position: relative;
  z-index: 10;
}

.card-left .container {
  flex-direction: row;
}

.card-right .container {
  flex-direction: row-reverse;
}

@media (max-width: 968px) {
  .scroll-section .container {
    flex-direction: column !important;
    text-align: center;
    gap: var(--space-lg);
  }
  .content-card {
    max-width: 100%;
  }
  .visual-side {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .scroll-section {
    padding: var(--space-lg) var(--space-sm);
  }
  .scroll-section .container {
    gap: var(--space-md);
  }
  .intro-content {
    margin-right: auto;
    padding: 0 var(--space-sm);
  }
  .intro-text .brand-color {
    font-size: 150%;
  }
}

/* Visual side with icons */
.visual-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 400px;
}

.visual-icon {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: scale(0.5) rotate(-10deg);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
}

.visual-icon img {
  width: clamp(280px, 40vw, 500px);
  height: auto;
  object-fit: contain;
  border-radius: 20px;
}

/* Section Rive animations */
.section-rive {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* Override visual-icon transform to prevent canvas pixelation */
  transform: none !important;
  opacity: 1 !important;
}

.section-rive canvas {
  width: var(--size-rive-section);
  height: var(--size-rive-section);
}

/* Flip composer animation horizontally */
#composer-rive-canvas {
  transform: rotateY(180deg);
}

/* Position climber animation on the left edge */
.card-right .visual-side {
  justify-content: flex-start;
  padding-left: 0;
  margin-left: -160px;
  transform: translateX(30%);
}

/* Decorative elements around icons */
.visual-decoration {
  position: absolute;
  opacity: 0;
}

.visual-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
}

.visual-ring {
  width: 80px;
  height: 80px;
  border: 3px dashed var(--color-primary);
  border-radius: 50%;
  opacity: 0.3;
}

.visual-line {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 3px;
  opacity: 0.5;
}

/* ===== Path Node Points ===== */
.path-node {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  z-index: 5;
  opacity: 0;
  transform: scale(0);
}

.path-node::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  opacity: 0.3;
}

/* ===== Final CTA Section ===== */
.final-cta {
  min-height: 100vh;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

.final-cta-title {
  font-family: var(--font-heading);
  font-size: var(--text-6xl);
  font-weight: 500;
  line-height: 0.95;
  color: var(--color-white);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
  max-width: min(1200px, 95vw);
}

.final-cta-title .line {
  display: block;
  overflow: hidden;
}

.final-cta-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
}

.final-cta-text {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.85);
  max-width: min(700px, 90vw);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(30px);
}

.final-cta .btn {
  opacity: 0;
  transform: translateY(30px);
}

/* Doodle decorations in CTA */
.cta-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cta-doodle {
  position: absolute;
  opacity: 0.15;
  font-size: 4rem;
}

/* ===== Compact Section (closer spacing) ===== */
.section-compact {
  min-height: 80vh;
  padding-top: 40px;
  padding-bottom: 40px;
}

/* ===== Section with Knot (composer + trumpeters) ===== */
.section-knot {
  min-height: 90vh;
}

.section-knot .visual-side {
  margin-left: 0;
}

/* Visual group for multiple characters */
.visual-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-height: 500px;
}

/* Move composer and trumpeters 15% left */
.section-knot .visual-side.visual-group {
  transform: translateX(-15%) !important;
}

/* Composer position */
.composer-position {
  position: relative;
  z-index: 3;
}

.composer-position canvas {
  width: calc(var(--size-rive-section) * 0.85);
  height: calc(var(--size-rive-section) * 0.85);
}

/* Trumpeter positions - grouped near composer */
.trumpeter1-position {
  position: absolute;
  top: clamp(-30px, -5vw, -50px);
  right: clamp(20px, 5vw, 50px);
  z-index: 4;
}

.trumpeter1-position canvas {
  width: calc(var(--size-rive-section) * 0.47);
  height: calc(var(--size-rive-section) * 0.47);
}

.trumpeter2-position {
  position: absolute;
  bottom: clamp(-20px, -3vw, -30px);
  right: clamp(40px, 8vw, 80px);
  z-index: 2;
}

.trumpeter2-position canvas {
  width: calc(var(--size-rive-section) * 0.43);
  height: calc(var(--size-rive-section) * 0.43);
}

/* ===== Path Characters (standalone on path) ===== */
.path-character {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  z-index: 10;
}

/* Gamer inside the knot */
.knot-character {
  padding: var(--space-md);
  margin-top: clamp(-60px, -8vw, -100px);
}

.knot-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-lg);
  max-width: var(--size-container);
  margin: 0 auto;
  padding: 0 5%;
  transform: translate(-40%, 80%);
}

.gamer-position {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  margin-left: -5%;
}

.gamer-position canvas {
  width: calc(var(--size-rive-section) * 0.75);
  height: calc(var(--size-rive-section) * 0.75);
}

.knot-card {
  max-width: min(400px, 90vw);
  position: relative;
  z-index: 100;
  opacity: 1 !important;
  transform: none !important;
  background: var(--color-white);
  border-radius: clamp(16px, 3vw, 24px);
  padding: var(--size-card-padding);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Scientist after the knot */
.scientist-area {
  padding: var(--space-xl) var(--space-md);
  justify-content: flex-end;
  padding-right: 15%;
}

.scientist-position canvas {
  width: calc(var(--size-rive-section) * 0.75);
  height: calc(var(--size-rive-section) * 0.75);
}

/* ===== Final Characters Row ===== */
.final-characters {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  padding: var(--space-xl) 5%;
  gap: 0;
  position: relative;
  z-index: 10;
  margin-bottom: var(--space-lg);
  margin-left: 0;
}

/* Cloud background layers for final characters */
.cloud-layer {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.cloud-layer-1 {
  bottom: -20px;
  height: clamp(200px, 35vw, 456px);
  z-index: 1;
  opacity: 1;
}

.final-char {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: var(--size-rive-final);
  position: relative;
  z-index: 5;
  margin-left: -15%;
}

.final-char:first-of-type {
  margin-left: 0;
}

.final-char canvas {
  width: var(--size-rive-final);
  height: var(--size-rive-final);
}

.basketball-position {
  transform: translateY(-20px);
}

.unicycle-position {
  transform: translateY(10px);
}

.binoculars-position {
  transform: translateY(-10px);
}

/* Soccer section adjustments */
.scroll-section[data-section="5"] .visual-side {
  margin-left: 0;
  justify-content: center;
}

/* ===== Responsive adjustments for path characters ===== */
@media (max-width: 968px) {
  .visual-group {
    flex-direction: column;
    align-items: center;
  }

  .trumpeter1-position,
  .trumpeter2-position {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
  }

  .final-characters {
    flex-direction: column;
    align-items: center;
  }

  .final-char {
    max-width: var(--size-rive-final);
    margin-left: 0;
  }

  .final-char canvas {
    width: var(--size-rive-final);
    height: var(--size-rive-final);
  }

  .scientist-area {
    justify-content: center;
    padding-right: var(--space-md);
  }

  .knot-content {
    flex-direction: column;
    transform: translate(0, 20%);
    text-align: center;
  }

  .gamer-position {
    margin-left: 0;
  }

  .intro-content {
    margin-right: auto;
    text-align: center;
  }

  .card-right .visual-side {
    margin-left: 0;
    transform: none;
    justify-content: center;
  }

  .section-knot .visual-side.visual-group {
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .knot-content {
    transform: translate(0, 10%);
    padding: 0 var(--space-sm);
  }

  .knot-card {
    padding: var(--space-md);
  }
}

/* ===== Footer ===== */
.footer {
  background: var(--color-text);
  color: var(--color-white);
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
}

.footer-container {
  max-width: var(--size-container);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand {
  font-family: var(--font-logo);
  font-size: var(--text-3xl);
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.footer-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-sm);
}

.footer-desc {
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  font-size: var(--text-sm);
  max-width: min(300px, 100%);
}

.footer-title {
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
  color: rgba(255, 255, 255, 0.5);
}

.footer-links {
  list-style: none;
}

.footer-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xs) 0;
  font-size: var(--text-sm);
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: var(--color-white);
  transform: translateX(4px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--text-xs);
}

.footer-legal {
  display: flex;
  gap: var(--space-lg);
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-xs);
  transition: color 0.3s ease;
}

.footer-legal a:hover {
  color: var(--color-white);
}
