/* =============================================
   Rubik's Cube Learning Hub — Main Stylesheet
   Language: French | Palette: Rubik's Cube Colors
   ============================================= */

/* === Custom Properties === */
:root {
  --cube-red:    #C41E3A;
  --cube-blue:   #0051A2;
  --cube-yellow: #FFD700;
  --cube-orange: #FF5800;
  --cube-green:  #009B48;
  --cube-white:  #FFFFFF;

  --bg-light:    #FAFAF8;
  --bg-card:     #FFFFFF;
  --text-dark:   #1A1A1A;
  --text-mid:    #444444;
  --text-light:  #777777;

  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   40px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg:   0 16px 48px rgba(0,0,0,0.16);

  --font-heading: 'Nunito', sans-serif;
  --font-body:    'Inter', sans-serif;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; }

/* === Typography === */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 800; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p  { font-size: 1rem; line-height: 1.7; }

/* === Layout Utilities === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-alt { background: #F0F4FF; }
.text-center { text-align: center; }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-mid);
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.nav.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-dark);
}
.nav-logo .logo-cube {
  width: 36px;
  height: 36px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-mid);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--cube-blue); }
.nav-cta {
  background: var(--cube-red);
  color: white !important;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  font-weight: 700 !important;
  transition: background var(--transition), transform var(--transition) !important;
}
.nav-cta:hover {
  background: #a01530 !important;
  transform: translateY(-1px) !important;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-mobile {
  display: none;
  position: fixed;
  top: 70px; left: 0; right: 0;
  background: white;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0A0A2E;
}

/* Abstract SVG background */
.hero-bg-abstract {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-abstract img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(10,10,46,0.88) 0%,
    rgba(10,10,46,0.72) 45%,
    rgba(0,20,80,0.45) 100%
  );
  z-index: 1;
}

/* Decorative color stripes at bottom of hero */
.hero-stripes {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 3;
  display: flex;
}
.hero-stripes span {
  flex: 1;
}
.hero-stripes .s1 { background: var(--cube-red); }
.hero-stripes .s2 { background: var(--cube-blue); }
.hero-stripes .s3 { background: var(--cube-yellow); }
.hero-stripes .s4 { background: var(--cube-orange); }
.hero-stripes .s5 { background: var(--cube-green); }
.hero-stripes .s6 { background: var(--cube-white); }

/* Hero two-column layout */
.hero-layout {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding-top: 5rem;
  padding-bottom: 4rem;
  width: 100%;
}

.hero-content {
  flex: 1 1 0;
  min-width: 0;
  color: white;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}
.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cube-yellow);
  animation: pulse-dot 1.5s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
.hero h1 {
  color: white;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.hero h1 span { color: var(--cube-yellow); }
.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 2.5rem;
  max-width: 500px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cube-yellow);
  color: #1A1A1A;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 20px rgba(255,215,0,0.5);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(255,215,0,0.6);
  background: #FFC200;
}
.btn-primary svg { transition: transform var(--transition); }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  border: 2px solid rgba(255,255,255,0.5);
  transition: border-color var(--transition), background var(--transition);
}
.btn-secondary:hover {
  border-color: white;
  background: rgba(255,255,255,0.1);
}
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.hero-stat-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cube-yellow);
}
.hero-stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

/* 3D WebGL Cube wrapper */
.hero-cube-3d-wrapper {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
#hero-cube-3d {
  width: 420px;
  height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
}
#hero-cube-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: var(--radius-lg);
}
.hero-cube-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* =============================================
   WHY SECTION — CUBE FACE CARDS
   ============================================= */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
.why-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  overflow: hidden;
  cursor: default;
  transition: transform var(--transition), box-shadow var(--transition);
}
.why-card:hover {
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: var(--shadow-lg);
}
.why-card-1 { background: var(--cube-blue); color: white; }
.why-card-2 { background: var(--cube-red); color: white; }
.why-card-3 { background: var(--cube-green); color: white; }

.why-card-bg {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.why-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.8rem;
}
.why-card h3 {
  color: white;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}
.why-card p {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
}
.why-card-tag {
  display: inline-block;
  margin-top: 1.25rem;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
}

/* =============================================
   METHODS SECTION
   ============================================= */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
.method-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.method-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.method-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.method-card-1 { --mc: var(--cube-blue); }
.method-card-2 { --mc: var(--cube-red); }
.method-card-3 { --mc: var(--cube-orange); }
.method-card-4 { --mc: var(--cube-green); }

.method-card:hover { border-color: var(--mc); }
.method-card::before { background: var(--mc); }
.method-card:hover::before { opacity: 1; }

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--mc);
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.method-card h3 { margin-bottom: 0.5rem; }
.method-card p { font-size: 0.95rem; color: var(--text-mid); margin-bottom: 1.25rem; }
.method-level {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mc);
  margin-bottom: 1rem;
}
.method-level-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mc); }
.method-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mc);
  transition: gap var(--transition);
}
.method-link:hover { gap: 0.7rem; }

/* =============================================
   TUTORIAL SECTION
   ============================================= */
.tutorial-steps {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.tutorial-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.tutorial-step:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.tutorial-step:nth-child(even) { direction: rtl; }
.tutorial-step:nth-child(even) > * { direction: ltr; }

.step-number {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.6rem;
  color: white;
  flex-shrink: 0;
}
.step-number-1 { background: var(--cube-red); }
.step-number-2 { background: var(--cube-blue); }
.step-number-3 { background: var(--cube-orange); }

.step-content h3 { margin-bottom: 0.5rem; }
.step-content p { font-size: 0.95rem; color: var(--text-mid); }
.step-algo {
  display: inline-block;
  margin-top: 0.75rem;
  background: #F0F4FF;
  color: var(--cube-blue);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,81,162,0.2);
}

.step-image {
  width: 180px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.step-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.step-image-placeholder {
  width: 180px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0F4FF;
  color: var(--cube-blue);
}

/* =============================================
   FAQ SECTION
   ============================================= */
.faq-list {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.faq-item {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.faq-item.open { border-color: var(--cube-blue); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-dark);
  gap: 1rem;
}
.faq-question:hover { color: var(--cube-blue); }
.faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F0F4FF;
  color: var(--cube-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform var(--transition), background var(--transition);
}
.faq-item.open .faq-icon {
  background: var(--cube-blue);
  color: white;
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner {
  padding: 0 2rem 1.5rem;
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.7;
  border-top: 1px solid #F0F0F0;
  padding-top: 1rem;
}

/* =============================================
   CTA SECTION
   ============================================= */
.cta-section {
  background: linear-gradient(135deg, #0A0A1A 0%, #0051A2 50%, #C41E3A 100%);
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,215,0,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(0,155,72,0.1) 0%, transparent 50%);
}
.cta-content { position: relative; z-index: 1; }
.cta-content h2 { color: white; margin-bottom: 1rem; }
.cta-content p { color: rgba(255,255,255,0.8); font-size: 1.1rem; margin-bottom: 2.5rem; }
.cta-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.cta-input {
  padding: 0.9rem 1.5rem;
  border-radius: 100px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 1rem;
  width: 300px;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color var(--transition);
}
.cta-input::placeholder { color: rgba(255,255,255,0.5); }
.cta-input:focus { border-color: var(--cube-yellow); }
.btn-cta-yellow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cube-yellow);
  color: #1A1A1A;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(255,215,0,0.4);
}
.btn-cta-yellow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,215,0,0.6);
}
.cta-social-proof {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}
.cta-social-proof strong { color: var(--cube-yellow); }

/* CTA color stripes */
.cta-stripes {
  display: flex;
  height: 5px;
}
.cta-stripes span { flex: 1; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: #0A0A1A;
  color: rgba(255,255,255,0.6);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: rgba(255,255,255,0.5);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--cube-yellow); }

/* =============================================
   FLOATING COLOR BLOBS (decorative)
   ============================================= */
.color-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.12;
  pointer-events: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .hero-cube-3d-wrapper {
    flex: 0 0 340px;
  }
  #hero-cube-3d {
    width: 340px;
    height: 340px;
  }
}

@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; }
  .methods-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .hero-layout {
    flex-direction: column;
    padding-top: 7rem;
    gap: 2rem;
  }
  .hero-cube-3d-wrapper {
    flex: none;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
  #hero-cube-3d {
    width: 100%;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .tutorial-step {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .tutorial-step:nth-child(even) { direction: ltr; }
  .step-image,
  .step-image-placeholder {
    display: none;
  }
  .hero-stats { display: none; }
  .cta-input { width: 100%; max-width: 300px; }
  .hero-cube-3d-wrapper { display: none; }
}

@media (max-width: 480px) {
  .section { padding: 3rem 0; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .hero-content { padding-top: 5rem; }
}

/* =============================================
   BOUNCE ANIMATION FOR CTA
   ============================================= */
@keyframes bounce-btn {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}
.bounce { animation: bounce-btn 2s ease 1s infinite; }
.bounce:hover { animation: none; }

/* =============================================
   PROGRESS BAR
   ============================================= */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cube-red), var(--cube-blue), var(--cube-yellow), var(--cube-green));
  z-index: 200;
  transition: width 0.1s linear;
  width: 0%;
}

/* =============================================
   METHODS TAB ACTIVE STATE
   ============================================= */
.method-card.featured {
  border-color: var(--mc);
  box-shadow: var(--shadow-md);
}
.method-card.featured::before { opacity: 1; }

/* =============================================
   CUBE COLORS LEGEND
   ============================================= */
.cube-legend {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.cube-legend-face {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}
