/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  font-family: 'Gabarito', -apple-system, BlinkMacSystemFont, sans-serif;
  color: white;
  overflow-x: clip;  /* Stronger than hidden - prevents clouds from causing horizontal scroll */
}

main {
  overflow-x: clip;  /* Prevent horizontal overflow from cloud elements */
}

/* Fixed gradient background attached to viewport - never scrolls */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #1FB1EA 0%, #94DAF5 100%);
  z-index: -1;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px;
  margin: 0 auto;
}

.logo svg {
  display: block;
  height: 48px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(12, 13, 13, 0.08));
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  height: 48px;
  background: linear-gradient(168deg, #e8f583 7%, #d2de77 91%);
  border: 1px solid #f7ffb8;
  border-radius: 8px;
  color: #18181b;
  font-family: 'Gabarito', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: 0.4px;
  text-decoration: none;
  box-shadow:
    0 1px 4px rgba(12, 12, 13, 0.1),
    0 1px 4px rgba(12, 12, 13, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  background: linear-gradient(168deg, #f0fc8f 7%, #dce982 91%);
  box-shadow:
    0 2px 8px rgba(12, 12, 13, 0.08),
    0 1px 4px rgba(12, 12, 13, 0.06);
}

/* ===== LAYERED PARALLAX HERO ===== */

/* Layer 1: Background Cloud - scrolls with page but slower (parallax) */
/* 60% opacity per Figma design */
.hero-bg-cloud {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2048px;
  max-width: none;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  animation: cloud-drift 25s ease-in-out infinite;
  will-change: transform;
}

.hero-bg-cloud .bg-cloud-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Slow horizontal drifting animation for background cloud */
@keyframes cloud-drift {
  0%, 100% {
    transform: translateX(-50%) translateX(0);
  }
  25% {
    transform: translateX(-50%) translateX(12px);
  }
  50% {
    transform: translateX(-50%) translateX(-10px);
  }
  75% {
    transform: translateX(-50%) translateX(6px);
  }
}

/* Reverse drift animation for front cloud (opposite direction) */
@keyframes cloud-drift-reverse {
  0%, 100% {
    transform: translateX(-50%) translateX(0);
  }
  25% {
    transform: translateX(-50%) translateX(-10px);
  }
  50% {
    transform: translateX(-50%) translateX(8px);
  }
  75% {
    transform: translateX(-50%) translateX(-5px);
  }
}

/* Hero Parallax Container - holds text, front cloud, and phone */
.hero-parallax {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 263px;  /* Match Figma: text starts at y=263 */
  padding-bottom: 0;
  z-index: 2;
  overflow: visible;
}

/* Layer 2: Hero Text */
.hero-text-layer {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-title {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 9vw, 140px);
  line-height: 0.97;
  /* Gradient text fill matching Figma design */
  background: linear-gradient(169.245deg, rgba(9, 121, 174, 0.9) 20.481%, rgba(9, 118, 170, 0.95) 73.8%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  width: 95vw;
  max-width: 1648px;
  padding: 0 0 24px 0;
}

/* Layer 3: Front Cloud (above text, below phone) - 1728px wide per Figma */
/* Positioned absolutely within hero-parallax to overlap text */
.hero-cloud-layer {
  position: absolute;
  top: 400px;  /* Match Figma: cloud starts at y=400 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;  /* Above text (z-index 2), below phone (z-index 4) */
  width: 1728px;
  max-width: none;
  pointer-events: none;
  animation: cloud-drift-reverse 25s ease-in-out infinite;
  will-change: transform;
}

.hero-cloud-layer .front-cloud-img {
  width: 100%;
  height: auto;
}

/* Layer 4: Phone (topmost layer) */
.hero-phone-layer {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 402px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  margin-top: 172px;  /* Match Figma: gap from text to phone */
}

.phone-mockup {
  width: 100%;
  max-width: 402px;
  height: auto;
  display: block;
}




/* ===== Courses Content ===== */
/* Fixed to viewport, centered, positioned in upper portion */
/* Matches hero text STYLING (opacity, shadow) not size */
/* ===== New Content Sections (Humans, Protect) ===== */
.humans-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 160px 40px 120px;
  text-align: center;
  /* background: rgba(255, 255, 255, 0.35); */
}

.vitruvian-image {
  width: 360px;
  height: 360px;
  opacity: 0.85;
  animation: spin-vinyl 30s linear infinite;
}

@keyframes spin-vinyl {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== Protect Section ===== */
.protect-section {
  position: relative;
  z-index: 5;  /* Higher than adjacent sections so clouds extend over them */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
  padding: 160px 40px 120px;
  text-align: center;
  /* background: rgba(255, 255, 255, 0.35); */
  /* background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0) 100%
  ); */
  overflow: visible;
}

/* Background clouds container - overflow visible so clouds extend beyond section */
.protect-clouds {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 1;  /* Behind content (tweets, text) */
}

/* Individual cloud styling */
.protect-cloud {
  position: absolute;
  opacity: 0.9;
  will-change: transform;
}

/* Left cloud - Figma: bottom-left, mostly off-screen (y≈280px in 975px section ≈ 29%) */
.protect-cloud-1 {
  width: 1100px;
  height: 600px;
  top: 120px;
  left: -620px;
}

/* Right cloud - upper-right, mostly off-screen */
.protect-cloud-2 {
  width: 1100px;
  height: auto;
  top: 20px;
  right: -640px;
}

.protect-text {
  max-width: 800px;
  position: relative;
  z-index: 2;
}

/* Tweets container */
.protect-tweets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 1200px;
  position: relative;
  z-index: 2;
}

.protect-text .section-heading {
  margin-bottom: 24px;
  color: #076c9d;  /* Match Figma */
}

.protect-text .section-subtitle {
  margin-bottom: 0;
  color: rgba(7, 108, 157, 0.8);  /* Match Figma */
}

/* ===== Tweet Images ===== */
.tweet-image {
  display: block;
  height: auto;
}

/* Left tweet: "This is what they..." */
.tweet-left {
  width: 314px;
}

/* Center tweet: "BREAKING..." */
.tweet-center {
  width: 403px;
}

/* Right tweet: "Big if true!" */
.tweet-right {
  width: 270px;
}

.section-heading {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 6vw, 72px);
  line-height: 1.1;
  color: #076c9d;  /* Match Figma */
  margin-bottom: 24px;
}

.section-subtitle {
  font-family: 'Gabarito', sans-serif;
  font-weight: 400;
  font-size: clamp(18px, 3vw, 40px);  /* Match Figma: 40px max */
  line-height: 1.4;
  color: rgba(7, 108, 157, 0.8);  /* Match Figma: #076c9d at 80% */
  max-width: 800px;
  margin-bottom: 80px;
  text-align: center;
}

/* ===== Tags Section (Final) ===== */
.tags-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 160px 40px 240px;  /* Top, sides, bottom padding for tags */
  overflow: hidden;
}

/* Footer Cloud - Mobile Only */
.footer-cloud {
  display: none;  /* Hidden on desktop */
}

/* ===== Lottie Tags Animation ===== */
.lottie-tags {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  opacity: 0;  /* Hidden until triggered */
  transition: opacity 0.3s ease;
}

.lottie-tags.visible {
  opacity: 1;
}

/* SVG inside Lottie container - scale to fit width, anchor to bottom */
.lottie-tags svg {
  display: block;
  width: 100% !important;
  height: auto !important;
  /* preserveAspectRatio set via JS for bottom alignment */
}

/* ===== Footer Content (in tags section) ===== */
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 5;  /* Above Lottie tags */
  text-align: center;
}

.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  font-family: 'Gabarito', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #0B5B81;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.7;
}

.footer-divider {
  font-family: 'Gabarito', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #0B5B81;
  opacity: 0.5;
  margin: 0 -4px;  /* Reduce gap around dividers */
}

.download-button {
  display: block;
  margin-top: 24px;
}

.download-button-img {
  width: 240px;
  height: auto;
}

.qr-code {
  width: 240px;
  height: auto;
}

.copyright {
  font-family: 'Gabarito', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #0B5B81;
  opacity: 0.5;
}

/* ===== Lessons Marquee ===== */
.lessons-section {
  position: relative;
  top: 0;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: 80px 0 40px 0;  /* Match Figma: 80px top, 40px bottom */
  /* Gradient over solid white to hide the cloud */
  /* background: 
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.35) 100%
    ); */
}

/* Marquee spacing handled by section-subtitle margin-bottom */

/* Lessons heading/subtitle now use shared section styles */
.lessons-heading {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 6vw, 72px);
  line-height: 1.1;
  color: #076c9d;  /* Match Figma */
  text-align: center;
  margin-bottom: 24px;
}

/* lessons-subtitle merged into section-subtitle */

.lessons-marquee {
  width: 100%;
  overflow: hidden;
}

.lessons-track {
  display: flex;
  gap: 24px;
  width: max-content;
  padding: 16px 0;
  /* Animation controlled by GSAP for smooth hover slowdown */
}

.lesson-tile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  flex-shrink: 0;
  width: 202px;
}

.lesson-image-wrapper {
  position: relative;
  width: 202px;
  height: 202px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(12, 12, 13, 0.05);
}

.lesson-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.1) 100%);
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.lesson-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lesson-title {
  font-family: 'Gabarito', sans-serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 28px;
  color: rgba(7, 108, 157, 0.75);  /* Match Figma style */
  width: 100%;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ===== Utility Classes ===== */
.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .header {
    padding: 24px;
  }

  .hero-title {
    font-size: clamp(36px, 8vw, 100px);
  }

  .section-heading,
  .lessons-heading {
    font-size: clamp(28px, 5vw, 48px);
  }
}

/* Tablet breakpoint for protect section */
@media (max-width: 1600px) and (min-width: 769px) {
  .protect-section {
    gap: 60px;
    padding: 120px 40px 100px;
  }

  .tweet-left {
    width: 280px;
  }

  .tweet-center {
    width: 360px;
  }

  .tweet-right {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 16px;
  }

  .logo svg {
    height: 36px;
    filter: drop-shadow(0 1px 2px rgba(12, 13, 13, 0.08));
  }

  .cta-button {
    padding: 8px 16px;
    font-size: 18px;
    height: 40px;
  }

  .hero {
    padding: 20px;
  }

  .hero-phone-layer {
    padding: 0 48px;
    max-width: 100%;
  }

  .phone-mockup {
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(36px, 10vw, 64px);
    max-width: 100%;
  }

  .hero-bg-cloud {
    width: 250vw;
    max-width: none;
  }

  .hero-parallax {
    padding-top: 120px;
  }

  .hero-phone-layer {
    margin-top: 80px;
  }

  .hero-cloud-layer {
    width: 250vw;
    max-width: none;
    top: 250px;  /* Adjusted for mobile */
  }

  .hero-cloud-layer .front-cloud-img {
    width: 100%;
  }

  .section-heading,
  .lessons-heading {
    font-size: clamp(32px, 8vw, 48px);
    padding: 0 32px;
  }

  .section-heading br,
  .lessons-heading br {
    display: none;
  }

  .hero-title {
    padding: 0 24px;
  }

  .section-subtitle {
    font-size: 18px;
    margin-bottom: 40px;
    padding: 0 20px;
    color: rgba(7, 108, 157, 0.8);  /* Match Figma */
  }

  .phone-frame {
    max-width: 320px;
  }

  .courses-section {
    padding: 100px 16px 20px;
  }

  /* Lessons Section - smaller tiles on mobile */
  .lessons-section {
    padding: 60px 0 40px 0;
  }

  .lessons-section .lessons-marquee {
    margin-top: 32px;
  }

  .lesson-tile {
    width: 160px;
    gap: 12px;
  }

  .lesson-image-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 10px;
  }

  .lesson-image-wrapper::after {
    border-radius: 10px;
  }

  .lesson-title {
    font-size: 18px;
    line-height: 24px;
  }

  .lessons-track {
    gap: 16px;
  }

  /* Humans Section - stack vertically */
  .humans-section {
    padding: 80px 20px;
  }

  .vitruvian-image {
    width: 280px;
    height: 280px;
    margin-top: 32px;
  }

  /* Protect Section - stack tweets vertically on mobile */
  .protect-section {
    padding: 60px 20px;
    gap: 32px;
  }

  .protect-tweets {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .tweet-left {
    width: 236px;
  }

  .tweet-center {
    width: 302px;
  }

  .tweet-right {
    width: 203px;
  }

  /* Hide clouds on mobile - too busy */
  .protect-clouds {
    display: none;
  }

  /* Tags/Footer Section */
  .tags-section {
    min-height: auto;
    padding: 80px 20px 240px;
  }

  .footer-cloud {
    display: block;
    position: absolute;
    width: 200vw;
    height: auto;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
  }

  .footer-content {
    z-index: 1;
  }

  .footer-nav {
    flex-direction: column;
    gap: 12px;
  }

  .footer-divider {
    display: none;
  }

  .footer-link {
    font-size: 18px;
  }

  .footer-divider {
    font-size: 18px;
  }

  .download-button-img,
  .qr-code {
    width: 160px;
  }

  .copyright {
    font-size: 12px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(32px, 11vw, 48px);
  }

  .section-heading,
  .lessons-heading {
    font-size: clamp(28px, 8vw, 40px);
  }

  .section-subtitle {
    font-size: 18px;
    color: rgba(7, 108, 157, 0.8);  /* Match Figma */
  }

  .lesson-tile {
    width: 140px;
  }

  .lesson-image-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 8px;
  }

  .lesson-image-wrapper::after {
    border-radius: 8px;
  }

  .lesson-title {
    font-size: 16px;
    line-height: 22px;
  }

  .tweet-left {
    width: 212px;
  }

  .tweet-right {
    width: 181px;
  }

  .tweet-center {
    width: 269px;
  }

  .vitruvian-image {
    width: 240px;
    height: 240px;
  }
}

/* ===== Legal Pages (Terms, Privacy) ===== */
.legal-page {
  background: #ffffff;
  color: #1a1a1a;
}

/* Override the blue sky gradient for legal pages */
.legal-page::before {
  display: none;
}

/* Logo image for legal pages */
.legal-page .logo img {
  display: block;
  height: 48px;
  width: auto;
}

@media (max-width: 768px) {
  .legal-page .logo img {
    height: 36px;
  }
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 40px 80px;
  line-height: 1.7;
}

.legal-content h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: #18181b;
  margin-bottom: 48px;
  line-height: 1.2;
}

.legal-content h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  color: #18181b;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
}

.legal-content section:first-of-type h2 {
  margin-top: 0;
}

.legal-content p {
  font-size: 16px;
  color: #3f3f46;
  margin-bottom: 16px;
}

.legal-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content li {
  font-size: 16px;
  color: #3f3f46;
  margin-bottom: 8px;
}

.legal-content a {
  color: #0B5B81;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: #094a6a;
}

.legal-content strong {
  font-weight: 600;
  color: #18181b;
}

.legal-content .last-revised {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
  color: #71717a;
  font-size: 14px;
}

/* Legal Footer */
.legal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 40px;
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
}

.legal-footer .footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.legal-footer .footer-link {
  font-family: 'Gabarito', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #18181b;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.legal-footer .footer-link:hover {
  opacity: 0.7;
}

.legal-footer .footer-divider {
  font-family: 'Gabarito', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #18181b;
  opacity: 0.3;
  margin: 0 -4px;
}

.legal-footer .copyright {
  font-family: 'Gabarito', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #71717a;
}

/* Legal page responsive */
@media (max-width: 768px) {
  .legal-content {
    padding: 100px 24px 60px;
  }

  .legal-content h1 {
    margin-bottom: 32px;
  }

  .legal-content h2 {
    margin-top: 32px;
  }

  .legal-footer {
    padding: 32px 24px;
  }

  .legal-footer .footer-nav {
    flex-direction: column;
    gap: 12px;
  }

  .legal-footer .footer-divider {
    display: none;
  }
}
