@charset "UTF-8";
/**
 * Full Skin — Site 015: Logic Puzzle
 * Primary: #3b82f6 (bright blue)   Accent: #8b5cf6 (soft violet)
 * Personality: Intelligent · Focused · Premium brain-training aesthetic
 * Palette: Cool slate blue + silver/pearl — clean whites, crisp typography
 */

/* ═══ Google Font Import ═══ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ═══ Base Overrides ═══ */

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: #dbeafe; color: #1e3a8a; }
::-moz-selection { background: #dbeafe; color: #1e3a8a; }

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

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--site-surface, #f8fafc); }
::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.28);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.48); }

/* ═══ Body ═══ */
body {
  background: var(--site-surface, #f8fafc);
  font-family: var(--font-body);
  color: var(--site-text, #0f172a);
}

/* ═══ Typography ═══ */

.page-header h1 {
  font-family: var(--font-heading, 'DM Sans', system-ui, sans-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  color: var(--site-primary-hover, #2563eb);
  font-size: 1.05rem;
  margin-top: 0.4rem;
}

/* ═══ Hero — Clean white, minimal precision aesthetic ═══ */

.page-header {
  background: var(--site-background, #ffffff);
  border-bottom: 1px solid var(--site-primary-border, #bfdbfe);
  padding: 1.5rem 1.5rem 1rem;
}

.hero {
  background: #ffffff;
  border-bottom: 2px solid var(--site-primary-border, #bfdbfe);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative grid pattern — precision aesthetic */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Soft radial glow behind heading */
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.07) 0%, transparent 70%);
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-heading, 'DM Sans', system-ui, sans-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--site-text, #0f172a);
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--site-text-light, #475569);
  margin-top: 0.75rem;
  max-width: 560px;
  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.875rem 1.5rem;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-lift);
}

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

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--site-primary, #3b82f6);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--site-text-muted, #64748b);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ═══ Breadcrumb ═══ */
.breadcrumb {
  padding: 0.6rem 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, #64748b);
}

.breadcrumb a {
  color: var(--site-primary, #3b82f6);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--site-primary-hover, #2563eb);
  text-decoration: underline;
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  color: var(--site-border-medium, #cbd5e1);
  font-weight: 500;
  margin-left: 0.3rem;
}

.breadcrumb li:last-child {
  color: var(--site-text, #0f172a);
  font-weight: 600;
}

/* ═══ Set Switcher ═══ */
.set-switcher {
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-sm);
}

.set-switcher-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--site-text, #0f172a);
}

.set-btn {
  background: var(--site-background, #ffffff);
  border: 2px solid var(--site-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  color: var(--site-text, #0f172a);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 0.5rem 1rem;
  transition: background var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std),
              border-color var(--dur-fast) var(--ease-std);
}

.set-btn:hover {
  border-color: var(--site-primary, #3b82f6);
  background: var(--site-primary-light, #eff6ff);
}

.set-btn.active {
  background: var(--site-primary, #3b82f6);
  color: var(--site-text-inverse, #ffffff);
  border-color: var(--site-primary-hover, #2563eb);
  box-shadow: var(--shadow-btn-hover);
}

/* ═══ Buttons ═══ */
.btn {
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-md, 8px);
  background: var(--site-background, #ffffff);
  color: var(--site-text, #0f172a);
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease-std),
              box-shadow var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-std);
}

.btn:hover {
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-btn-active);
}

.btn-primary {
  background: var(--site-primary, #3b82f6);
  color: var(--site-text-inverse, #ffffff);
  border-color: var(--site-primary-hover, #2563eb);
}

.btn-primary:hover {
  background: var(--site-primary-hover, #2563eb);
  border-color: var(--site-primary-dark, #1e3a8a);
}

.btn-success,
.btn-answers {
  background: var(--color-success, #22c55e);
  color: var(--site-text-inverse, #ffffff);
  border-color: #16a34a;
}

.btn-success:hover,
.btn-answers:hover {
  background: #16a34a;
}

.btn-check {
  background: var(--site-accent, #8b5cf6);
  color: var(--site-text-inverse, #ffffff);
  border-color: var(--site-accent-hover, #7c3aed);
}

.btn-check:hover {
  background: var(--site-accent-hover, #7c3aed);
}

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

/* ═══ Intro Section ═══ */
.intro,
.intro-section {
  background: var(--site-primary-light, #eff6ff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-xl, 16px);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.intro h3,
.intro-section h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
}

.intro p,
.intro-section p {
  color: var(--site-text, #0f172a);
  line-height: 1.7;
}

.intro strong,
.intro-section strong {
  color: var(--site-primary-dark, #1e3a8a);
}

/* ═══ Body Content ═══ */
.body-content {
  background: var(--site-background, #ffffff);
  border-radius: 0 0 var(--radius-xl, 16px) var(--radius-xl, 16px);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-top: none;
}

.problems-grid {
  border-top: 2px solid var(--site-border, #e2e8f0);
}

.problem {
  border-bottom: 1px solid var(--site-border, #e2e8f0);
  font-size: 1.125rem;
  color: var(--site-text, #0f172a);
}

/* ═══ Variant Chip ═══ */
.variant-chip {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full, 9999px);
  color: var(--site-primary-hover, #2563eb);
  background: var(--site-primary-light, #eff6ff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
}

/* ═══ Section Headers ═══ */
.section-header {
  margin: 1.5rem 0 1rem;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--site-text, #0f172a);
  position: relative;
  padding-bottom: 0.6rem;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--site-primary, #3b82f6), var(--site-accent, #8b5cf6));
}

.section-header p {
  color: var(--site-text-muted, #64748b);
  margin-top: 0.25rem;
}

.categories-section {
  padding: 0 0.5rem;
}

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

.category-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-left: 4px solid var(--site-primary, #3b82f6);
  border-radius: var(--radius-card-lg, 14px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-normal) var(--ease-std),
              box-shadow var(--dur-normal) var(--ease-std),
              border-color var(--dur-normal) var(--ease-std);
}

/* Blue-to-violet sweep on hover */
.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #3b82f6), var(--site-accent, #8b5cf6));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-std);
}

.category-card:hover {
  border-left-color: var(--site-accent, #8b5cf6);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.category-card:hover::after {
  transform: scaleX(1);
}

.category-card:focus-within {
  outline: 2px solid var(--site-primary, #3b82f6);
  outline-offset: 2px;
}

.category-card:active {
  transform: translateY(0) scale(0.99);
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md, 8px);
  background: var(--site-primary-light, #eff6ff);
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: background var(--dur-normal) var(--ease-std),
              transform var(--dur-normal) var(--ease-std);
}

.category-card:hover .category-icon {
  background: #dbeafe;
  transform: scale(1.08);
}

.category-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--site-text, #0f172a);
  margin: 0 0 0.25rem;
}

.category-card p {
  font-size: 0.875rem;
  color: var(--site-text-muted, #64748b);
  line-height: 1.4;
  margin: 0;
}

.category-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--site-primary, #3b82f6);
  margin-top: 0.5rem;
}

/* ═══ Subcategory Cards ═══ */
.subcategories-section {
  margin: 1.5rem 0;
}

.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;
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-top: 3px solid var(--site-primary, #3b82f6);
  border-radius: var(--radius-card-lg, 14px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-normal) var(--ease-std),
              box-shadow var(--dur-normal) var(--ease-std);
}

.subcategory-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #3b82f6), var(--site-accent, #8b5cf6));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-std);
}

.subcategory-card:hover {
  border-top-color: var(--site-accent, #8b5cf6);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.subcategory-card:hover::after {
  transform: scaleX(1);
}

.subcategory-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--site-text, #0f172a);
}

.subcategory-card p {
  font-size: 0.875rem;
  color: var(--site-text-muted, #64748b);
}

.subcategory-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--site-primary, #3b82f6);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: auto;
  transition: gap var(--dur-normal) var(--ease-std);
}

.subcategory-card:hover .subcategory-arrow {
  gap: 0.5rem;
}

/* ═══ Worksheet Grid ═══ */
.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.75rem 1.25rem;
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-fast) var(--ease-std),
              border-color var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-std);
}

.worksheet-card:hover {
  background: var(--site-primary-light, #eff6ff);
  border-color: var(--site-primary-border, #bfdbfe);
  transform: translateY(-1px);
}

.worksheet-number {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary, #3b82f6);
  font-family: var(--font-heading);
  font-weight: 700;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-std);
}

.worksheet-card:hover .worksheet-number {
  background: var(--site-primary, #3b82f6);
  color: var(--site-text-inverse, #ffffff);
  transform: scale(1.08);
}

.worksheet-card h3 {
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
  color: var(--site-text, #0f172a);
}

.worksheet-problems {
  font-size: 0.8rem;
  color: var(--site-text-muted, #64748b);
}

/* ═══ Content Toggle ═══ */
.body-content--collapsible {
  margin: 1rem 0;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
}

.content-toggle {
  border: none;
}

.content-toggle summary {
  padding: 0.9rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--site-primary-dark, #1e3a8a);
  cursor: pointer;
  background: var(--site-primary-light, #eff6ff);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-std);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-toggle summary::-webkit-details-marker {
  display: none;
}

.content-toggle summary::after {
  content: '⌄';
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--site-primary, #3b82f6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--site-background, #ffffff);
  border-radius: 50%;
  transition: transform var(--dur-normal) var(--ease-std);
}

.content-toggle[open] summary::after {
  transform: rotate(180deg);
}

.content-toggle summary:hover {
  background: #dbeafe;
}

.content-toggle[open] summary {
  border-bottom-color: var(--site-primary-border, #bfdbfe);
}

.content-toggle-panel {
  padding: 1.25rem 1.5rem;
}

.content-toggle-panel h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
  margin: 1rem 0 0.5rem;
}

.content-toggle-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--site-primary-hover, #2563eb);
  margin: 0.75rem 0 0.4rem;
}

.content-toggle-panel p {
  line-height: 1.7;
  color: var(--site-text-secondary, #1e293b);
  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, #1e293b);
}

.content-toggle-panel li {
  margin: 0.3rem 0;
  line-height: 1.6;
}

.content-toggle-panel strong {
  color: var(--site-primary-dark, #1e3a8a);
}

/* ═══ Score Panel ═══ */
.score-panel {
  display: none;
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.score-panel.score-visible {
  display: block;
  animation: scoreSlide 300ms var(--ease-std) both;
}

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

.score-detail {
  font-size: 1rem;
  font-weight: 600;
  color: var(--site-text, #0f172a);
}

.score-pct {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--site-primary, #3b82f6);
}

/* ═══ Content Section ═══ */
.content-section {
  padding: 1.5rem;
  margin: 1rem 0;
}

.content-section h2 {
  font-family: var(--font-heading);
  color: var(--site-primary-dark, #1e3a8a);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.content-section h3 {
  font-family: var(--font-heading);
  color: var(--site-primary-hover, #2563eb);
  font-weight: 600;
}

.content-section p {
  line-height: 1.7;
  color: var(--site-text-secondary, #1e293b);
}

/* ═══ Interactive Answer Input ═══ */
.answer-input {
  border: 2px solid var(--site-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  background: var(--site-background, #ffffff);
  color: var(--site-text, #0f172a);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-std),
              box-shadow var(--dur-fast) var(--ease-std);
}

.answer-input:focus {
  border-color: var(--site-primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

/* Problem states */
.problem.is-correct .answer-input {
  border-color: var(--color-success, #22c55e);
  background: var(--color-success-light, #f0fdf4);
  color: var(--color-success-text, #166534);
}

.problem.is-wrong .answer-input {
  border-color: var(--color-error, #ef4444);
  background: var(--color-error-light, #fef2f2);
  color: var(--color-error-text, #991b1b);
}

.problem.is-empty .answer-input {
  border-color: var(--color-warning, #f59e0b);
  background: var(--color-warning-light, #fffbeb);
}

.problem.is-correct {
  background: color-mix(in srgb, #22c55e 4%, white);
  border-left: 3px solid var(--color-success, #22c55e);
}

.problem.is-wrong {
  background: color-mix(in srgb, #ef4444 4%, white);
  border-left: 3px solid var(--color-error, #ef4444);
}

.problem.is-empty {
  background: color-mix(in srgb, #f59e0b 4%, white);
  border-left: 3px solid var(--color-warning, #f59e0b);
}

/* Problem hover */
.problem {
  transition: transform 180ms var(--ease-std), box-shadow 180ms var(--ease-std);
}

.problem:hover { transform: translateX(2px); }

.problem .num {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary, #3b82f6);
  font-family: var(--font-heading);
  font-weight: 700;
}

.problem .answer {
  background: var(--color-success-light, #f0fdf4);
  color: var(--color-success-text, #166534);
  font-weight: 700;
  border-radius: var(--radius-md, 8px);
}

/* ═══ Score Retry Button ═══ */
.score-retry {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary, #3b82f6);
  border: 2px solid var(--site-primary-border, #bfdbfe);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std),
              border-color var(--dur-fast) var(--ease-std);
}

.score-retry:hover {
  background: var(--site-primary, #3b82f6);
  color: var(--site-text-inverse, #ffffff);
  border-color: var(--site-primary-hover, #2563eb);
}

/* ═══ Page Navigation ═══ */
.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-border, #e2e8f0);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-sm);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md, 8px);
  color: var(--site-primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--dur-fast) var(--ease-std);
}

.btn-nav:hover {
  background: var(--site-primary-light, #eff6ff);
}

.btn-nav.disabled {
  color: var(--site-border-medium, #cbd5e1);
  cursor: not-allowed;
}

/* ═══ 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; }
.seo-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }

.seo-block {
  background: var(--site-background, #ffffff);
  border: 1px solid var(--site-border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-normal) var(--ease-std),
              transform var(--dur-normal) var(--ease-std);
}

.seo-block:hover {
  transform: scale(1.015);
  box-shadow: var(--shadow-md);
}

.seo-card {
  background: var(--site-background, #ffffff);
  border-color: var(--site-border, #e2e8f0);
  border-top: none;
}

.seo-card::before          { background: var(--site-primary, #3b82f6); }
.seo-card.features::before { background: var(--site-primary, #3b82f6); }
.seo-card.benefits::before { background: var(--site-accent, #8b5cf6); }
.seo-card.faq::before      { background: var(--site-primary-dark, #1e3a8a); }
.seo-card.tips::before     { background: var(--site-accent, #8b5cf6); }
.seo-card.steps::before    { background: #06b6d4; }
.seo-card.tutorial::before { background: var(--site-primary, #3b82f6); }
.seo-card.examples::before { background: #0ea5e9; }
.seo-card.use-cases::before    { background: #a855f7; }
.seo-card.common-mistakes::before { background: var(--color-error, #ef4444); }
.seo-card.practice::before     { background: #f97316; }
.seo-card.requirements::before { background: var(--site-accent, #8b5cf6); }
.seo-card.resources::before    { background: #14b8a6; }
.seo-card.next-steps::before   { background: var(--site-primary, #3b82f6); }
.seo-card.summary::before      { background: var(--site-border-dark, #94a3b8); }
.seo-card.related::before      { background: var(--site-accent, #8b5cf6); }

.seo-components--secondary .seo-block { background: var(--site-primary-light, #eff6ff); }

.seo-block.tutorial       { border-left: 3px solid var(--site-primary, #3b82f6); }
.seo-block.examples       { border-left: 3px solid #0ea5e9; }
.seo-block.use-cases      { border-left: 3px solid #a855f7; }
.seo-block.common-mistakes { border-left: 3px solid var(--color-error, #ef4444); }
.seo-block.practice       { border-left: 3px solid #f97316; }
.seo-block.requirements   { border-left: 3px solid var(--site-accent, #8b5cf6); }
.seo-block.resources      { border-left: 3px solid #14b8a6; }
.seo-block.next-steps     { border-left: 3px solid var(--site-primary, #3b82f6); }
.seo-block.summary        { border-left: 3px solid var(--site-border-dark, #94a3b8); }
.seo-block.related        { border-left: 3px solid var(--site-accent, #8b5cf6); }

/* SEO block typography */
.seo-block h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
  margin: 0 0 0.6rem;
}

.seo-block h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--site-primary-hover, #2563eb);
  margin: 0.6rem 0 0.4rem;
}

.seo-block h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--site-primary, #3b82f6);
  margin: 0.5rem 0 0.3rem;
}

.seo-block p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--site-text-secondary, #1e293b);
  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, #1e293b);
  margin: 0.25rem 0;
}

.seo-block strong {
  color: var(--site-primary-dark, #1e3a8a);
}

.seo-block a {
  color: var(--site-primary, #3b82f6);
  text-decoration: none;
}

.seo-block a:hover {
  text-decoration: underline;
}

/* FAQ details */
.seo-block details {
  border-bottom: 1px solid var(--site-border, #e2e8f0);
  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-primary-hover, #2563eb);
}

.seo-block details summary::-webkit-details-marker { display: none; }

.seo-block details summary::before {
  content: "▸";
  margin-right: 0.4rem;
  color: var(--site-primary, #3b82f6);
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-std);
}

.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, #64748b);
  font-size: 0.88rem;
}

/* ═══ Utility 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-std) both; }
.slide-up { animation: slideUp 300ms var(--ease-std) both; }

/* Staggered card entry */
.category-card,
.subcategory-card { animation: fadeInUp 350ms var(--ease-std) both; }

.category-card:nth-child(1),
.subcategory-card:nth-child(1) { animation-delay: 0ms; }
.category-card:nth-child(2),
.subcategory-card:nth-child(2) { animation-delay: 50ms; }
.category-card:nth-child(3),
.subcategory-card:nth-child(3) { animation-delay: 100ms; }
.category-card:nth-child(4),
.subcategory-card:nth-child(4) { animation-delay: 150ms; }
.category-card:nth-child(5),
.subcategory-card:nth-child(5) { animation-delay: 200ms; }
.category-card:nth-child(6),
.subcategory-card:nth-child(6) { animation-delay: 250ms; }

/* ═══ Dark Mode ═══ */
@media (prefers-color-scheme: dark) {
  :root {
    --site-background:    #020b1a;
    --site-surface:       #091428;
    --site-text:          #e2e8f0;
    --site-text-primary:  #e2e8f0;
    --site-text-secondary:#cbd5e1;
    --site-text-muted:    #94a3b8;
    --site-text-light:    #64748b;
    --site-border:        #1e3a5f;
    --site-border-medium: #1e40af;
    --site-border-dark:   #2563eb;
    --site-primary-light: rgba(59, 130, 246, 0.12);
    --site-primary-border: #1e40af;
    --shadow-sm:         0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md:         0 4px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg:         0 10px 20px rgba(0, 0, 0, 0.6);
    --shadow-card:       0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 10px 24px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4);
    --shadow-btn-hover:  0 4px 14px rgba(59, 130, 246, 0.35);
    --shadow-btn-active: 0 1px 4px rgba(0, 0, 0, 0.4);
  }

  body { background: var(--site-background); }

  ::selection      { background: rgba(59, 130, 246, 0.3); color: #e2e8f0; }
  ::-moz-selection { background: rgba(59, 130, 246, 0.3); color: #e2e8f0; }

  ::-webkit-scrollbar-track { background: var(--site-background); }
  ::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.3); }

  .hero {
    background: linear-gradient(135deg, #091428 0%, #0a1628 100%);
    border-bottom-color: var(--site-border);
  }
  .hero::before {
    background-image:
      linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
  }
  .hero::after {
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  }
  .hero h1    { color: #e2e8f0; }
  .hero .subtitle { color: var(--site-text-muted); }

  .stat-item {
    background: var(--site-surface);
    border-color: var(--site-border);
    color: var(--site-text);
  }
  .stat-number { color: #60a5fa; }

  .page-header {
    background: var(--site-surface);
    border-bottom-color: var(--site-border);
  }
  .page-header h1  { color: #e2e8f0; }

  .breadcrumb {
  }
  .breadcrumb li:last-child { color: var(--site-text); }

  .set-switcher { background: var(--site-surface); border-color: var(--site-border); }
  .set-btn      { background: var(--site-surface); border-color: var(--site-border); color: var(--site-text); }
  .set-btn:hover { background: rgba(59, 130, 246, 0.12); }
  .set-btn.active { background: var(--site-primary); border-color: var(--site-primary-hover); }

  .btn { background: var(--site-surface); color: var(--site-text); }

  .intro,
  .intro-section {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--site-border);
  }
  .intro h3, .intro-section h3 { color: #93c5fd; }
  .intro p, .intro-section p   { color: var(--site-text-muted); }

  .body-content       { background: var(--site-surface); border-color: var(--site-border); }
  .problems-grid      { border-top-color: var(--site-border); }
  .problem            { color: var(--site-text); border-bottom-color: var(--site-border); }
  .problem .num       { background: rgba(59, 130, 246, 0.14); color: #60a5fa; }

  .category-card      { background: var(--site-surface); border-color: var(--site-border); }
  .category-card h3   { color: var(--site-text); }
  .category-card p    { color: var(--site-text-muted); }
  .category-icon      { background: rgba(59, 130, 246, 0.14); }
  .category-card:hover .category-icon { background: rgba(59, 130, 246, 0.25); }

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

  .worksheet-card  { background: var(--site-surface); border-color: var(--site-border); }
  .worksheet-card:hover { background: rgba(59, 130, 246, 0.1); border-color: var(--site-primary); }
  .worksheet-number { background: rgba(59, 130, 246, 0.15); }
  .worksheet-card h3 { color: var(--site-text); }
  .worksheet-card:hover .worksheet-number { background: var(--site-primary); color: white; }

  .body-content--collapsible { border-color: var(--site-border); }
  .content-toggle summary { background: var(--site-surface); color: #93c5fd; }
  .content-toggle summary:hover { background: rgba(59, 130, 246, 0.1); }
  .content-toggle summary::after { background: var(--site-background); }
  .content-toggle[open] summary { border-bottom-color: var(--site-border); }
  .content-toggle-panel h2 { color: #e2e8f0; }
  .content-toggle-panel h3 { color: #93c5fd; }
  .content-toggle-panel p  { color: var(--site-text-muted); }
  .content-toggle-panel strong { color: #e2e8f0; }

  .score-panel { background: var(--site-surface); border-color: var(--site-border); }
  .score-detail { color: var(--site-text); }

  .content-section h2 { color: #93c5fd; }
  .content-section h3 { color: #60a5fa; }
  .content-section p  { color: var(--site-text-muted); }

  .answer-input {
    background: var(--site-surface);
    border-color: var(--site-border);
    color: var(--site-text);
  }

  .section-header h2 { color: var(--site-text); }
  .section-header p  { color: var(--site-text-muted); }

  .page-navigation { background: var(--site-surface); border-color: var(--site-border); }

  .seo-block { background: var(--site-surface); border-color: var(--site-border); }
  .seo-block h2     { color: #e2e8f0; }
  .seo-block h3     { color: #93c5fd; }
  .seo-block h4     { color: #60a5fa; }
  .seo-block p, .seo-block li  { color: var(--site-text-muted); }
  .seo-block strong { color: #e2e8f0; }
  .seo-components--secondary .seo-block { background: rgba(59, 130, 246, 0.07); }

  .variant-chip {
    background: rgba(59, 130, 246, 0.14);
    border-color: var(--site-border);
    color: #60a5fa;
  }
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .hero h1 { font-size: 1.9rem; }
  .hero .subtitle { max-width: 100%; font-size: 1rem; }
  .hero-stats { gap: 0.75rem; }
  .stat-number { font-size: 1.4rem; }
  .stat-item { padding: 0.625rem 1rem; }
  .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; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { flex-direction: column; gap: 0.5rem; align-items: center; }
}

/* ═══ Print — clean professional output ═══ */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: Georgia, serif !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a { color: #000000 !important; text-decoration: underline !important; }

  .page-header, .hero, .breadcrumb, .btn, .set-switcher,
  .page-nav, .page-navigation, .seo-components,
  .score-panel, .score-retry,
  .categories-section, .worksheets-section, .subcategories-section,
  .hero::before, .hero::after { display: none !important; }

  .body-content {
    border: 1pt solid #ccc !important;
    border-radius: 0 !important;
  }

  .category-card, .subcategory-card, .worksheet-card {
    break-inside: avoid;
  }

  .category-card::after, .subcategory-card::after { display: none !important; }
  .section-header h2::after { display: none !important; }

  .problem { border-bottom: 1pt solid #ddd !important; }
  .answer-input { border: 1pt solid #999 !important; }

  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
