@charset "UTF-8";
/**
 * Skin — 022-scienceprint
 * Theme: Deep Teal + Soft Cream
 * Archetype: academic-precision
 * Brand: Premium print-ready science materials — precise, clean, classroom-ready
 * All colors via CSS variables (tokens.css). No hardcoded hex values.
 */

/* ═══ 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;
  }
}

/* Text selection — teal tinted */
::selection {
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
}
::-moz-selection {
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
}

/* Focus ring — WCAG 2.1 AA compliant, 3:1 minimum */
*:focus-visible {
  outline: 3px solid var(--site-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* ═══ Body ═══ */
body {
  background: var(--gradient-body);
  color: var(--site-text);
  min-height: 100vh;
}

/* ═══ Hero — Academic Precision ═══ */

.hero {
  background: var(--gradient-hero);
  border-bottom: 3px solid var(--site-primary);
  padding: 4rem 2rem 3.5rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}

/* Left teal accent bar — defines academic authority */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--gradient-hero-band);
  pointer-events: none;
}

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

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

/* Teal underline accent on hero heading */
.hero h1::after {
  content: '';
  display: block;
  width: var(--accent-line-width);
  height: var(--accent-line-height);
  background: var(--site-accent);
  border-radius: 2px;
  margin-top: 0.75rem;
}

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

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

.stat-item {
  text-align: center;
  padding: 0.875rem 1.5rem;
  background: var(--gradient-stat-badge);
  border-radius: var(--radius-md);
  color: var(--site-text-inverse);
  min-width: 120px;
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default);
}

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

.stat-number {
  display: block;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--site-text-inverse);
  font-family: var(--font-heading);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

/* ═══ Page Header — Detail pages ═══ */

.page-header {
  background: var(--site-primary-light);
  border-bottom: 3px solid var(--site-primary);
  border-left: 5px solid var(--site-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.75rem 2rem 1.25rem;
}

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

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

/* ═══ 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);
}

.breadcrumb a {
  color: var(--site-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-default);
}

.breadcrumb a:hover {
  color: var(--site-primary-dark);
  text-decoration: underline;
}

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

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

/* ═══ Set Switcher ═══ */

.set-switcher {
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.set-switcher-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--site-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.set-btn {
  background: var(--site-surface-raised);
  border: 1.5px solid var(--site-border);
  border-radius: var(--radius-button);
  color: var(--site-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-default),
              background var(--dur-fast) var(--ease-default),
              color var(--dur-fast) var(--ease-default);
}

.set-btn:hover {
  border-color: var(--site-primary);
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
}

.set-btn.active {
  background: var(--site-primary);
  color: var(--site-text-inverse);
  border-color: var(--site-primary-dark);
}

/* ═══ Buttons ═══ */

.btn {
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  border-radius: var(--radius-button);
  background: var(--site-surface-raised);
  color: var(--site-text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-fast) var(--ease-default),
              transform var(--dur-fast) var(--ease-default),
              background var(--dur-fast) var(--ease-default);
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
}

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

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

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

.btn-primary:hover {
  background: var(--site-primary-hover);
  box-shadow: var(--shadow-btn-brand);
}

/* Print button — prominent teal, print icon */
.btn-print,
.btn-primary.btn-print {
  background: var(--site-primary);
  color: var(--site-text-inverse);
  border-color: var(--site-primary-dark);
  font-weight: 700;
}

.btn-print:hover {
  background: var(--site-primary-dark);
  box-shadow: var(--shadow-btn-brand);
  transform: translateY(-1px);
}

.btn-success,
.btn-answers {
  background: var(--site-accent);
  color: var(--site-text-inverse);
  border-color: var(--site-accent-dark);
}

.btn-success:hover,
.btn-answers:hover {
  background: var(--site-accent-hover);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.30);
}

.btn-check {
  background: var(--site-success);
  color: var(--site-text-inverse);
  border-color: #16a34a;
}

.btn-check:hover {
  background: #16a34a;
}

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

/* ═══ Category Label Chips (amber) ═══ */

.variant-chip,
.category-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  color: var(--site-accent-dark);
  background: var(--site-accent-light);
  border: 1px solid #fcd34d;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Teal chip variant */
.subject-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  color: var(--site-primary-dark);
  background: var(--site-primary-light);
  border: 1px solid var(--site-border-medium);
  letter-spacing: 0.03em;
}

/* ═══ Intro / Info Section ═══ */

.intro,
.intro-section {
  background: var(--site-primary-light);
  border: 1px solid var(--site-border-medium);
  border-left: 4px solid var(--site-primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.intro h3,
.intro-section h3 {
  font-weight: 700;
  color: var(--site-text-primary);
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
}

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

.intro strong,
.intro-section strong {
  color: var(--site-text);
  font-weight: 700;
}

/* ═══ Body Content / Worksheet ═══ */

.body-content {
  background: var(--site-surface-raised);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--site-border-medium);
  border-top: none;
}

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

.problem {
  border-bottom: 1px solid var(--site-border-light);
  font-size: 1.125rem;
  color: var(--site-text);
  transition: transform var(--dur-fast) var(--ease-default);
}

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

/* Problem number badge */
.problem .num {
  background: var(--site-primary-light);
  color: var(--site-primary);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.875rem;
}

/* Answer badge — amber */
.problem .answer {
  background: var(--site-accent-light);
  color: var(--site-accent-dark);
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid #fcd34d;
}

/* ═══ Answer Input ═══ */

.answer-input {
  border: 2px solid var(--site-border-medium);
  border-radius: var(--radius-md);
  background: var(--site-surface-raised);
  color: var(--site-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-default),
              box-shadow var(--dur-fast) var(--ease-default);
}

.answer-input:focus {
  border-color: var(--site-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
  outline: none;
}

/* Semantic states — always pair with border color change for accessibility */
.problem.is-correct .answer-input { border-color: var(--site-success); background: #f0fdf4; color: #15803d; }
.problem.is-wrong   .answer-input { border-color: var(--site-error);   background: #fef2f2; color: #991b1b; }
.problem.is-empty   .answer-input { border-color: var(--site-warning);  background: var(--site-accent-light); }
.problem.is-correct { border-left-color: var(--site-success) !important; }
.problem.is-wrong   { border-left-color: var(--site-error) !important; }

/* ═══ Score Panel ═══ */

.score-panel {
  display: none;
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border-medium);
  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-pct {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--site-primary);
  font-family: var(--font-heading);
}

.score-retry {
  background: var(--site-primary-light);
  color: var(--site-primary);
  border: 1.5px solid var(--site-border-medium);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-default),
              color var(--dur-fast) var(--ease-default);
}

.score-retry:hover {
  background: var(--site-primary);
  color: var(--site-text-inverse);
  border-color: var(--site-primary-dark);
}

/* ═══ Section Headers ═══ */

.section-header { margin: 2rem 0 1.25rem; }

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--site-text);
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  position: relative;
  padding-bottom: 0.65rem;
}

/* Teal underline accent */
.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.5rem;
  line-height: 1.6;
}

/* ═══ Category Cards — clean white, teal left accent ═══ */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
}

.category-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border-medium);
  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: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default),
              border-color var(--dur-normal) var(--ease-default);
}

/* Bottom accent bar 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) var(--ease-default);
}

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

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

.category-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--dur-normal) var(--ease-bounce);
}

.category-card:hover .category-icon {
  transform: scale(1.12) rotate(-2deg);
}

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

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

.category-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--site-primary);
  margin-top: 0.5rem;
}

/* ═══ Subject Tabs — teal underline indicator ═══ */

.subject-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--site-border-medium);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.subject-tabs::-webkit-scrollbar { display: none; }

.subject-tab {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--site-text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-default),
              border-color var(--dur-fast) var(--ease-default);
  font-family: var(--font-heading);
}

.subject-tab:hover {
  color: var(--site-primary);
  border-bottom-color: var(--site-border-medium);
}

.subject-tab.active,
.subject-tab[aria-current="page"] {
  color: var(--site-primary);
  border-bottom-color: var(--site-primary);
}

/* ═══ Subcategory Cards ═══ */

.subcategories-section { margin: 1.5rem 0; }

.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.subcategory-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border-medium);
  border-top: 3px solid var(--site-primary);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default);
}

.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) var(--ease-default);
}

.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);
  font-size: 0.95rem;
}

.subcategory-card p {
  font-size: 0.85rem;
  color: var(--site-text-muted);
  line-height: 1.4;
}

.subcategory-arrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--site-primary);
  margin-top: auto;
}

/* ═══ Worksheet List ═══ */

.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.875rem 1.25rem;
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-fast) var(--ease-default),
              border-color var(--dur-fast) var(--ease-default),
              box-shadow var(--dur-fast) var(--ease-default),
              transform var(--dur-fast) var(--ease-default);
}

.worksheet-card:hover {
  background: var(--site-primary-light);
  border-color: var(--site-border-medium);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.worksheet-number {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--site-primary);
  min-width: 2.5rem;
  font-family: var(--font-heading);
}

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

.worksheet-problems {
  font-size: 0.8rem;
  color: var(--site-text-muted);
  white-space: nowrap;
}

/* ═══ Content Toggle / Collapsible ═══ */

.body-content--collapsible {
  margin: 1rem 0;
  border: 1px solid var(--site-border-medium);
  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.9rem;
  color: var(--site-text-secondary);
  cursor: pointer;
  background: var(--site-background-alt);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-default);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
}

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

.content-toggle summary::after {
  content: '▾';
  font-size: 1rem;
  font-weight: 700;
  color: var(--site-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--site-primary-light);
  border-radius: var(--radius-full);
  transition: transform var(--dur-fast) var(--ease-default);
}

.content-toggle[open] summary::after { transform: rotate(180deg); }
.content-toggle summary:hover { background: var(--site-primary-light); }
.content-toggle[open] summary { border-bottom-color: var(--site-border-medium); }
.content-toggle-panel { padding: 1.25rem 1.5rem; }

.content-toggle-panel h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--site-text-primary);
  margin: 1rem 0 0.5rem;
  font-family: var(--font-heading);
}

.content-toggle-panel h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--site-text-secondary);
  margin: 0.75rem 0 0.4rem;
}

.content-toggle-panel p  { line-height: 1.7; color: var(--site-text-light); margin: 0.4rem 0; }
.content-toggle-panel ul,
.content-toggle-panel ol { padding-left: 1.25rem; margin: 0.5rem 0; color: var(--site-text-light); }
.content-toggle-panel li { margin: 0.3rem 0; line-height: 1.6; }
.content-toggle-panel strong { color: var(--site-text); }

/* ═══ Content Section ═══ */

.content-section { padding: 1.5rem; margin: 1rem 0; }
.content-section h2 {
  font-family: var(--font-heading);
  color: var(--site-text-primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}
.content-section h3 { color: var(--site-text-secondary); font-weight: 600; }
.content-section p  { line-height: 1.7; color: var(--site-text-light); }

/* ═══ Page Navigation ═══ */

.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  color: var(--site-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  transition: background var(--dur-fast) var(--ease-default),
              color var(--dur-fast) var(--ease-default);
}

.btn-nav:hover { background: var(--site-primary-light); }
.btn-nav.disabled { color: var(--site-border-dark); cursor: not-allowed; }

/* ═══ SEO Components — dual-color system ═══ */

.seo-components { margin: 1.5rem 0; }
.seo-components--primary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.seo-components--secondary { margin-top: 1rem; }
.seo-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.seo-block {
  background: var(--site-surface-raised);
  border: 1px solid var(--site-border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-normal) var(--ease-default),
              transform var(--dur-normal) var(--ease-default);
}

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

/* SEO card top band */
.seo-card {
  position: relative;
  border-top: none;
  padding-top: 3.25rem;
  overflow: hidden;
}

.seo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--site-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.seo-card:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-primary) 15%, transparent);
}

/* Band colors per SEO content type */
.seo-card.features::before  { background: var(--site-primary); }
.seo-card.benefits::before  { background: var(--site-success); }
.seo-card.faq::before       { background: var(--site-primary-dark); }
.seo-card.tips::before      { background: var(--site-accent); }
.seo-card.steps::before     { background: #0ea5e9; }
.seo-card.tutorial::before  { background: var(--site-success); }
.seo-card.examples::before  { background: #6366f1; }
.seo-card.use-cases::before { background: #ec4899; }
.seo-card.common-mistakes::before { background: var(--site-error); }
.seo-card.practice::before  { background: var(--site-accent); }
.seo-card.requirements::before { background: #8b5cf6; }
.seo-card.resources::before { background: #14b8a6; }
.seo-card.next-steps::before { background: var(--site-primary); }
.seo-card.summary::before   { background: var(--site-text-muted); }
.seo-card.related::before   { background: #a855f7; }

/* Secondary SEO blocks — teal left bar */
.seo-components--secondary .seo-block { background: var(--site-background-alt); }
.seo-block.tutorial     { border-left: 3px solid var(--site-primary); }
.seo-block.examples     { border-left: 3px solid #6366f1; }
.seo-block.use-cases    { border-left: 3px solid #ec4899; }
.seo-block.common-mistakes { border-left: 3px solid var(--site-error); }
.seo-block.practice     { border-left: 3px solid var(--site-accent); }
.seo-block.requirements { border-left: 3px solid #8b5cf6; }
.seo-block.resources    { border-left: 3px solid #14b8a6; }
.seo-block.next-steps   { border-left: 3px solid var(--site-primary); }
.seo-block.summary      { border-left: 3px solid var(--site-text-muted); }
.seo-block.related      { border-left: 3px solid #a855f7; }

/* SEO typography */
.seo-block h2 { font-size: 1.05rem; font-weight: 700; color: var(--site-text-primary); margin: 0 0 0.6rem; font-family: var(--font-heading); }
.seo-block h3 { font-size: 0.95rem; font-weight: 600; color: var(--site-text-secondary); margin: 0.6rem 0 0.4rem; }
.seo-block h4 { font-size: 0.9rem; font-weight: 600; color: var(--site-text-muted); margin: 0.5rem 0 0.3rem; }
.seo-block p  { font-size: 0.9rem; line-height: 1.65; color: var(--site-text-light); margin: 0.35rem 0; }
.seo-block ul,
.seo-block ol { padding-left: 1.2rem; margin: 0.4rem 0; }
.seo-block li { font-size: 0.9rem; line-height: 1.55; color: var(--site-text-light); margin: 0.25rem 0; }
.seo-block strong { color: var(--site-text); }
.seo-block a  { color: var(--site-primary); text-decoration: none; }
.seo-block a:hover { text-decoration: underline; color: var(--site-primary-dark); }

/* FAQ accordion */
.seo-block details { border-bottom: 1px solid var(--site-border-light); padding: 0.5rem 0; }
.seo-block details:last-child { border-bottom: none; }
.seo-block details summary {
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
  color: var(--site-text-secondary);
  font-family: var(--font-heading);
}
.seo-block details summary::-webkit-details-marker { display: none; }
.seo-block details summary::before {
  content: '▸';
  margin-right: 0.4rem;
  color: var(--site-primary);
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-default);
}
.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.875rem; }

/* ═══ Card Entry 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; }

.category-card,
.subcategory-card,
.seo-block {
  animation: fadeInUp 350ms 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: 50ms; }
.category-card:nth-child(3),
.subcategory-card:nth-child(3),
.seo-block:nth-child(3) { animation-delay: 100ms; }
.category-card:nth-child(4),
.subcategory-card:nth-child(4),
.seo-block:nth-child(4) { animation-delay: 150ms; }
.category-card:nth-child(5),
.subcategory-card:nth-child(5),
.seo-block:nth-child(5) { animation-delay: 200ms; }
.category-card:nth-child(6),
.subcategory-card:nth-child(6),
.seo-block:nth-child(6) { animation-delay: 250ms; }

/* ═══ Responsive ═══ */

@media (max-width: 768px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero .subtitle { max-width: 100%; }
  .hero-stats { gap: 0.75rem; }
  .stat-number { font-size: 1.375rem; }
  .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; }
  .subject-tabs { gap: 0; }

  /* Touch target enforcement — minimum 44×44px */
  .btn, .set-btn, .btn-nav, .worksheet-card, .category-card, .subcategory-card {
    min-height: 44px;
  }
  .btn, .set-btn { 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; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; }
  .hero .subtitle { font-size: 0.95rem; }
  .hero-stats { flex-direction: column; gap: 0.75rem; }
  .seo-components--primary, .seo-more-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .category-card { padding: 1rem; }

  /* Horizontal scroll for worksheets on narrow screens */
  .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: var(--radius-sm);
  }

  /* Sticky nav bar on mobile */
  .page-navigation {
    position: sticky;
    bottom: 0;
    background: var(--site-surface-raised);
    border-top: 1px solid var(--site-border-medium);
    border-radius: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(15, 118, 110, 0.08);
  }
}

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

/* Safe area insets for notched devices */
@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 Styles ═══
 * Print IS the product for scienceprint.
 * All shadows, backgrounds, and decorative elements removed.
 * All sizes in pt/mm as per knowledge base rules.
 * ═══ */

@media print {
  /* Hide all interactive and navigational 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,
  .subject-tabs,
  .content-toggle summary,
  .no-print { display: none !important; }

  /* Force clean black-on-white output */
  body { background: #fff !important; color: #000 !important; }
  * { box-shadow: none !important; text-shadow: none !important; }

  /* Hero print treatment */
  .hero {
    padding: 0 0 8mm;
    border-bottom: 1.5pt solid #333;
    border-left: none;
    text-align: left;
    background: none !important;
  }
  .hero::before,
  .hero::after { display: none !important; }
  .hero h1 {
    font-size: var(--print-heading-size, 17pt);
    color: #000 !important;
    letter-spacing: 0;
  }
  .hero h1::after { display: none; }
  .hero .subtitle { font-size: 11pt; color: #444 !important; }

  /* Worksheet body */
  .body-content {
    border: none;
    border-radius: 0;
    background: none !important;
  }

  /* Prevent content splits at page breaks */
  .problem {
    page-break-inside: avoid;
    break-inside: avoid;
  }

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

  /* Print-safe borders */
  .category-card,
  .subcategory-card,
  .worksheet-card,
  .seo-block {
    border-radius: 0;
    border: 1pt solid var(--print-border-light, #999);
    border-left: 2pt solid var(--print-border, #333);
    background: none !important;
  }

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

  /* Body text for print — 11pt per knowledge base spec */
  .problem { font-size: 11pt; }
  .seo-block p, .seo-block li { font-size: 9pt; }

  /* Force exact color rendering for any needed brand elements */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ═══ Dark Mode — skin overrides ═══ */
@media (prefers-color-scheme: dark) {
  body {
    background: var(--gradient-body);
  }

  .hero {
    background: var(--gradient-hero);
    border-bottom-color: var(--site-primary);
  }

  .hero::before {
    background: var(--gradient-hero-band);
  }

  .hero h1 { color: var(--site-text-primary); }
  .hero .subtitle { color: var(--site-text-muted); }

  .stat-item {
    background: var(--gradient-stat-badge);
  }

  .page-header {
    background: var(--site-primary-light);
    border-left-color: var(--site-primary);
  }

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

  .intro,
  .intro-section {
    background: var(--site-background-alt);
    border-left-color: var(--site-primary);
  }

  /* Semantic state dark mode */
  .problem.is-correct .answer-input { background: #052e16; color: #86efac; }
  .problem.is-wrong   .answer-input { background: #450a0a; color: #fca5a5; }
  .problem.is-empty   .answer-input { background: #451a03; }

  .content-toggle summary { background: var(--site-background-alt); }
  .content-toggle summary:hover { background: var(--site-primary-light); }

  .content-toggle-panel p,
  .content-toggle-panel ul,
  .content-toggle-panel ol { color: var(--site-text-muted); }

  .seo-block p,
  .seo-block li { color: var(--site-text-muted); }
  .seo-block details p { color: var(--site-text-muted); }

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

  .seo-components--secondary .seo-block { background: var(--site-background-alt); }

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

  .btn-nav.disabled { color: var(--site-border-medium); }

  .worksheet-card:hover { background: var(--site-primary-light); }

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