:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #7c3aed;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-light: #475569;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.1rem;
}

.main-nav {
  display: flex;
  gap: 8px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background: #eff6ff;
  color: var(--primary);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgb(37 99 235 / 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgb(124 58 237 / 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}

.hero-content h1 {
  font-size: 3.2rem;
  line-height: 1.1;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.hero-content h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-light);
  margin: 0 0 32px;
  max-width: 520px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 10px 20px -5px rgb(37 99 235 / 0.3);
}

.btn-primary:hover {
  box-shadow: 0 14px 28px -5px rgb(37 99 235 / 0.35);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  background: #f8fafc;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  display: grid;
  place-items: center;
}

.hero-card {
  background: var(--card);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
}

.hero-card img {
  border-radius: 16px;
  width: 100%;
  height: 220px;
  object-fit: cover;
  margin-bottom: 20px;
}

.hero-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.hero-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* Features */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-title h2 {
  font-size: 2.2rem;
  margin: 0 0 12px;
}

.section-title p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Cards / Test cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.card-body p {
  margin: 0 0 20px;
  color: var(--text-light);
  font-size: 0.95rem;
  flex: 1;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge-green {
  background: #d1fae5;
  color: #065f46;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

/* Test page */
.test-shell {
  max-width: 800px;
  margin: 0 auto;
}

.test-intro,
.test-question,
.test-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
  border-radius: 999px;
}

.question-prompt {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.question-media {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  min-height: 180px;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.answer-btn {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.answer-btn:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.answer-btn.selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

.answer-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.answer-btn:hover .answer-letter,
.answer-btn.selected .answer-letter {
  background: var(--primary);
  color: white;
}

.test-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
}

.result-score {
  text-align: center;
  padding: 32px 0;
}

.result-score .score-number {
  font-size: 4.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.result-score .score-label {
  color: var(--text-light);
  margin-top: 8px;
  font-size: 1.1rem;
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.breakdown-item {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.breakdown-item .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.breakdown-item .label {
  font-size: 0.85rem;
  color: var(--text-light);
}

.disclaimer {
  background: #fffbeb;
  border-left: 4px solid var(--warning);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: 0.95rem;
  margin-top: 24px;
}

/* Training games */
.game-board {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 420px;
  margin: 20px auto;
}

.game-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.8rem;
  color: white;
  transition: transform 0.15s, opacity 0.15s;
  user-select: none;
}

.game-card:hover {
  transform: scale(1.05);
}

.game-card.hidden {
  background: #e2e8f0;
  color: transparent;
}

.game-card.matched {
  opacity: 0.4;
  cursor: default;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
  font-weight: 600;
}

.game-controls {
  text-align: center;
}

/* Number sequence game */
.sequence-prompt {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin: 24px 0;
  letter-spacing: 0.1em;
}

.sequence-input {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.sequence-input input {
  width: 120px;
  padding: 14px;
  font-size: 1.2rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sequence-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

/* Stroop */
.stroop-word {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin: 24px 0;
  text-transform: uppercase;
}

.stroop-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.stroop-btn {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  color: white;
  font-size: 0.9rem;
  transition: transform 0.1s;
}

.stroop-btn:hover {
  transform: scale(1.05);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 14px 0 0;
}

.footer-col h4 {
  color: white;
  margin: 0 0 16px;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: #94a3b8;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: #64748b;
}

/* Legal pages */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow);
}

.legal-page h1 {
  margin-top: 0;
}

.legal-page h2 {
  font-size: 1.3rem;
  margin-top: 32px;
}

.legal-page p,
.legal-page li {
  color: var(--text-light);
}

.legal-page ul {
  padding-left: 22px;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  box-shadow: 0 -4px 20px rgb(0 0 0 / 0.08);
  z-index: 200;
  display: none;
}

.cookie-banner.active {
  display: block;
}

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-inner p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* Contact form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-content h1 {
    font-size: 2.4rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .answers {
    grid-template-columns: 1fr;
  }

  .result-breakdown {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .legal-page {
    padding: 28px;
  }
}
