/* ============================================
   STEM-Up | אתר מדע וטכנולוגיה | style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800;900&display=swap');

/* === CSS VARIABLES === */
:root {
  --bg:           #F4F7FF;
  --bg-surface:   #FFFFFF;
  --bg-card:      #FFFFFF;
  --bg-glass:     rgba(0, 0, 0, 0.03);

  --chemistry:    #7C3AED;
  --chemistry-glow: rgba(124, 58, 237, 0.15);
  --physics:      #2563EB;
  --physics-glow: rgba(37, 99, 235, 0.15);
  --biology:      #059669;
  --biology-glow: rgba(5, 150, 105, 0.15);

  --grade7:       #0284C7;
  --grade8:       #D97706;
  --grade9:       #DC2626;

  --accent:       #2563EB;
  --accent-glow:  rgba(37, 99, 235, 0.15);

  --text:         #1E293B;
  --text-muted:   #64748B;
  --text-faint:   #94A3B8;

  --border:       rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);

  --nav-h:        68px;
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --transition:   0.3s var(--ease);
  --max-w:        1180px;
}

/* Subject themes */
[data-subject="chemistry"] { --subject: var(--chemistry); --subject-glow: var(--chemistry-glow); }
[data-subject="physics"]   { --subject: var(--physics);   --subject-glow: var(--physics-glow); }
[data-subject="biology"]   { --subject: var(--biology);   --subject-glow: var(--biology-glow); }

/* Grade themes */
[data-grade="7"] { --grade-color: var(--grade7); }
[data-grade="8"] { --grade-color: var(--grade8); }
[data-grade="9"] { --grade-color: var(--grade9); }

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  direction: rtl;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Heebo', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle dot pattern background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p  { color: var(--text-muted); }

/* === LAYOUT === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  margin-bottom: 0.75rem;
}

.section-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Section divider line */
.section-header .divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 1rem auto 0;
  border-radius: 99px;
}

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 2rem;
}

/* Logo: first in source = right side in RTL */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}
.nav-logo:hover img { filter: drop-shadow(0 0 10px var(--accent-glow)); transform: scale(1.04); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-end: auto; /* pushes links to the left end in RTL */
}

.nav-links > li { position: relative; }

.nav-links > li > a,
.nav-links > li > button {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
  background: none;
}

.nav-links > li > a:hover,
.nav-links > li > button:hover,
.nav-links > li > a.active {
  color: var(--text);
  background: var(--bg-glass);
}

.nav-links > li > a.active {
  color: var(--accent);
}

/* Dropdown */
.dropdown-toggle svg { transition: transform 0.25s ease; }
.dropdown.open .dropdown-toggle svg { transform: rotate(180deg); }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  animation: dropFade 0.2s ease;
}

.dropdown.open .dropdown-menu { display: block; }

@keyframes dropFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-menu li a {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.dropdown-menu li a:hover {
  color: var(--text);
  background: var(--bg-glass);
}

/* Hamburger (mobile only) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-inline-start: auto;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-hamburger:hover { background: var(--bg-glass); }

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 99px;
  transition: var(--transition);
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 1.5rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu.open { display: flex; }

.mobile-menu a,
.mobile-menu button {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: right;
  width: 100%;
  background: none;
}

.mobile-menu a:hover,
.mobile-menu button:hover { color: var(--text); background: var(--bg-glass); }

.mobile-submenu {
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-submenu a {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* === HERO (Homepage) === */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 10, 30, 0.55) 0%,
    rgba(5, 10, 30, 0.35) 50%,
    rgba(5, 10, 30, 0.80) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  animation: heroFadeIn 1.2s ease forwards;
}

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

.hero-logo {
  height: 220px;
  width: auto;
  max-width: 560px;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(56, 189, 248, 0.5));
  animation: float 6s ease-in-out infinite;
}

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

.hero-tagline {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.05em;
  text-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

.hero-tagline span {
  font-weight: 700;
  color: var(--accent);
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  animation: bounce 2s ease-in-out infinite;
}

.hero-scroll svg { opacity: 0.6; }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 99px;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #080C18;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px var(--accent-glow), 0 8px 25px rgba(0,0,0,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-hover);
}

.btn-secondary:hover {
  background: var(--bg-glass);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

/* === GRADE CARDS (Homepage) === */
.grades-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.grade-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, var(--grade-color, var(--accent)) 0%, transparent 65%);
  opacity: 0.06;
  transition: opacity 0.4s ease;
}

.grade-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: var(--grade-color, var(--accent));
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: 0 0 20px var(--grade-color, var(--accent));
  transition: var(--transition);
}

.grade-card:hover {
  border-color: var(--grade-color, var(--accent));
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.grade-card:hover::before { opacity: 0.12; }

.grade-badge {
  font-size: 3rem;
  font-weight: 900;
  color: var(--grade-color, var(--accent));
  line-height: 1;
  text-shadow: 0 0 20px currentColor;
}

.grade-title { font-size: 1.2rem; font-weight: 700; }
.grade-desc  { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

.grade-subjects {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.subject-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.subject-tag.chem { background: rgba(168,85,247,0.12); color: var(--chemistry); border-color: rgba(168,85,247,0.3); }
.subject-tag.phys { background: rgba(96,165,250,0.12); color: var(--physics);   border-color: rgba(96,165,250,0.3); }
.subject-tag.bio  { background: rgba(52,211,153,0.12); color: var(--biology);   border-color: rgba(52,211,153,0.3); }

.grade-arrow {
  margin-top: auto;
  color: var(--grade-color, var(--accent));
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform 0.25s ease;
}
.grade-card:hover .grade-arrow { transform: translateX(-6px); }

/* === PAGE HERO (inner pages) === */
.page-hero {
  padding: calc(var(--nav-h) + 3rem) 0 4rem;
  position: relative;
  z-index: 1;
  text-align: center;
  background: linear-gradient(180deg, rgba(37,99,235,0.04) 0%, transparent 100%);
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, var(--grade-color, var(--subject, var(--accent))), transparent 65%);
  opacity: 0.06;
  pointer-events: none;
  filter: blur(40px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.4; }

.page-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px currentColor);
}

.page-hero h1 {
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text), var(--subject, var(--grade-color, var(--accent))));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

/* === SUBJECT CARDS (Grade pages) === */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: all 0.35s var(--ease);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--s-color, var(--accent));
  box-shadow: 0 0 15px var(--s-color, var(--accent));
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}

.subject-card:hover::before { transform: scaleX(1); }

.subject-card:hover {
  border-color: var(--s-color, var(--accent));
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.subject-card.chem { --s-color: var(--chemistry); --s-glow: var(--chemistry-glow); }
.subject-card.phys { --s-color: var(--physics);   --s-glow: var(--physics-glow); }
.subject-card.bio  { --s-color: var(--biology);   --s-glow: var(--biology-glow); }

.subject-card-icon {
  font-size: 3rem;
  display: block;
  transition: transform 0.35s ease;
}
.subject-card:hover .subject-card-icon { transform: scale(1.15) rotate(-5deg); }

.subject-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--s-color, var(--text));
}

.subject-card p {
  font-size: 0.875rem;
  line-height: 1.6;
}

.subject-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--s-color, var(--accent));
  margin-top: auto;
  transition: gap 0.25s ease;
}
.subject-card:hover .subject-card-link { gap: 0.7rem; }

/* === TOPIC CARDS (Subject pages) === */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--subject, var(--accent)) 0%, transparent 70%);
  opacity: 0.08;
  transform: translate(30px, -30px);
  transition: opacity 0.3s ease;
}

.topic-card:hover {
  border-color: var(--subject, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.1);
}

.topic-card:hover::before { opacity: 0.15; }

.topic-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--subject, var(--accent));
  opacity: 0.4;
  line-height: 1;
  flex-shrink: 0;
  min-width: 2rem;
  text-align: center;
}

.topic-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.topic-body p {
  font-size: 0.875rem;
  line-height: 1.65;
}

.topic-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.topic-tag {
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* === GALLERY === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.gallery-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.gallery-thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.gallery-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--t-color, var(--accent)) 0%, transparent 100%);
  opacity: 0.15;
}

.gallery-info {
  padding: 1.25rem;
}

.gallery-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.gallery-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s ease;
}
.gallery-card:hover .gallery-link { gap: 0.6rem; }

/* External links section */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.link-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.link-item:hover {
  border-color: var(--accent);
  transform: translateX(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.link-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.link-info h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.link-info p  { font-size: 0.8rem; }

.link-arrow {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform 0.25s ease;
}
.link-item:hover .link-arrow { transform: translateX(-5px); color: var(--accent); }

/* === TEACHERS PAGE === */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.resource-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: var(--r-color, var(--accent));
  box-shadow: 0 0 20px var(--r-color, var(--accent));
}

.resource-card[data-grade="7"] { --r-color: var(--grade7); }
.resource-card[data-grade="8"] { --r-color: var(--grade8); }
.resource-card[data-grade="9"] { --r-color: var(--grade9); }

.resource-card:hover {
  border-color: var(--r-color, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.resource-icon { font-size: 2.5rem; }
.resource-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.resource-desc  { font-size: 0.875rem; line-height: 1.6; }

/* === ABOUT PAGE === */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h2 { margin-bottom: 1.25rem; }
.about-text p  { margin-bottom: 1rem; }

.stem-pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.pillar-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.pillar-letter {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.pillar-card:nth-child(1) .pillar-letter { color: var(--chemistry); }
.pillar-card:nth-child(2) .pillar-letter { color: var(--physics); }
.pillar-card:nth-child(3) .pillar-letter { color: var(--biology); }
.pillar-card:nth-child(4) .pillar-letter { color: var(--grade8); }

.pillar-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.pillar-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Stats row */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 4rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.stat-label { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.35rem; }

/* === GALLERY TEASER (Homepage) === */
.teaser-strip {
  display: flex;
  gap: 1rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.teaser-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  flex: 1;
  min-width: 200px;
  text-align: center;
  font-size: 3rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.teaser-card:hover {
  border-color: var(--border-hover);
  transform: scale(1.03);
}

/* === FOOTER === */
.footer {
  position: relative;
  z-index: 1;
  margin-top: 4rem;
}

.footer-inner { display: none; }

.footer-bottom {
  background: #1a2f6e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* === ANIMATIONS === */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }
.fade-in-delay-6 { transition-delay: 0.6s; }

/* Glow pulse for important elements */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px var(--subject, var(--accent-glow)); }
  50%       { box-shadow: 0 0 40px var(--subject, var(--accent-glow)); }
}

/* === BACK BUTTON === */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  transition: var(--transition);
  margin-bottom: 2rem;
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-glass);
  transform: translateX(4px);
}

/* === HIGHLIGHT BOX === */
.highlight-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(37,99,235,0.02));
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(37,99,235,0.08);
}

.highlight-box::before {
  content: '';
  position: absolute;
  top: -50px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 100px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.15), transparent 70%);
  pointer-events: none;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .grades-grid { grid-template-columns: 1fr; gap: 1rem; }
  .subjects-grid { grid-template-columns: 1fr; max-width: 480px; }
  .about-intro { grid-template-columns: 1fr; gap: 2rem; }
  .about-intro > div:last-child { order: -1; } /* video above text on mobile */
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .stem-pillars { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .section { padding: 4rem 0; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .subjects-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 2.5rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .topics-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; }
}

@media (max-width: 480px) {
  .grades-grid { gap: 0.75rem; }
  .stem-pillars { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; gap: 2rem; }
}

/* === MOBILE ENHANCEMENTS === */

/* Hero logo — smaller on phones */
@media (max-width: 768px) {
  .hero-logo {
    height: 160px !important;
    max-width: 85vw;
  }
  .hero-content::before {
    width: 100vw;
    height: 300px;
  }
  .hero-tagline {
    font-size: clamp(1.2rem, 5vw, 1.6rem) !important;
  }
}

@media (max-width: 480px) {
  .hero-logo {
    height: 130px !important;
  }
}

/* Grade cards — tighter on mobile */
@media (max-width: 640px) {
  .grade-card {
    padding: 1.75rem 1.25rem;
  }
  .grade-badge {
    font-size: 2.25rem;
  }
}

/* Materials grid — force single column on narrow phones */
@media (max-width: 400px) {
  .materials-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) {
  .btn,
  .material-card .material-download,
  .g-tab,
  .nav-hamburger {
    min-height: 44px;
  }
  /* Remove hover-only transforms on touch devices */
  .grade-card:hover,
  .subject-card:hover,
  .material-card:hover {
    transform: none;
  }
}

/* Containers — extra side padding on very small screens */
@media (max-width: 360px) {
  .container,
  .page-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .section { padding: 3rem 0; }
  .grade-card { padding: 1.5rem 1rem; }
}

/* Footer bottom — stack on small screens */
@media (max-width: 480px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1.5rem;
    gap: 0.35rem;
  }
}

/* Breadcrumb — wrap cleanly */
@media (max-width: 480px) {
  .breadcrumb {
    font-size: 0.78rem;
    gap: 0.3rem;
  }
}

/* Section headers — tighter on mobile */
@media (max-width: 640px) {
  .section-header {
    margin-bottom: 2rem;
  }
  .page-hero p {
    font-size: 0.95rem;
  }
}
