﻿/* --- 1. FONTS & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Inclusive+Sans&family=Raleway:wght@400;700&family=Rubik+Glitch&family=Sigmar&display=swap');

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

/* --- 2. GLOBAL BODY & BACKGROUND --- */
body {
  background-color: var(--brand-colors-bg-color, #a68195); 
  font-family: var(--fonts-font-family-headers, 'Inclusive Sans', sans-serif);
  color: var(--brand-colors-text-color-secondary, #59202b);
  overflow-x: hidden; 
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* --- 3. TYPOGRAPHY (Headers vs Paragraphs) --- */
h1, h2, h3 {
  font-family: var(--fonts-font-family-body, 'Sigmar', cursive); 
  color: var(--brand-colors-text-color-secondary, #59202b);
  text-transform: uppercase;
  line-height: 1.1;
}

h1 {
  font-size: var(--font-size-font-size-xxxl, 64px);
  margin-bottom: 24px;
}

h2 {
  font-size: var(--font-size-font-size-xl, 48px);
  margin-bottom: 32px;
}

p {
  font-family: var(--fonts-font-family-headers, 'Inclusive Sans', sans-serif);
  font-size: var(--font-size-font-size-m, 20px);
  line-height: 1.6;
  margin-bottom: 20px;
}

.theme-controls {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  padding: 12px 18px;
  border: 2px solid var(--brand-colors-text-color-secondary, #59202b);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--brand-colors-text-color-secondary, #59202b);
  font-family: var(--fonts-font-family-headers, 'Inclusive Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.24);
}

.theme-toggle--system {
  width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle--system svg {
  width: 20px;
  height: 20px;
  display: block;
}

.theme-toggle.is-active {
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08);
}

/* --- 4. SECTION RHYTHM & LAYOUT --- */
.section {
  min-height: 100vh;
  padding: 80px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.section__content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 10; 
}

/* --- 5. COMPONENT STYLES --- */
/* --- PAPER NOTES (VARIABLES SECTION) --- */
.paper-note {
  position: relative; 
  width: 90%;
  max-width: 800px; 
  margin-bottom: 60px;
  
  /* UPDATED: We are specifically giving the TOP more space (80px) 
     The order is: Top (80px), Right (70px), Bottom (50px), Left (70px) */
  padding: 80px 70px 50px 70px;
  
  display: flex;
  align-items: center;
}

.paper-note--right {
  margin-left: auto; 
  margin-top: 80px; /* NEW: Pushes the first note far down from the title! */
}

.paper-note--left {
  margin-right: auto; 
  margin-top: 40px; /* NEW: Adds breathing room between the two notes */
}

.paper-note--center {
  margin-left: auto;
  margin-right: auto;
  margin-top: 40px;
}

.paper-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill; /* Forces your PNG to stretch exactly to the size of the text box */
  z-index: 0;
  filter: drop-shadow(5px 15px 15px rgba(0,0,0,0.15)); /* Adds a realistic floating shadow under the paper */
}

.paper-text {
  position: relative;
  z-index: 1; /* Pops the text up on top of the image */
  color: #59202b;
}

.blue-blob {
  background-color: var(--brand-colors-accent-lightblue, #6bb3f2);
  color: var(--neutrals-nuetral-00, #ffffff);
  padding: 40px;
  max-width: 400px;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; 
  box-shadow: 3px 5px 10px rgba(0,0,0,0.1);
  margin: 20px 0;
}

/* --- GLOBAL BACKGROUND WALLS --- */
.background-walls {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; 
  pointer-events: none; 
  opacity: 0; 
  overflow: hidden;
}

.wall {
  position: absolute; 
  height: 120vh; 
  top: -10vh;
  object-fit: cover; 
}

.wall--left {
  left: 0;
  width: 25vw; 
}

.wall--right {
  right: 0;
  width: 25vw;
}

.wall--whole {
  left: 0;
  width: 100vw;
  height: 120vh;
  top: -10vh;
  opacity: 0;
}

.wall--lights {
  opacity: 1;
  z-index: 2;
}

.light-up-hold {
  position: absolute;
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 0 0 rgba(226, 200, 255, 0));
  will-change: opacity, transform, filter;
}

.light-up-hold--1 { left: 12%; top: 68%; width: 45px; }
.light-up-hold--2 { left: 77%; top: 64%; width: 46px; }
.light-up-hold--3 { left: 45%; top: 74%; width: 37px; }
.light-up-hold--4 { left: 16%; top: 36%; width: 38px; }
.light-up-hold--5 { left: 82%; top: 36%; width: 44px; }

.wall-glitch-overlay {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

/* --- SECTION VARIANTS / HERO LAYOUT --- */
.section--hero {
  display: flex;
  flex-direction: column; 
  justify-content: center; 
  align-items: flex-start; 
  padding-left: 8vw; 
  overflow: hidden; 
  position: relative; 
}

.section--hero .section__content {
  text-align: left;
  max-width: 60%; 
  margin: 0; 
  z-index: 10;
}

.section--hero h1 {
  white-space: nowrap; 
}

/* --- THE GIANT FLOATING CLIFF --- */
.floating-cliff {
  position: absolute;
  right: 0; 
  bottom: -5%; 
  height: 100vh; 
  width: auto; 
  z-index: 5;
  animation: float 6s ease-in-out infinite; 
}

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

/* --- THE CLIMBER STACK --- */
.climber-stack {
  position: absolute;
  bottom: 45%; /* Puts him up on the cliff face */
  right: 3%;   /* Anchors him near the right side of the rock */
  width: 600px; /* The massive size you requested */
  height: auto;
  z-index: 7;
  animation: climber-float 7s ease-in-out infinite; 
}

/* RESTORED: This is the class that was missing and broke everything! */
.climber {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
}

.climber--chill {
  opacity: 1; 
  z-index: 2; 
}

.climber--dangling {
  opacity: 0; 
  z-index: 1; 
  /* Tweak these two numbers to dial in the exact hand alignment */
  top: -80px;  
  left: 60px;  
}

/* --- MISC STYLES --- */
.puzzle-wrapper {
  width: 100%;
  max-width: 500px;
  margin: 30px auto;
}

.puzzle-card {
  perspective: 1000px;
  min-height: 300px;
}

.puzzle-front,
.puzzle-back {
  padding: 30px;
  background-color: var(--neutrals-nuetral-00, #ffffff);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 180px;
  padding: 12px 22px;
  margin: 6px auto 24px;
  background: rgba(5, 8, 1, 0.92);
  color: #03e9f4;
  border: 1px solid rgba(3, 233, 244, 0.45);
  border-radius: 18px;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
  letter-spacing: 0.2em;
  overflow: hidden;
  font-family: var(--fonts-font-family-headers, 'Inclusive Sans', sans-serif);
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-toggle:hover {
  background: #03e9f4;
  color: #050801;
  box-shadow: 0 0 5px #03e9f4,
              0 0 20px #03e9f4,
              0 0 42px rgba(3, 233, 244, 0.75);
  transform: translateY(-2px);
}

.btn-toggle span {
  position: absolute;
  display: block;
}

.btn-toggle span:nth-child(1) {
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #03e9f4);
  animation: toggle-animate-1 1s linear infinite;
}

.btn-toggle span:nth-child(2) {
  top: -100%;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #03e9f4);
  animation: toggle-animate-2 1s linear infinite;
  animation-delay: 0.25s;
}

.btn-toggle span:nth-child(3) {
  bottom: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, transparent, #03e9f4);
  animation: toggle-animate-3 1s linear infinite;
  animation-delay: 0.5s;
}

.btn-toggle span:nth-child(4) {
  bottom: -100%;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(360deg, transparent, #03e9f4);
  animation: toggle-animate-4 1s linear infinite;
  animation-delay: 0.75s;
}

@keyframes toggle-animate-1 {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

@keyframes toggle-animate-2 {
  0% { top: -100%; }
  50%, 100% { top: 100%; }
}

@keyframes toggle-animate-3 {
  0% { right: -100%; }
  50%, 100% { right: 100%; }
}

@keyframes toggle-animate-4 {
  0% { bottom: -100%; }
  50%, 100% { bottom: 100%; }
}

@media (max-width: 768px) {
  .section { padding: 60px 20px; }
  h1 { font-size: var(--font-size-font-size-xxl, 48px); }
  h2 { font-size: var(--font-size-font-size-l, 36px); }
}

/* --- 6. EVENTS SECTION (SCATTERED HOLDS) --- */
#events .holds-container {
  min-height: 180vh; /* Makes this section extremely tall to fit both frames of your Figma */
  position: relative; /* Acts as the anchor for the absolute positioned holds */
}

.climbing-hold {
  position: absolute;
  z-index: 5;
  filter: drop-shadow(4px 8px 12px rgba(0,0,0,0.15)); /* Adds a realistic pop off the wall */
}
/* --- Positioning the Text Holds --- */
.text-hold-1 { top: 12%; left: 18%; width: 350px; } 
.text-hold-2 { top: 48%; right: 15%; width: 280px; } /* BIG HAMMER: Pushed almost a full screen down! */
.text-hold-3 { top: 65%; left: 15%; width: 350px; }
.text-hold-4 { top: 85%; right: 10%; width: 480px; } 

/* --- Positioning the Decorative Holds --- */
.deco-hold-1 { top: 20%; right: 25%; width: 80px; height: auto; } 

/* BIG HAMMER: Shoved this way down and into the dead center (50%) to get it off your text */
.deco-hold-2 { top: 38%; left: 50%; width: 60px; height: auto; } 

.deco-hold-3 { top: 55%; left: 35%; width: 90px; height: auto; }
.deco-hold-4 { top: 75%; right: 40%; width: 60px; height: auto; }


/* --- 7. CONDITIONALS SECTION (3D PUZZLE FLIP) --- */
#conditionals {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Perfectly centers the puzzle when the screen locks */
}

.puzzle-flip-container {
  perspective: 2000px; 
  width: 100%;
  max-width: 800px; 
  margin: 40px auto; 
}

.puzzle-flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  aspect-ratio: 500 / 330;
}

.puzzle-front,
.puzzle-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* --- THE GRID --- */
.puzzle-grid {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 500 / 330;
  background: transparent;
}

.puzzle-full-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
}

.puzzle-piece {
  position: absolute;
  left: calc((var(--piece-x) / 500) * 100%);
  top: calc((var(--piece-y) / 330) * 100%);
  width: calc((var(--piece-width) / 500) * 100%);
  height: calc((var(--piece-height) / 330) * 100%);
  display: block;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform, opacity;
  z-index: 2;
}

/* --- THE BACK --- */
.puzzle-back {
  background: white;
  border-radius: 18px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  color: #59202b;
}

.puzzle-angry-gif {
  position: absolute;
  left: -70px;
  bottom: -40px;
  width: 280px;
  height: auto;
  opacity: 0;
  transform: translateY(12px);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
  pointer-events: none;
  z-index: 2;
}

/* --- 8. TOGGLE SECTION (RESTORED WITH LAYERING FIX) --- */

/* This centers the section naturally on the screen as it was before */
#toggle {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden; /* Keeps the girl from sliding off the page */
  margin-bottom: 100vh;
}

#tokens {
  margin-bottom: 100vh;
}

#tokens h2 {
  color: #59202b;
}

#memory {
  min-height: 100vh;
  position: relative;
}

.memory-stage {
  position: relative;
  width: 100%;
  height: 80vh;
  margin-top: 80px;
  overflow: visible;
}

.memory-thinker {
  position: absolute;
  left: 50%;
  bottom: -4vh;
  width: min(75vw, 780px);
  height: auto;
  transform: translateX(-50%);
  transform-origin: center center;
  z-index: 2;
  pointer-events: none;
}

.brain-rotation,
.brain-zoom {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(54vw, 576px);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

.brain-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.brain-zoom__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: brain-breathe 3.2s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes brain-breathe {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

.brain-frame--quarters-flip {
  transform: scaleX(-1);
}

.brain-note {
  position: absolute;
  width: min(60vw, 640px);
  aspect-ratio: 963 / 590;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transform-origin: center center;
  z-index: 4;
  pointer-events: none;
}

.brain-note--left {
  left: 6%;
  top: 8%;
}

.brain-note--right {
  right: -8%;
  top: 10%;
  aspect-ratio: 977 / 638;
}

.brain-note__paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brain-note p {
  position: absolute;
  top: 34%;
  left: 26%;
  width: 56%;
  height: 44%;
  margin: 0;
  overflow: hidden;
  color: #59202b;
  font-size: clamp(0.7rem, 0.9vw, 0.95rem);
  line-height: 1.4;
  text-align: left;
  z-index: 1;
}

.brain-note--right p {
  top: 37%;
  left: 23%;
}

.brain-note--left p {
  top: 36%;
}

.memory-frog {
  position: absolute;
  right: -12%;
  top: -6%;
  width: clamp(160px, 16vw, 250px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: visible;
  opacity: 0;
  z-index: 5;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.memory-frog img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.memory-frog__thought {
  position: absolute;
  right: 88%;
  top: 6%;
  width: 180px;
  pointer-events: none;
}

.memory-frog__thought p {
  margin: 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  font-size: 0.95rem;
  line-height: 1.25;
  color: #59202b;
}

.memory-frog__bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.memory-frog__bubble--1 {
  width: 16px;
  height: 16px;
  right: -10px;
  top: 84px;
}

.memory-frog__bubble--2 {
  width: 10px;
  height: 10px;
  right: -24px;
  top: 102px;
}

#conclusion {
  margin-top: 45vh;
  overflow: visible;
}

#conclusion .section__content {
  padding-top: calc(58vh + 400px);
  position: relative;
  z-index: 3;
}

.conclusion-cliff {
  position: absolute;
  left: -4%;
  bottom: calc(-28% - 200px);
  width: min(72vw, 1050px);
  height: auto;
  z-index: 1;
  pointer-events: none;
}

.conclusion-girl {
  position: absolute;
  left: calc(5% - 100px);
  bottom: calc(-28% + 215px);
  width: min(54vw, 900px);
  display: grid;
  z-index: 2;
  pointer-events: none;
}

.conclusion-girl__image {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  display: block;
  transform-origin: left bottom;
}

.conclusion-girl--happy {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.conclusion-girl--breath {
  opacity: 0;
  transform: translate(-190px, 0) scale(0.72);
}

/* Restores standard centered text content width and position */
#toggle .section__content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  text-align: left;
}

/* 2. Position the Girl container relative to the text box */
.toggle-image-container {
  position: relative;
  width: 100%;
  height: 350px; /* Sets a standard height for the image area above the text */
  margin: 30px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  overflow: visible; /* CRITICAL: Allows the girl to slide OUT onto the wall */
}

/* Restores the common sizing from your original code */
.toggle-img {
  position: absolute;
  height: 100%; /* Or auto and use bottom: 0 to sit on the line, as before */
  width: auto;
  transition: opacity 0.4s ease-in-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* --- State: Off the Wall (Standing, Centered) --- */
.img-off-wall {
  opacity: 1;
  z-index: 2;
  transform: translateX(0); /* Centered and standard */
}

/* --- State: On the Wall (Climbing, Initially Hidden and Centered) --- */
.img-on-wall {
  opacity: 0;
  z-index: 1;
  transform: translateX(0); /* Standard starting position */
}

/* --- ACTIVE STATE (When button is clicked) --- */

/* Standard fade-out for the standing girl */
body.on-the-wall .img-off-wall {
  opacity: 0;
  z-index: 1;
}

/* --- THE FIGMA FIX: Girl moves over to the background walls and grows --- */
body.on-the-wall .img-on-wall {
  opacity: 1;
  z-index: 2;
  /* MAGICAL SHIFT: moves her far right onto the grey geometric panel 
     and scales her up to look large like the cliff section */
  transform: translateX(35vw) scale(1.15); 
  transform-origin: center right; /* Optional: Scale happens from the right edge */
}
/* Puzzle front transparency override */
#conditionals .puzzle-front {
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#conditionals .puzzle-grid {
  background: transparent !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .floating-cliff,
  .climber-stack,
  .btn-toggle span,
  .brain-zoom__image {
    animation: none !important;
  }

  .theme-toggle,
  .toggle-img,
  body {
    transition: none !important;
  }
}


