@charset "UTF-8";
/**
 * Skin — 024-k5english
 * Theme: Sunshine yellow + warm sky blue — K-5 English / literacy joy
 * Primary: #eab308  Accent: #38bdf8
 * Hero archetype: warm sunshine glow — open-book aesthetic
 * Radius personality: Round (pill buttons, 18px cards)
 */

/* ═══ Google Fonts — Nunito (heading) ═══ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

/* ═══ Base ═══ */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

::selection { background: var(--site-primary-light); color: var(--site-primary-dark); }
::-moz-selection { background: var(--site-primary-light); color: var(--site-primary-dark); }

*:focus-visible {
  outline: 3px solid var(--site-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--site-primary-lighter); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--site-primary) 0%, var(--site-primary-hover) 100%);
  border-radius: 5px;
  border: 2px solid var(--site-primary-lighter);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--site-primary-hover) 0%, var(--site-primary-dark) 100%);
}

/* ═══ Body — warm gradient background ═══ */
body {
  background: var(--gradient-hero-body);
  background-attachment: fixed;
  color: var(--site-text);
  font-family: var(--font-body);
}

/* ═══ Typography ═══ */

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--site-primary-dark);
  line-height: 1.25;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  color: var(--site-text-secondary);
  font-size: 1.05rem;
  margin-top: 0.4rem;
}

/* ═══ Page Header ═══ */

.page-header {
  background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
  border-bottom: 2px solid var(--site-primary-border);
  padding: 1.5rem 1.5rem 1rem;
}

/* ═══ Hero — Sunshine glow, open-book warmth ═══ */

.hero {
  background: linear-gradient(160deg, #fefce8 0%, #ffffff 50%, #f0f9ff 100%);
  border-bottom: 3px solid var(--site-primary-border);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Sunshine glow blob */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero-blob);
  pointer-events: none;
  z-index: 0;
}

/* Secondary sky-blue glow, bottom-left */
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--site-primary-dark);
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--site-text-secondary);
  margin-top: 0.75rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ─ Hero stats ─ */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  padding: 0.9rem 1.4rem;
  background: var(--gradient-stat-badge);
  border: 1px solid transparent;
  border-radius: 16px;
  min-width: 120px;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-heading);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.90);
  margin-top: 0.2rem;
  letter-spacing: 0.3px;
}

/* ═══ Breadcrumb ═══ */
.breadcrumb {
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--site-text-muted);
  align-items: center;
}
.breadcrumb a { color: var(--site-accent-dark); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { color: var(--site-accent); text-decoration: underline; }
.breadcrumb li:not(:last-child)::after {
  content: '›';
  color: var(--site-border-medium);
  font-weight: 700;
  margin-left: 0.3rem;
}
.breadcrumb li:last-child { color: var(--site-text); font-weight: 700; }

/* ═══ Set Switcher ═══ */
.set-switcher {
  background: white;
  border: 2px solid var(--site-primary-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.set-switcher-label { font-size: 1rem; font-weight: 700; color: var(--site-text); font-family: var(--font-heading); }
.set-btn {
  background: white;
  border: 2px solid var(--site-primary-border);
  border-radius: var(--radius-full);
  color: var(--site-text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  font-family: var(--font-heading);
}
.set-btn:hover {
  border-color: var(--site-primary);
  background: var(--site-primary-light);
  transform: translateY(-1px);
}
.set-btn.active {
  background: var(--site-primary);
  color: var(--site-primary-dark);
  border-color: var(--site-primary-hover);
  box-shadow: var(--shadow-btn-brand);
}

/* ═══ Buttons — Pill / sunshine yellow ═══ */
.btn {
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-button);
  background: white;
  color: var(--site-text);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-heading);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.btn:hover {
  box-shadow: var(--shadow-btn-brand);
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-sm);
}

/* Primary — sunshine yellow, dark text (WCAG AA: #713f12 on #eab308 = 4.7:1) */
.btn-primary {
  background: var(--site-primary);
  color: var(--site-primary-dark);
  border-color: var(--site-primary-hover);
}
.btn-primary:hover {
  background: var(--site-primary-hover);
  color: #ffffff;
  box-shadow: var(--shadow-btn-brand);
}

/* Success / answers — sky blue */
.btn-success, .btn-answers {
  background: var(--site-accent);
  color: var(--site-accent-dark);
  border-color: var(--site-accent-hover);
}
.btn-success:hover, .btn-answers:hover {
  background: var(--site-accent-hover);
  color: #ffffff;
  box-shadow: var(--shadow-blue-hover);
}

/* Check button */
.btn-check { background: #f59e0b; color: #1c1400; border-color: #d97706; }
.btn-check:hover { background: #d97706; color: #ffffff; }

.btn:focus-visible { outline: 3px solid var(--site-primary); outline-offset: 3px; }

/* ═══ Variant Chip ═══ */
.variant-chip {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  color: var(--site-primary-dark);
  background: var(--site-primary-light);
  border: 1px solid var(--site-primary-border);
  font-family: var(--font-heading);
}

/* ─ Reading level badges ─ */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
}
.level-badge--k    { background: #fef9c3; color: #713f12; border: 1px solid #fef08a; }
.level-badge--g1   { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.level-badge--g2   { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.level-badge--g3   { background: #fce7f3; color: #831843; border: 1px solid #f9a8d4; }
.level-badge--g4   { background: #ede9fe; color: #4c1d95; border: 1px solid #c4b5fd; }
.level-badge--g5   { background: #cffafe; color: #164e63; border: 1px solid #67e8f9; }

/* ─ Star achievement ─ */
.star-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #fde047 0%, #eab308 100%);
  color: #713f12;
  border: 1px solid #fbbf24;
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.25);
  font-family: var(--font-heading);
}

/* ═══ Intro / Intro-Section ═══ */
.intro, .intro-section {
  background: linear-gradient(135deg, var(--site-primary-light) 0%, #ffffff 100%);
  border: 1.5px solid var(--site-primary-border);
  border-left: 5px solid var(--site-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 1rem 0;
}
.intro h3, .intro-section h3 {
  font-weight: 800;
  color: var(--site-primary-dark);
  font-family: var(--font-heading);
  margin: 0 0 0.5rem;
}
.intro p, .intro-section p { color: var(--site-text-secondary); line-height: 1.7; }
.intro strong, .intro-section strong { color: var(--site-primary-dark); }

/* ═══ Body Content / Worksheet ═══ */
.body-content {
  background: #ffffff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1.5px solid var(--site-primary-border);
  border-top: none;
}
.problems-grid { border-top: 2px solid var(--site-border-medium); }
.problem {
  border-bottom: 1px solid var(--site-border-light);
  font-size: 1.1rem;
  color: var(--site-text);
}

/* ─ Letter / sight word / large text display ─ */
.letter-display {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  color: var(--site-primary-dark);
  font-family: var(--font-heading);
  line-height: 1;
  text-align: center;
  letter-spacing: -0.02em;
}
.sight-word {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--site-accent-dark);
  font-family: var(--font-heading);
  background: var(--site-accent-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  display: inline-block;
}

/* ═══ Section Header ═══ */
.section-header { margin: 1.75rem 0 1rem; }
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--site-text);
  font-family: var(--font-heading);
  position: relative;
  padding-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--accent-line-width);
  height: var(--accent-line-height);
  background: var(--site-primary);
  border-radius: 2px;
}
.section-header p { color: var(--site-text-muted); margin-top: 0.35rem; }
.categories-section { padding: 0 0.5rem; }

/* Section visual flow divider */
.categories-section {
  position: relative;
}
.categories-section::before {
  content: '';
  position: absolute;
  top: -1rem;
  left: 0;
  width: 4rem;
  height: 3px;
  background: var(--site-primary);
  border-radius: 2px;
}

/* ═══ Category Cards ═══ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
}

.category-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: #ffffff;
  border: 1.5px solid var(--site-primary-border);
  border-left: 4px solid var(--site-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1),
              transform var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1);
}

/* Bottom accent bar — scaleX reveal on hover */
.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--site-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1);
}

.category-card:hover {
  border-color: var(--site-primary);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}
.category-card:hover::after { transform: scaleX(1); }

.category-icon {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--dur-normal) var(--ease-bounce);
}
.category-card:hover .category-icon {
  transform: scale(1.18) rotate(-4deg);
}

.category-card h3 {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--site-text);
  margin: 0 0 0.25rem;
  font-family: var(--font-heading);
  text-decoration: none;
}
.category-card p { font-size: 0.875rem; color: var(--site-text-muted); line-height: 1.45; margin: 0; }
.category-meta { font-size: 0.85rem; font-weight: 700; color: var(--site-primary-dark); margin-top: 0.5rem; }

/* ═══ Subcategory Cards ═══ */
.subcategories-section { margin: 1.5rem 0; }
.difficulty-icon { font-size: 1.3rem; }
.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.subcategory-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1.1rem;
  background: #ffffff;
  border: 1.5px solid var(--site-primary-border);
  border-top: 4px solid var(--site-primary);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1),
              transform var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1);
}
.subcategory-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--site-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-normal) cubic-bezier(0.22, 1, 0.36, 1);
}
.subcategory-card:hover {
  border-top-color: var(--site-accent);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.subcategory-card:hover::after { transform: scaleX(1); }

.subcategory-card h3 { font-weight: 700; color: var(--site-text); font-family: var(--font-heading); margin: 0 0 0.25rem; }
.subcategory-card p { font-size: 0.875rem; color: var(--site-text-muted); line-height: 1.45; }
.subcategory-arrow { font-size: 0.85rem; font-weight: 700; color: var(--site-primary-dark); margin-top: auto; }

/* ═══ Worksheet Cards ═══ */
.worksheets-section { margin: 1.5rem 0; }
.worksheets-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.worksheet-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  background: #ffffff;
  border: 1.5px solid var(--site-primary-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.worksheet-card:hover {
  background: var(--site-primary-light);
  border-color: var(--site-primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.worksheet-number {
  font-weight: 800;
  font-size: 1rem;
  color: var(--site-primary-dark);
  min-width: 56px;
  font-family: var(--font-heading);
}
.worksheet-card h3 { font-size: 0.9rem; margin: 0; flex: 1; font-weight: 600; }
.worksheet-problems { font-size: 0.8rem; color: var(--site-text-muted); }

/* ═══ Content Toggle ═══ */
.body-content--collapsible {
  margin: 1rem 0;
  border: 1.5px solid var(--site-primary-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.content-toggle { border: none; }
.content-toggle summary {
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--site-primary-dark);
  cursor: pointer;
  background: var(--site-primary-light);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
}
.content-toggle summary::-webkit-details-marker { display: none; }
.content-toggle summary::after {
  content: '⌄';
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--site-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: rgba(234, 179, 8, 0.15);
  border-radius: 50%;
  transition: transform var(--dur-normal) var(--ease-out);
}
.content-toggle[open] summary::after { transform: rotate(180deg); }
.content-toggle summary:hover { background: #fef9c3; }
.content-toggle[open] summary { border-bottom-color: var(--site-primary-border); }
.content-toggle-panel { padding: 1.25rem 1.5rem; }
.content-toggle-panel h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--site-primary-dark);
  margin: 1rem 0 0.5rem;
  font-family: var(--font-heading);
}
.content-toggle-panel h3 { font-size: 1.1rem; font-weight: 700; color: var(--site-text-secondary); margin: 0.75rem 0 0.4rem; }
.content-toggle-panel p { line-height: 1.7; color: var(--site-text-secondary); margin: 0.4rem 0; }
.content-toggle-panel ul, .content-toggle-panel ol { padding-left: 1.25rem; margin: 0.5rem 0; color: var(--site-text-secondary); }
.content-toggle-panel li { margin: 0.3rem 0; line-height: 1.6; }
.content-toggle-panel strong { color: var(--site-primary-dark); }

/* ═══ Score Panel ═══ */
.score-panel {
  display: none;
  background: #ffffff;
  border: 2px solid var(--site-primary-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}
.score-panel.score-visible { display: block; animation: scoreSlide 300ms var(--ease-out) both; }

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

.score-inner { position: relative; }
.score-inner::after {
  content: "";
  display: block;
  height: 5px;
  margin-top: 0.75rem;
  background: var(--site-primary-border);
  border-radius: 3px;
}
.score-icon { font-size: 1.5rem; line-height: 1; }
.score-detail { font-size: 1rem; font-weight: 600; color: var(--site-text); }
.score-pct {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--site-primary-dark);
  font-family: var(--font-heading);
}

/* ═══ Content Section ═══ */
.content-section { padding: 1.5rem; margin: 1rem 0; }
.content-section h2 {
  font-family: var(--font-heading);
  color: var(--site-primary-dark);
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.content-section h3 { color: var(--site-text-secondary); font-weight: 700; font-family: var(--font-heading); }
.content-section p { line-height: 1.7; color: var(--site-text-secondary); }

/* ═══ Answer Input ═══ */
.answer-input {
  border: 2px solid var(--site-primary-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--site-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.answer-input:focus {
  border-color: var(--site-primary);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18);
  outline: none;
}
.problem.is-correct .answer-input { border-color: #22c55e; background: #f0fdf4; color: #14532d; }
.problem.is-wrong   .answer-input { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.problem.is-empty   .answer-input { border-color: #f59e0b; background: #fffbeb; }
.problem.is-correct { border-left-color: #22c55e !important; }
.problem.is-wrong   { border-left-color: #ef4444 !important; }
.problem { transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out); }
.problem:hover { transform: translateX(2px); }
.problem .num {
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
  font-weight: 800;
  font-family: var(--font-heading);
}
.problem .answer { background: #dcfce7; color: #14532d; font-weight: 700; border-radius: var(--radius-md); }

/* ═══ Score Retry Button ═══ */
.score-retry {
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
  border: 2px solid var(--site-primary-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: all var(--dur-fast) var(--ease-out);
}
.score-retry:hover { background: var(--site-primary); color: var(--site-primary-dark); border-color: var(--site-primary-hover); }

/* ═══ SEO Components ═══ */
.seo-components { margin: 1.5rem 0; }
.seo-components--primary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.seo-components--secondary { margin-top: 1rem; opacity: 0.94; }
.seo-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }

.seo-block {
  background: #ffffff;
  border: 1.5px solid var(--site-primary-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-normal) var(--ease-out),
              transform var(--dur-normal) var(--ease-out);
}
.seo-block:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* SEO block accent borders */
.seo-components--secondary .seo-block { background: var(--site-primary-light); }
.seo-block.tutorial      { border-left: 3px solid var(--site-primary-dark); }
.seo-block.examples      { border-left: 3px solid var(--site-accent-dark); }
.seo-block.use-cases     { border-left: 3px solid #f59e0b; }
.seo-block.common-mistakes { border-left: 3px solid #ef4444; }
.seo-block.practice      { border-left: 3px solid #22c55e; }
.seo-block.requirements  { border-left: 3px solid #3b82f6; }
.seo-block.resources     { border-left: 3px solid #06b6d4; }
.seo-block.next-steps    { border-left: 3px solid var(--site-primary-dark); }
.seo-block.summary       { border-left: 3px solid #6b7280; }
.seo-block.related       { border-left: 3px solid var(--site-accent); }

.seo-block h2 { font-size: 1.1rem; font-weight: 800; color: var(--site-primary-dark); margin: 0 0 0.6rem; font-family: var(--font-heading); }
.seo-block h3 { font-size: 1rem; font-weight: 700; color: var(--site-text-secondary); margin: 0.6rem 0 0.4rem; font-family: var(--font-heading); }
.seo-block h4 { font-size: 0.9rem; font-weight: 600; color: var(--site-text-tertiary); margin: 0.5rem 0 0.3rem; }
.seo-block p  { font-size: 0.92rem; line-height: 1.65; color: var(--site-text-secondary); margin: 0.35rem 0; }
.seo-block ul, .seo-block ol { padding-left: 1.2rem; margin: 0.4rem 0; }
.seo-block li { font-size: 0.92rem; line-height: 1.55; color: var(--site-text-secondary); margin: 0.25rem 0; }
.seo-block strong { color: var(--site-primary-dark); }
.seo-block a { color: var(--site-accent-dark); text-decoration: none; }
.seo-block a:hover { text-decoration: underline; }
.seo-block details { border-bottom: 1px solid var(--site-primary-border); padding: 0.5rem 0; }
.seo-block details:last-child { border-bottom: none; }
.seo-block details summary { font-weight: 600; font-size: 0.92rem; cursor: pointer; list-style: none; color: var(--site-text-secondary); }
.seo-block details summary::-webkit-details-marker { display: none; }
.seo-block details summary::before { content: "▸"; margin-right: 0.4rem; color: var(--site-primary-dark); display: inline-block; transition: transform var(--dur-fast) var(--ease-out); }
.seo-block details[open] summary::before { transform: rotate(90deg); }
.seo-block details p { padding: 0.3rem 0 0.3rem 1rem; color: var(--site-text-muted); font-size: 0.88rem; }

/* SEO card band colors */
.seo-card { background: var(--site-background); border-color: var(--site-border); border-top: none; }
.seo-card::before { background: var(--site-primary); }
.seo-card:hover { box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18); }
.seo-card.features::before      { background: var(--site-primary); }
.seo-card.benefits::before      { background: var(--site-accent); }
.seo-card.faq::before           { background: var(--site-primary-dark); }
.seo-card.tips::before          { background: #f59e0b; }
.seo-card.steps::before         { background: #22c55e; }
.seo-card.tutorial::before      { background: var(--site-accent-dark); }
.seo-card.examples::before      { background: #06b6d4; }
.seo-card.use-cases::before     { background: #ec4899; }
.seo-card.common-mistakes::before { background: #ef4444; }
.seo-card.practice::before      { background: #f97316; }
.seo-card.requirements::before  { background: #6366f1; }
.seo-card.resources::before     { background: #14b8a6; }
.seo-card.next-steps::before    { background: var(--site-primary); }
.seo-card.summary::before       { background: #64748b; }
.seo-card.related::before       { background: var(--site-accent); }

/* ═══ Page Navigation ═══ */
.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: #ffffff;
  border: 1.5px solid var(--site-primary-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  color: var(--site-primary-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn-nav:hover { background: var(--site-primary-light); color: var(--site-primary-dark); }
.btn-nav.disabled { color: var(--site-text-muted); cursor: not-allowed; }

/* ═══ A8 — Visual hierarchy ═══ */

/* SEO secondary reduced weight */
.seo-components { opacity: 1; }
.seo-components--secondary { opacity: 0.93; }

/* Typography weight hierarchy */
.hero h1, .page-header h1   { font-weight: 800; }
.section-header h2, .seo-block h2 { font-weight: 800; }
.category-card h3, .subcategory-card h3 { font-weight: 700; }
.intro p, .intro-section p, .seo-block p { font-weight: 400; }

/* Color hierarchy */
.hero h1, .section-header h2   { color: var(--site-primary-dark); }
.category-card h3               { color: var(--site-text); }
.intro p, .intro-section p, .seo-block p { color: var(--site-text-secondary); }
.stat-label, .category-meta, .worksheet-problems { color: var(--site-text-muted); }

/* Focus flow guide */
.categories-section + .subcategories-section::before,
.categories-section + .worksheets-section::before {
  content: '';
  display: block;
  width: 1px;
  height: 1.5rem;
  background: color-mix(in srgb, var(--site-primary) 20%, transparent);
  margin: 0 auto;
}

/* Empty state */
.categories-grid:empty::after,
.worksheets-grid:empty::after {
  content: 'No items available';
  display: block;
  text-align: center;
  padding: 3rem;
  color: var(--site-text-muted);
  font-style: italic;
  grid-column: 1 / -1;
}

/* Breadcrumb current page */
.breadcrumb li:last-child { font-weight: 700; color: var(--site-text); }
.breadcrumb li:not(:last-child) a { color: var(--site-text-muted); font-weight: 400; }

/* ═══ Animations ═══ */

@keyframes fadeIn    { from { opacity: 0; }                      to { opacity: 1; } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.fade-in  { animation: fadeIn  300ms var(--ease-out) both; }
.slide-up { animation: slideUp 300ms var(--ease-out) both; }

/* Staggered card entrance */
.category-card, .subcategory-card, .seo-block {
  animation: fadeInUp 380ms var(--ease-out) both;
}
.category-card:nth-child(1), .subcategory-card:nth-child(1), .seo-block:nth-child(1) { animation-delay:   0ms; }
.category-card:nth-child(2), .subcategory-card:nth-child(2), .seo-block:nth-child(2) { animation-delay:  60ms; }
.category-card:nth-child(3), .subcategory-card:nth-child(3), .seo-block:nth-child(3) { animation-delay: 120ms; }
.category-card:nth-child(4), .subcategory-card:nth-child(4), .seo-block:nth-child(4) { animation-delay: 180ms; }
.category-card:nth-child(5), .subcategory-card:nth-child(5), .seo-block:nth-child(5) { animation-delay: 240ms; }
.category-card:nth-child(6), .subcategory-card:nth-child(6), .seo-block:nth-child(6) { animation-delay: 300ms; }

/* ═══ Responsive ═══ */

@media (max-width: 768px) {
  .hero h1           { font-size: clamp(1.75rem, 6vw, 2.4rem); }
  .hero .subtitle    { max-width: 100%; }
  .hero-stats        { gap: 1rem; }
  .stat-number       { font-size: 1.4rem; }
  .categories-grid   { grid-template-columns: 1fr; }
  .subcategories-grid { grid-template-columns: 1fr; }
  .seo-components--primary { grid-template-columns: 1fr; }
  .seo-more-grid     { grid-template-columns: 1fr; }
  .page-navigation   { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
  .hero              { padding: 2rem 1rem 1.75rem; }
  .hero h1           { font-size: 1.6rem; line-height: 1.2; }
  .hero .subtitle    { font-size: 0.95rem; }
  .hero-stats        { flex-direction: column; gap: 0.75rem; }

  .worksheets-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    flex-direction: row;
  }
  .worksheet-card {
    flex: 0 0 auto;
    width: 280px;
    scroll-snap-align: start;
  }
  .worksheets-grid::-webkit-scrollbar { height: 4px; }
  .worksheets-grid::-webkit-scrollbar-thumb {
    background: var(--site-border-medium);
    border-radius: 4px;
  }

  .page-navigation {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1.5px solid var(--site-primary-border);
    border-radius: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(234, 179, 8, 0.08);
  }
}

/* Touch target enforcement */
@media (max-width: 768px) {
  .btn, .set-btn, .btn-nav, .category-card, .subcategory-card {
    min-height: 48px;
  }
  .breadcrumb a {
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .set-switcher {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .set-switcher::-webkit-scrollbar { display: none; }
}

/* Touch tap feedback */
@media (hover: none) and (pointer: coarse) {
  .category-card:active, .subcategory-card:active, .worksheet-card:active {
    transform: scale(0.98);
    opacity: 0.92;
    transition: transform 80ms ease, opacity 80ms ease;
  }
  .btn:active { transform: scale(0.96); transition: transform 80ms ease; }
}

/* Safe area insets (notch phones) */
@supports (padding: env(safe-area-inset-bottom)) {
  .page-navigation {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .site-header .container {
    padding-left:  max(var(--spacing-lg, 1.5rem), env(safe-area-inset-left));
    padding-right: max(var(--spacing-lg, 1.5rem), env(safe-area-inset-right));
  }
}

/* ═══ Print ═══ */
@media print {
  /* Hide all UI chrome */
  .ia-game-controls,
  .ia-streak-badge,
  .ia-btn,
  .ia-resume-card,
  .hero-stats,
  .breadcrumb,
  .set-switcher,
  .btn-nav,
  .page-navigation,
  .score-panel,
  .seo-components,
  .content-toggle summary,
  .no-print { display: none !important; }

  /* Flat backgrounds, no shadows */
  body { background: #fff !important; color: #000 !important; }
  * { box-shadow: none !important; text-shadow: none !important; }

  /* Hero minimal */
  .hero {
    padding: 0.75rem 0 0.5rem;
    border-bottom: 1pt solid #ccc;
    text-align: left;
    background: none !important;
  }
  .hero::before, .hero::after { display: none !important; }
  .hero h1 { font-size: 17pt; color: #000 !important; font-weight: 700; }

  /* Content */
  .body-content { border: none; border-radius: 0; }
  .problem { page-break-inside: avoid; break-inside: avoid; }

  /* Open toggles */
  .content-toggle { display: block; }
  .content-toggle-panel { display: block !important; }

  /* Flatten cards */
  .category-card, .subcategory-card, .worksheet-card, .seo-block {
    border-radius: 0;
    border: 1pt solid #ccc;
    animation: none !important;
  }
  .category-card::after, .subcategory-card::after { display: none !important; }

  /* Print-safe radius */
  .breadcrumb { }
}

/* ═══ Dark Mode ═══ */
@media (prefers-color-scheme: dark) {
  body {
    background: var(--gradient-hero-body);
    color: var(--site-text);
  }

  .hero {
    background: linear-gradient(160deg, #1a1800 0%, #100e00 50%, #040d18 100%);
    border-bottom-color: var(--site-primary-border);
  }
  .hero::after {
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
  }
  .hero h1    { color: var(--site-text-primary); }
  .hero .subtitle { color: var(--site-text-muted); }

  .page-header {
    background: linear-gradient(135deg, var(--site-primary-light) 0%, var(--site-background) 100%);
  }
  .page-header h1 { color: var(--site-text-primary); }

  .stat-item {
    background: var(--gradient-stat-badge);
    border-color: transparent;
  }
  .stat-number { color: #ffffff; }
  .stat-label  { color: rgba(255, 255, 255, 0.88); }

  .category-card, .worksheet-card, .subcategory-card {
    background: var(--site-surface-raised);
    border-color: var(--site-border);
  }
  .category-card h3, .subcategory-card h3 { color: var(--site-text-primary); }
  .category-card p,  .subcategory-card p  { color: var(--site-text-muted); }

  .set-switcher, .set-btn { background: var(--site-surface-raised); }
  .set-btn.active { background: var(--site-primary); color: var(--site-primary-dark); }

  .body-content    { background: var(--site-surface-raised); }

  .intro, .intro-section {
    background: linear-gradient(135deg, var(--site-primary-light) 0%, var(--site-surface-raised) 100%);
  }

  .score-panel   { background: var(--site-surface-raised); }
  .score-inner::after { background: var(--site-border); }

  .problem.is-correct .answer-input { background: #052e16; color: #86efac; }
  .problem.is-wrong   .answer-input { background: #450a0a; color: #fca5a5; }
  .problem.is-empty   .answer-input { background: #2a2400; }

  .content-toggle summary { background: var(--site-background-alt); color: var(--site-text-secondary); }
  .content-toggle summary:hover { background: var(--site-primary-light); }
  .content-toggle summary::after { background: rgba(234, 179, 8, 0.15); color: var(--site-primary); }
  .content-toggle-panel p,
  .content-toggle-panel ul,
  .content-toggle-panel ol { color: var(--site-text-muted); }
  .content-toggle-panel strong { color: var(--site-text-primary); }

  .seo-block { background: var(--site-surface-raised); border-color: var(--site-border); }
  .seo-block p, .seo-block li   { color: var(--site-text-muted); }
  .seo-block details p           { color: var(--site-text-muted); }
  .seo-block strong              { color: var(--site-text-primary); }
  .seo-components--secondary .seo-block { background: var(--site-background-alt); }

  .content-section p { color: var(--site-text-muted); }
  .page-navigation { background: var(--site-surface-raised); border-color: var(--site-border); }
  .btn-nav.disabled { color: #4b5563; }
  .breadcrumb { }
  .breadcrumb a { color: var(--site-accent); }

  .section-header h2::after { background: var(--site-primary); }
  .categories-section::before { background: var(--site-primary); }
  .categories-section + .subcategories-section::before,
  .categories-section + .worksheets-section::before {
    background: color-mix(in srgb, var(--site-primary) 20%, transparent);
  }

  .btn {
    background: var(--site-surface-raised);
    color: var(--site-text-primary);
    border-color: var(--site-border);
  }
  .btn-primary {
    background: var(--site-primary);
    color: var(--site-primary-dark);
    border-color: var(--site-primary-hover);
  }

  ::selection { background: rgba(234, 179, 8, 0.25); color: var(--site-text-primary); }

  @media (max-width: 480px) {
    .page-navigation {
      background: var(--site-surface-raised);
      border-top-color: var(--site-border);
    }
  }
}
