/* ==========================================================================
   STEM Tuition – Pokhara, Nepal
   Refactored Core Stylesheet & Design System Standard
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & GLOBAL CORE TOKENS
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand Gradient Tokens */
  --bg-gradient-1: #070b24;
  --bg-gradient-2: #0d143a;
  --bg-gradient-3: #05081c;
  --dynamic-accent-1: #00d4ff;
  --dynamic-accent-2: #ff7700;
  --dynamic-accent-3: #00e8a2;
  
  /* Color Palette */
  --navy: #080d2a;
  --navy2: #0f1642;
  --navy3: #16205a;
  --orange: #ff7700;
  --amber: #ffaa00;
  --amber-gold: #ffd700;
  --cyan: #00d4ff;
  --green: #00e8a2;
  --pink: #ff5e7e;
  --purple: #a855f7;
  --white: #f5f8ff;
  --muted: #9ba8d0;
  --card: rgba(20, 28, 75, 0.65);
  --border: rgba(0, 212, 255, 0.25);

  /* RULES.md v5.0 Mandatory Design System Tokens */
  --bg-dark: #070a14;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
  background-attachment: fixed;
  background-color: var(--bg-dark, #070a14);
  color: var(--white);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background 1.5s ease-in-out;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 170, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 170, 0, 0.05) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 50px 50px, 50px 50px, auto;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   2. BACKGROUND CANVAS FIXED STACKING LAYER STANDARD
   -------------------------------------------------------------------------- */
/* STEM Tuition Canvas Visibility Rule */
#bg-canvas, canvas {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

#stemBackgroundCanvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1 !important; /* Layer 1: Above body bg, below UI content */
  pointer-events: none !important;
}

#bg-canvas.bg-disabled, canvas.bg-disabled, #stemBackgroundCanvas.bg-disabled {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Interactive UI Content (Layer 2) */
nav, main, header, footer, section, .hero-section, .hero, .page-hero, .container, .card, .soft-card, .class-card {
  position: relative;
  z-index: 2;
}

.stem-corner-widget, .stem-bg-toast {
  z-index: 999999 !important;
}

/* FULLSCREEN COSMIC VIEW HIDE ALL HTML CONTENT STANDARD */
body.cosmic-view-active nav,
body.cosmic-view-active main,
body.cosmic-view-active header,
body.cosmic-view-active footer,
body.cosmic-view-active section,
body.cosmic-view-active .hero,
body.cosmic-view-active #scroll-progress,
body.cosmic-view-active .reveal-on-scroll,
body.cosmic-view-active #stem-dyk-widget,
body.cosmic-view-active .stem-didyouknow-floating,
body.cosmic-view-active #pioneers,
body.cosmic-view-active .pioneers-grid,
body.cosmic-view-active .pioneer-card,
body.cosmic-view-active .pioneer-spotlight-modal,
body.cosmic-view-active #pioneerSpotlight,
body.cosmic-view-active .modal-card,
body.cosmic-view-active dialog {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.cosmic-view-active {
  background: #000000 !important;
  overflow: hidden !important;
}

body.cosmic-view-active #stemBackgroundCanvas,
body.cosmic-view-active canvas {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   3. NAVIGATION HEADER
   -------------------------------------------------------------------------- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 6%;
  background: rgba(10, 15, 46, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--amber), var(--orange), var(--cyan), var(--green), var(--amber));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  animation: gradientFlow 6s ease infinite;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-cta {
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #080d2a;
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.4);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(255, 170, 0, 0.6);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: 0.3s;
}

/* --------------------------------------------------------------------------
   4. HERO & SECTIONS
   -------------------------------------------------------------------------- */
.hero, .page-hero, .page-header {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 6% 4rem;
  position: relative;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  animation: drift 10s ease-in-out infinite alternate;
}

.blob1 {
  width: 520px;
  height: 520px;
  background: rgba(255, 170, 0, 0.28);
  top: -120px;
  left: -180px;
}

.blob2 {
  width: 420px;
  height: 420px;
  background: rgba(255, 119, 0, 0.24);
  bottom: -80px;
  right: -120px;
  animation-delay: -3s;
}

.blob3 {
  width: 320px;
  height: 320px;
  background: rgba(255, 215, 0, 0.2);
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -6s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 40px) scale(1.07); }
}

.hero-tag, .header-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 170, 0, 0.12);
  border: 1px solid rgba(255, 170, 0, 0.35);
  color: var(--amber);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.6rem;
  animation: fadeUp 0.7s ease both;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  animation: fadeUp 0.8s 0.1s ease both;
}

h1 .accent, h2 .accent {
  background: linear-gradient(90deg, #ffaa00, #ff7700, #ffd700, #00e8a2, #00d4ff, #ffaa00);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 6s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-sub, .page-sub, .header-sub {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 580px;
  line-height: 1.7;
  animation: fadeUp 0.85s 0.2s ease both;
}

.hero-btns, .header-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 2.4rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 0.9s 0.3s ease both;
}

/* --------------------------------------------------------------------------
   5. BUTTONS & CONTROLS (HIGH CONTRAST DARK DYNAMIC)
   -------------------------------------------------------------------------- */
.btn-primary, .btn, .submit-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  display: inline-block;
  border: 1.5px solid #38bdf8 !important;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.btn-primary:hover, .submit-btn:hover {
  transform: translateY(-3px) scale(1.02) !important;
  background: linear-gradient(135deg, #0369a1, #075985) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.65), inset 0 0 15px rgba(56, 189, 248, 0.3) !important;
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(14, 25, 58, 0.9), rgba(8, 14, 38, 0.95)) !important;
  border: 1.5px solid var(--glass-border) !important;
  color: #ffffff !important;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  display: inline-block;
}

.btn-secondary:hover {
  border-color: #38bdf8 !important;
  background: linear-gradient(135deg, rgba(20, 36, 80, 0.95), rgba(12, 20, 50, 0.98)) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.4) !important;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 1s 0.45s ease both;
}

.stat { text-align: center; }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--amber), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   6. LAYOUT GRIDS & CARDS FOUNDATION
   -------------------------------------------------------------------------- */
section {
  padding: 6rem 6%;
  position: relative;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.8rem;
}

h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
}

h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.step:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.18);
  border-color: var(--cyan);
}

.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #ffffff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
}

.step-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.step-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.section-intro {
  color: var(--muted);
  max-width: 540px;
  margin-top: 0.8rem;
  line-height: 1.7;
}

.classes-grid, .why-grid, .features-grid, .resources-showcase, .video-grid, .reviews-grid, .syllabus-grid, .contact-cards, .social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

/* Glassmorphism Elevation Standard & Uniform Radius Rule */
.class-card, .why-card, .card, .resource-card, .video-card, .review-card, .review-form, .contact-card, .form-container, .faq-item, .info-panel, .social-panel, .calc-card, .quiz-container, .stem-widget, .soft-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px !important;
  padding: 2.2rem 2rem !important;
  position: relative;
  overflow: visible !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Estimator Plan Builder Expansion */
.calc-card {
  max-width: 1000px;
  margin: 0 auto;
}

.grade-opt-btn {
  padding: 0.75rem 1rem !important;
  font-size: 0.88rem !important;
  line-height: 1.4 !important;
  border-radius: 12px !important;
}

.subject-toggle {
  padding: 0.6rem 1rem !important;
  font-size: 0.88rem !important;
  border-radius: 20px !important;
}

#calcGradeTitle { font-size: 1.15rem !important; line-height: 1.4 !important; }
#calcDetailsText { font-size: 0.92rem !important; margin-top: 0.3rem !important; line-height: 1.5 !important; }
#calcEstFee { font-size: 0.95rem !important; margin-top: 0.3rem !important; }

/* STEM Quiz Container Expansion */
.quiz-container {
  max-width: 760px;
  margin: 0 auto;
}

#quizQuestionText {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.55 !important;
  margin: 1.2rem 0 !important;
  color: var(--white) !important;
}

.quiz-option-btn, .quiz-btn, #quizOptionsContainer button {
  padding: 1rem 1.4rem !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  border-radius: 14px !important;
  margin-bottom: 0.75rem !important;
  width: 100% !important;
  text-align: left !important;
  line-height: 1.4 !important;
}

/* STEM Quick Tool Converter & Matrix Expansion */
.stem-widget {
  max-width: 920px;
  margin: 0 auto;
}

#convertValue, #convertType {
  padding: 0.85rem 1.1rem !important;
  font-size: 0.95rem !important;
  border-radius: 12px !important;
}

#convertResult {
  padding: 0.85rem 1.2rem !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  text-decoration: none;
  color: var(--white);
}

.contact-card:hover {
  transform: translateX(5px);
  border-color: var(--amber);
  box-shadow: 0 0 25px rgba(255, 170, 0, 0.25);
}

.contact-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ci-blue { background: rgba(255, 170, 0, 0.18); color: var(--amber); }
.ci-green { background: rgba(0, 232, 162, 0.18); }
.ci-red { background: rgba(255, 94, 126, 0.18); }
.ci-cyan { background: rgba(0, 212, 255, 0.18); }

.contact-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.contact-card-val {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.contact-card-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   7. FORM CONTROLS & INPUTS
   -------------------------------------------------------------------------- */
.form-container {
  max-width: 540px;
  margin: 2.5rem auto;
  padding: 2.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--white);
}

.form-input, .form-textarea, .form-select, select.form-select {
  width: 100%;
  background: rgba(10, 15, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select option {
  background: #0d143a;
  color: var(--white);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.3);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #080d2a;
  padding: 0.9rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   8. FOOTER & RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
footer {
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--border);
  padding: 2.5rem 6%;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 260px;
  margin-top: 0.4rem;
}

.footer-links h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  color: var(--amber);
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--amber);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

@media(max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 15, 46, 0.97);
    padding: 1.5rem 6%;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .contact-layout { grid-template-columns: 1fr; }
  .social-banner { flex-direction: column; }
  .social-links { justify-content: center; }
}
