/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --primary: #0d3b66;
  --primary-hover: #0a2f52;
  --secondary: #1a73e8;
  --secondary-hover: #1557b0;
  --accent: #f4a261;
  --bg: #f8f9ff;
  --dark-bg: #0f0f1a;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --success: #2ecc71;
  --highlight: #fef3c7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Inter', system-ui, sans-serif;
  --font-sinhala: 'Noto Sans Sinhala', 'Iskoola Pota', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --card-bg: #1a1a2e;
    --text: #f0f0ff;
    --text-muted: #9ca3af;
    --border: #2d2d40;
    --highlight: #1e3a5f;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,.25);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.3);
  }
}

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

/* ===== SKIP LINK (WCAG) ===== */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== SR-ONLY ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
@media (min-width: 1024px) { .container { padding: 0 48px; } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--transition);
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); color: var(--primary); margin-bottom: 12px; font-weight: 700; }
.section-header p { font-size: 17px; color: var(--text-muted); max-width: 560px; margin: 0 auto; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
@media (prefers-color-scheme: dark) {
  .navbar { background: rgba(15,15,26,0.92); }
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.nav-logo:hover { opacity: 0.8; }
.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-cta { display: none; margin-left: 8px; }
@media (min-width: 768px) { .nav-cta { display: inline-flex; } }
.hamburger { display: flex; align-items: center; margin-left: auto; padding: 8px; color: var(--text); min-width: 44px; min-height: 44px; justify-content: center; }
@media (min-width: 768px) { .hamburger { display: none; } }
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 20px 20px;
  gap: 4px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; color: var(--text); transition: background var(--transition); min-height: 44px; display: flex; align-items: center; }
.mobile-menu a:hover { background: var(--bg); }
.mobile-menu .btn { margin-top: 8px; justify-content: center; }

/* ===== HERO ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 60px 20px 80px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero { grid-template-columns: 1fr 1fr; padding: 80px 48px 100px; gap: 60px; }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #dbeafe;
  color: var(--secondary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}
@media (prefers-color-scheme: dark) { .hero-badge { background: #1e3a5f; } }
.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-content h1 .highlight {
  color: var(--secondary);
  position: relative;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 560px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Device mockup */
.hero-visual { display: flex; justify-content: center; }
.device-mockup {
  width: 100%;
  max-width: 440px;
  background: #1a1a2e;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 24px 64px rgba(13,59,102,0.25), 0 8px 16px rgba(0,0,0,0.2);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) { .device-mockup { animation: none; } }
.device-screen { background: var(--card-bg); border-radius: 12px; overflow: hidden; }
.mock-reader { padding: 16px; }
.mock-controls { display: flex; gap: 8px; margin-bottom: 16px; padding: 8px; background: #f0f0f8; border-radius: 8px; }
.mock-btn { height: 12px; width: 60px; border-radius: 6px; background: #0d3b66; }
.mock-play { background: #2ecc71; width: 80px; }
.mock-content { padding: 4px; }
.mock-chapter-title { height: 18px; background: #0d3b66; border-radius: 4px; margin-bottom: 12px; width: 80%; font-family: var(--font-sinhala); color: #fff; font-size: 11px; display: flex; align-items: center; padding: 0 8px; }
.mock-summary-box { height: 40px; background: #dbeafe; border-left: 3px solid #1a73e8; border-radius: 4px; margin-bottom: 10px; }
.mock-text { height: 10px; background: #e5e7eb; border-radius: 3px; margin-bottom: 8px; }
.mock-text-short { width: 70%; }

/* ===== UNICEF SECTION ===== */
.unicef-section { background: #dbeafe; padding: 48px 0; }
@media (prefers-color-scheme: dark) { .unicef-section { background: #1e3a5f; } }
.unicef-card { display: flex; gap: 32px; align-items: flex-start; background: var(--card-bg); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-md); }
@media (max-width: 768px) { .unicef-card { flex-direction: column; padding: 28px; } }
.unicef-icon { flex-shrink: 0; width: 64px; height: 64px; background: #dbeafe; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
@media (prefers-color-scheme: dark) { .unicef-icon { background: #1e3a5f; } }
.unicef-text h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.unicef-text p { color: var(--text-muted); margin-bottom: 14px; line-height: 1.75; font-size: 16px; }
.unicef-link { display: inline-flex; align-items: center; gap: 6px; color: var(--secondary); font-weight: 600; font-size: 15px; transition: gap var(--transition); }
.unicef-link:hover { gap: 10px; text-decoration: underline; }

/* ===== HOW IT WORKS ===== */
.how-section { padding: 80px 0; }
.steps-grid { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.step-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  flex: 1;
  min-width: 220px;
  max-width: 300px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step-num {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 48px;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  pointer-events: none;
}
.step-icon { margin-bottom: 20px; padding: 12px; background: #f0f4ff; border-radius: var(--radius-sm); display: inline-block; }
@media (prefers-color-scheme: dark) { .step-icon { background: #1e2a3a; } }
.step-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.step-card p { color: var(--text-muted); font-size: 15px; line-height: 1.65; }
.step-arrow { color: var(--secondary); flex-shrink: 0; opacity: 0.5; }
@media (max-width: 768px) { .step-arrow { transform: rotate(90deg); } }

/* ===== FEATURES GRID ===== */
.features-section { padding: 80px 0; background: var(--card-bg); }
@media (prefers-color-scheme: dark) { .features-section { background: #13131f; } }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 32px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); border-color: var(--secondary); transform: translateY(-2px); }
.feature-icon { margin-bottom: 16px; width: 52px; height: 52px; background: var(--card-bg); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 14px; line-height: 1.65; }

/* ===== TECH GRID ===== */
.tech-section { padding: 40px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tech-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: center; }
.tech-item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); padding: 8px 16px; background: var(--card-bg); border-radius: 999px; border: 1px solid var(--border); transition: all var(--transition); }
.tech-item:hover { border-color: var(--secondary); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ===== DEMO SECTION ===== */
.demo-section { padding: 80px 0; }
.demo-preview { background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; margin-bottom: 32px; border: 1px solid var(--border); }
.browser-chrome { background: #f3f4f6; padding: 12px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { .browser-chrome { background: #1a1a2e; } }
.browser-dots { display: flex; gap: 6px; }
.browser-dots span { width: 12px; height: 12px; border-radius: 50%; }
.browser-dots span:nth-child(1) { background: #ef4444; }
.browser-dots span:nth-child(2) { background: #f59e0b; }
.browser-dots span:nth-child(3) { background: #22c55e; }
.browser-url { font-size: 12px; color: var(--text-muted); font-family: monospace; background: var(--card-bg); padding: 4px 12px; border-radius: 4px; border: 1px solid var(--border); }
.demo-screen { display: flex; min-height: 280px; }
.demo-sidebar { width: 200px; border-right: 1px solid var(--border); padding: 16px; background: var(--bg); flex-shrink: 0; }
@media (max-width: 600px) { .demo-sidebar { display: none; } }
.demo-sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; font-size: 13px; color: var(--text-muted); font-family: var(--font-sinhala); margin-bottom: 4px; }
.demo-sidebar-item.demo-active { background: var(--primary); color: #fff; font-weight: 600; }
.demo-ch-num { width: 24px; height: 24px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--font-body); flex-shrink: 0; }
.demo-sidebar-item:not(.demo-active) .demo-ch-num { background: var(--border); }
.demo-content { flex: 1; padding: 20px; }
.demo-controls-bar { margin-bottom: 16px; }
.demo-btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.demo-play-btn { background: #2ecc71; color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.demo-font-btns { display: flex; gap: 4px; font-weight: 600; font-size: 12px; color: var(--text-muted); letter-spacing: 1px; }
.demo-chapter-text h3 { font-size: 15px; color: var(--primary); margin-bottom: 10px; font-family: var(--font-sinhala); font-weight: 700; }
.demo-chapter-text p { font-size: 15px; color: var(--text-muted); font-family: var(--font-sinhala); line-height: 1.9; }
.demo-actions { text-align: center; }
.demo-note { margin-top: 12px; font-size: 14px; color: var(--text-muted); }

/* ===== AUTHOR SECTION ===== */
.author-section { padding: 64px 0; background: var(--primary); }
.author-card { display: flex; gap: 32px; align-items: center; max-width: 680px; margin: 0 auto; }
@media (max-width: 600px) { .author-card { flex-direction: column; text-align: center; align-items: center; } }
.author-avatar {
  width: 80px; height: 80px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  flex-shrink: 0;
}
.author-info h2 { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.author-info p { color: rgba(255,255,255,0.8); line-height: 1.7; margin-bottom: 16px; font-size: 15px; }
.author-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; font-size: 15px; transition: gap var(--transition); }
.author-link:hover { gap: 12px; text-decoration: underline; }

/* ===== FOOTER ===== */
.footer { background: #0a0a14; padding: 40px 0; }
.footer-content { text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer-disclaimer { color: rgba(255,255,255,0.5); font-size: 13px; max-width: 500px; margin: 0 auto 8px; line-height: 1.6; }
.footer-copy { color: rgba(255,255,255,0.35); font-size: 12px; }

/* ===== RESPONSIVE 375px ===== */
@media (max-width: 375px) {
  .hero { padding: 40px 16px 60px; }
  .hero-content h1 { font-size: 1.75rem; }
  .hero-subtitle { font-size: 16px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  .unicef-card { padding: 20px; }
  .step-card { padding: 28px 20px; }
}
