/* =====================================================
   English Grammar Quiz — Global Design System
   ===================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Primary Palette */
  --primary-50: #eef2ff;
  --primary-100: #dbe4ff;
  --primary-200: #bfcfff;
  --primary-300: #93aeff;
  --primary-400: #6382fc;
  --primary-500: #4361ee;
  --primary-600: #2d41d9;
  --primary-700: #2533b8;
  --primary-800: #242e95;
  --primary-900: #1e2670;

  /* Accent */
  --accent-400: #7c3aed;
  --accent-500: #6d28d9;
  --accent-600: #5b21b6;

  /* Teal */
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;

  /* Success / Warning / Error */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Neutrals */
  --bg-base: #0a0e1a;
  --bg-surface: #111827;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(67, 97, 238, 0.25);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Container */
  --max-width: 1200px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(67, 97, 238, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(125, 58, 237, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(45, 212, 191, 0.06) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

a {
  color: var(--primary-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--teal-400);
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ── Header / Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-400));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-400), var(--teal-400));
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile Nav Close (hidden on desktop) */
.nav-close {
  display: none;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 26px;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-base);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--accent-400));
  color: #fff;
  box-shadow: 0 4px 20px rgba(67, 97, 238, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(67, 97, 238, 0.5);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-400);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary-400);
  border: 2px solid var(--primary-400);
}

.btn-outline:hover {
  background: var(--primary-500);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ── Section Styles ── */
.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 1rem;
  background: rgba(67, 97, 238, 0.12);
  border: 1px solid rgba(67, 97, 238, 0.25);
  border-radius: var(--radius-full);
  color: var(--primary-400);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: var(--space-md);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-socials {
  display: flex;
  gap: var(--space-md);
}

.footer-socials a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-base);
}

.footer-socials a:hover {
  background: var(--primary-500);
  color: #fff;
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

/* ── Google Ads Slots ── */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-xl) auto;
  max-width: 728px;
  min-height: 90px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  overflow: hidden;
}

.ad-slot-sidebar {
  max-width: 300px;
  min-height: 250px;
}

.ad-slot-inline {
  max-width: 100%;
  min-height: 100px;
}

/* ── Utility ── */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-400), var(--accent-400), var(--teal-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

/* ── Legal Page Styles ── */
.legal-page {
  padding: var(--space-3xl) 0;
}

.legal-page .container {
  max-width: 800px;
}

.legal-page h1 {
  margin-bottom: var(--space-sm);
}

.legal-page .last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-2xl);
}

.legal-page h2 {
  font-size: 1.4rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--primary-300);
}

.legal-page h3 {
  font-size: 1.1rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.legal-page p,
.legal-page li {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
}

.legal-page ul {
  padding-left: var(--space-xl);
  list-style: disc;
}

.legal-page ul li {
  margin-bottom: var(--space-sm);
}

/* ── Contact Form ── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xl);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 200;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.3rem;
  }

  .nav-close {
    display: block;
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
  }
}