/**
 * DevFluentia — Four Worlds Design System
 * Space × Nature × Ocean × Geometry
 * ═══════════════════════════════════════════════════════════════
 * This file controls the unified visual identity of the welcome
 * page and chapter landing pages. Each section gets its own world.
 * ═══════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════
   01. WELCOME PAGE — FOUR WORLDS UNIFIED COMPOSITION
   ═══════════════════════════════════════════════════════════════ */

.fw-opening {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 10% 15%, rgba(30, 45, 94, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(26, 75, 110, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(26, 75, 110, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, #FAF9F7 100%);
}

/* ── Ambient Background Canvas ── */
.fw-ambient-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* ── Space Layer: Stars + Nebulae (top-left) ── */
.fw-space-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  pointer-events: none;
}

.fw-star {
  position: absolute;
  border-radius: 50%;
  background: var(--space-stardust);
  animation: fw-twinkle ease-in-out infinite;
}

.fw-s1 { width: 3px; height: 3px; top: 8%; left: 12%; animation-duration: 3.2s; opacity: 0.7; }
.fw-s2 { width: 2px; height: 2px; top: 15%; left: 28%; animation-duration: 4.1s; animation-delay: -1s; opacity: 0.5; }
.fw-s3 { width: 4px; height: 4px; top: 22%; left: 7%; animation-duration: 2.8s; animation-delay: -0.5s; opacity: 0.6; }
.fw-s4 { width: 2px; height: 2px; top: 5%; left: 38%; animation-duration: 3.8s; animation-delay: -2s; opacity: 0.4; }
.fw-s5 { width: 3px; height: 3px; top: 30%; left: 18%; animation-duration: 5s; animation-delay: -1.5s; opacity: 0.55; }
.fw-s6 { width: 2px; height: 2px; top: 12%; left: 45%; animation-duration: 3.5s; animation-delay: -0.8s; opacity: 0.45; }
.fw-s7 { width: 3px; height: 3px; top: 38%; left: 5%; animation-duration: 4.4s; animation-delay: -3s; opacity: 0.5; }

@keyframes fw-twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

.fw-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.fw-nebula-1 {
  width: 280px;
  height: 180px;
  top: 2%;
  left: -4%;
  background: radial-gradient(ellipse, rgba(45, 32, 96, 0.18) 0%, transparent 70%);
}

.fw-nebula-2 {
  width: 200px;
  height: 150px;
  top: 18%;
  left: 15%;
  background: radial-gradient(ellipse, rgba(26, 75, 110, 0.14) 0%, transparent 70%);
}

/* ── Ocean Layer: Wave SVG (bottom edge) ── */
.fw-ocean-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
}

.fw-wave-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.fw-wave {
  fill-opacity: 1;
}

.fw-wave-back {
  fill: rgba(26, 75, 110, 0.06);
  animation: fw-wave-drift 8s ease-in-out infinite;
}

.fw-wave-mid {
  fill: rgba(26, 107, 122, 0.05);
  animation: fw-wave-drift 10s ease-in-out infinite;
  animation-delay: -2s;
}

.fw-wave-front {
  fill: rgba(45, 155, 181, 0.04);
  animation: fw-wave-drift 12s ease-in-out infinite;
  animation-delay: -4s;
}

@keyframes fw-wave-drift {
  0% { transform: translateX(0); }
  50% { transform: translateX(-2%); }
  100% { transform: translateX(0); }
}

/* ── Nature Layer: Botanical SVG silhouettes ── */
.fw-nature-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.fw-plant-svg {
  position: absolute;
  width: 90px;
  height: 240px;
}

.fw-plant-r {
  right: 2%;
  bottom: 80px;
  transform: scaleX(1);
  animation: fw-sway 7s ease-in-out infinite;
  transform-origin: bottom center;
}

.fw-plant-l {
  left: 1%;
  bottom: 80px;
  transform: scaleX(-1);
  animation: fw-sway 9s ease-in-out infinite;
  animation-delay: -3s;
  transform-origin: bottom center;
}

@keyframes fw-sway {
  0%, 100% { transform: scaleX(1) rotate(0deg); }
  50% { transform: scaleX(1) rotate(1.5deg); }
}

.fw-plant-l {
  transform: scaleX(-1);
}

.fw-plant-l:hover,
.fw-plant-r:hover {
  transform: scaleX(1) rotate(2deg);
}

.fw-leaf-path {
  fill: rgba(46, 90, 39, 0.12);
  stroke: rgba(46, 90, 39, 0.22);
  stroke-width: 0.8;
}

.fw-leaf-2 {
  fill: rgba(46, 90, 39, 0.08);
  stroke: rgba(46, 90, 39, 0.16);
}

.fw-leaf-3 {
  fill: rgba(75, 130, 70, 0.07);
  stroke: rgba(75, 130, 70, 0.14);
}

.fw-stem {
  stroke: rgba(46, 90, 39, 0.25);
  stroke-width: 1.2;
}

/* ── Geometry Layer: Precision grid + shapes ── */
.fw-geometry-layer {
  position: absolute;
  top: 30%;
  right: 0;
  width: 55%;
  height: 70%;
  pointer-events: none;
  opacity: 0.35;
}

.fw-geo-svg {
  width: 100%;
  height: 100%;
}

.fw-geo-line {
  stroke: rgba(63, 91, 132, 0.12);
  stroke-width: 0.8;
}

.fw-geo-diamond {
  fill: none;
  stroke: rgba(192, 159, 88, 0.22);
  stroke-width: 1.2;
  animation: fw-geo-pulse 4s ease-in-out infinite;
}

.fw-geo-diamond:nth-child(2) {
  animation-delay: -1.5s;
}

.fw-geo-diamond:nth-child(3) {
  animation-delay: -3s;
}

@keyframes fw-geo-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.fw-geo-circle {
  fill: none;
  stroke: rgba(63, 91, 132, 0.08);
  stroke-width: 0.8;
  stroke-dasharray: 4 4;
}

/* ── World Indicator Badges ── */
.fw-world-badges {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.fw-badge {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fw-badge-space {
  color: var(--space-stardust);
  background: rgba(8, 14, 30, 0.7);
  border-color: var(--space-border);
}

.fw-badge-nature {
  color: var(--nature-leaf);
  background: rgba(26, 46, 26, 0.55);
  border-color: var(--nature-border);
}

.fw-badge-ocean {
  color: var(--ocean-light);
  background: rgba(10, 22, 40, 0.5);
  border-color: var(--ocean-border);
}

.fw-badge-geo {
  color: var(--geo-accent);
  background: rgba(245, 246, 248, 0.85);
  border-color: var(--geo-border);
}

/* ── Title + Typography overrides for fw-opening ── */
.fw-opening .opening-title.fw-title {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, var(--academic-navy) 0%, var(--space-indigo) 40%, var(--ocean-blue) 70%, var(--nature-botanical) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fw-opening .opening-subtitle.fw-subtitle {
  position: relative;
  z-index: 2;
}

.fw-opening .opening-tagline.fw-tagline {
  position: relative;
  z-index: 2;
}

/* ── Team heading ── */
.fw-team-heading {
  position: relative;
  z-index: 2;
}

/* ── Team Grid: all cards visible above ambient layers ── */
.fw-team-grid {
  position: relative;
  z-index: 2;
}

/* ── Team Card World Tones (subtle accent borders) ── */
.fw-team-card.fw-team-card-0 {
  border-top: 3px solid rgba(139, 158, 204, 0.5);
}

.fw-team-card.fw-team-card-1 {
  border-top: 3px solid rgba(94, 158, 98, 0.5);
}

.fw-team-card.fw-team-card-2 {
  border-top: 3px solid rgba(77, 196, 221, 0.5);
}

.fw-team-card.fw-team-card-3 {
  border-top: 3px solid rgba(192, 159, 88, 0.5);
}

/* ── CTA Section ── */
.fw-cta-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.fw-cta-btn {
  font-size: 1.08rem;
  padding: 16px 42px;
  background: linear-gradient(135deg, var(--academic-navy) 0%, var(--space-indigo) 100%);
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(35, 61, 91, 0.25), 0 2px 8px rgba(30, 45, 94, 0.15);
  letter-spacing: 0.04em;
  transition: all var(--transition-normal);
}

.fw-cta-btn:hover {
  background: linear-gradient(135deg, var(--academic-navy-dark) 0%, var(--space-violet) 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(35, 61, 91, 0.3), 0 4px 12px rgba(30, 45, 94, 0.18);
}

.fw-cta-hint {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}


/* ═══════════════════════════════════════════════════════════════
   02. CHAPTER LANDING PAGES — WORLD THEME BANNERS
   ═══════════════════════════════════════════════════════════════ */

/* ── Ch3 Banner: Ocean + Nature ── */
.chapter-hero-banner.ch3-world-banner {
  background: linear-gradient(135deg,
    rgba(10, 22, 40, 0.04) 0%,
    rgba(26, 46, 26, 0.03) 60%,
    rgba(255, 255, 255, 0) 100%
  ), #FFFFFF;
  border-left: 5px solid var(--ocean-cyan);
  border-top: 1px solid rgba(77, 196, 221, 0.2);
  overflow: visible;
  position: relative;
}

/* ── Ch4 Banner: Space + Geometry ── */
.chapter-hero-banner.ch4-world-banner {
  background: linear-gradient(135deg,
    rgba(8, 14, 30, 0.05) 0%,
    rgba(63, 91, 132, 0.03) 60%,
    rgba(255, 255, 255, 0) 100%
  ), #FFFFFF;
  border-left: 5px solid var(--space-stardust);
  border-top: 1px solid rgba(139, 158, 204, 0.2);
  position: relative;
  overflow: hidden;
}

/* Decorative background layer inside banners */
.ch-world-bg-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ch-deco-svg {
  position: absolute;
  pointer-events: none;
}

/* Ocean waves in Ch3 hero */
.ch-deco-waves {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
}

.ch-wave-shape {
  opacity: 0.6;
}

.ch-wave-a {
  fill: rgba(26, 75, 110, 0.07);
}

.ch-wave-b {
  fill: rgba(45, 155, 181, 0.05);
}

/* Nature leaf in Ch3 hero */
.ch-deco-leaf {
  right: 48px;
  top: 0;
  bottom: 0;
  width: 60px;
  height: 100%;
}

.ch-leaf-shape {
  fill: rgba(46, 90, 39, 0.1);
  stroke: rgba(46, 90, 39, 0.18);
  stroke-width: 1;
}

/* Geometry grid in Ch4 hero */
.ch-geo-grid-deco {
  position: absolute;
  inset: 0;
}

.ch-deco-geo {
  right: 0;
  top: 0;
  width: 300px;
  height: 300px;
  opacity: 0.5;
}

.ch-geo-line-d {
  stroke: rgba(63, 91, 132, 0.1);
  stroke-width: 0.8;
}

.ch-geo-diamond-d {
  fill: none;
  stroke: rgba(192, 159, 88, 0.25);
  stroke-width: 1;
}

.ch-geo-circle-d {
  fill: none;
  stroke: rgba(63, 91, 132, 0.08);
  stroke-width: 0.8;
  stroke-dasharray: 3 3;
}

/* Space stars in Ch4 hero */
.ch-space-star {
  position: absolute;
  border-radius: 50%;
  background: var(--space-stardust);
  animation: fw-twinkle ease-in-out infinite;
}

.ch-ss1 { width: 3px; height: 3px; top: 15%; right: 30%; animation-duration: 3s; opacity: 0.6; }
.ch-ss2 { width: 2px; height: 2px; top: 30%; right: 45%; animation-duration: 4s; animation-delay: -1s; opacity: 0.4; }
.ch-ss3 { width: 3px; height: 3px; top: 8%; right: 20%; animation-duration: 2.8s; animation-delay: -2s; opacity: 0.5; }

/* ── Banner Content Area ── */
.ch-world-banner-content {
  position: relative;
  z-index: 1;
}

.ch-world-num-label {
  font-size: 0.88rem !important;
}

.ch-world-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  color: var(--academic-navy);
  margin-bottom: 14px;
  line-height: 1.2;
}

.ch-world-desc {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 780px;
  margin-bottom: 22px;
  line-height: 1.65;
}

/* World Tag Chips */
.ch-world-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ch-world-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.ch-tag-ocean {
  background: rgba(26, 75, 110, 0.08);
  color: var(--ocean-blue);
  border-color: var(--ocean-border);
}

.ch-tag-nature {
  background: rgba(46, 90, 39, 0.08);
  color: var(--nature-botanical);
  border-color: var(--nature-border);
}

.ch-tag-space {
  background: rgba(30, 45, 94, 0.08);
  color: var(--space-indigo);
  border-color: var(--space-border);
}

.ch-tag-geo {
  background: rgba(63, 91, 132, 0.08);
  color: var(--geo-accent);
  border-color: var(--geo-border);
}


/* ═══════════════════════════════════════════════════════════════
   03. SECTION ENTRY CARDS — WORLD-THEMED
   ═══════════════════════════════════════════════════════════════ */

.ch-world-cards-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* World icon badge + label in card header */
.ch-sec-world-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.ch-sec-world-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Ocean section card */
.ch-world-sec-card.ch-sec-ocean {
  border-top: 3px solid var(--ocean-cyan);
}

.ch-world-sec-card.ch-sec-ocean:hover {
  border-color: var(--ocean-cyan);
  box-shadow: 0 12px 32px rgba(26, 75, 110, 0.1), 0 4px 12px rgba(45, 155, 181, 0.06);
}

/* Nature section card */
.ch-world-sec-card.ch-sec-nature {
  border-top: 3px solid var(--nature-leaf);
}

.ch-world-sec-card.ch-sec-nature:hover {
  border-color: var(--nature-leaf);
  box-shadow: 0 12px 32px rgba(46, 90, 39, 0.1), 0 4px 12px rgba(94, 158, 98, 0.06);
}

/* Space section card */
.ch-world-sec-card.ch-sec-space {
  border-top: 3px solid var(--space-stardust);
}

.ch-world-sec-card.ch-sec-space:hover {
  border-color: var(--space-stardust);
  box-shadow: 0 12px 32px rgba(30, 45, 94, 0.1), 0 4px 12px rgba(139, 158, 204, 0.06);
}

/* Geometry section card */
.ch-world-sec-card.ch-sec-geo {
  border-top: 3px solid var(--geo-accent);
}

.ch-world-sec-card.ch-sec-geo:hover {
  border-color: var(--geo-accent);
  box-shadow: 0 12px 32px rgba(63, 91, 132, 0.1), 0 4px 12px rgba(63, 91, 132, 0.06);
}

/* Enter buttons — world toned */
.ch-world-enter-btn {
  background: var(--bg-pure-white);
  color: var(--academic-navy);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--transition-normal);
}

.ch-world-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ch-world-enter-btn.ch-sec-ocean:hover {
  background: rgba(26, 75, 110, 0.06);
  border-color: var(--ocean-border);
  color: var(--ocean-blue);
}

.ch-world-enter-btn.ch-sec-nature:hover {
  background: rgba(46, 90, 39, 0.06);
  border-color: var(--nature-border);
  color: var(--nature-botanical);
}

.ch-world-enter-btn.ch-sec-space:hover {
  background: rgba(30, 45, 94, 0.07);
  border-color: var(--space-border);
  color: var(--space-indigo);
}

.ch-world-enter-btn.ch-sec-geo:hover {
  background: var(--geo-glow);
  border-color: var(--geo-border);
  color: var(--geo-accent);
}


/* ═══════════════════════════════════════════════════════════════
   04. RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .fw-plant-svg {
    width: 60px;
    height: 160px;
  }

  .fw-plant-r {
    right: 0;
  }

  .fw-plant-l {
    left: 0;
  }

  .fw-world-badges {
    gap: 6px;
  }

  .fw-badge {
    font-size: 0.62rem;
    padding: 3px 9px;
  }

  .ch-world-cards-grid {
    grid-template-columns: 1fr;
  }

  .ch-world-tags {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .fw-plant-svg {
    display: none;
  }

  .fw-geometry-layer {
    display: none;
  }

  .fw-world-badges {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   05. REDUCED MOTION OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .fw-star,
  .fw-wave,
  .fw-plant-r,
  .fw-plant-l,
  .fw-geo-diamond,
  .fw-cta-btn {
    animation: none !important;
    transition: none !important;
  }
}
