@charset "UTF-8";
/**
 * Full Skin — 001-arithmetic (Easy Math / Arithmetic)
 * Theme:   Sky blue + emerald mint — IXL meets Apple
 * Primary: #2563eb  Accent: #10b981
 * Design:  Bright, clean, airy — premium tutoring platform feel
 */

/* ═══════════════════════════════════════════════════════
   BASE RESETS & GLOBAL POLISH
   ═══════════════════════════════════════════════════════ */

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, #eff6ff);
  color: var(--site-primary-dark, #1e3a8a);
}
::-moz-selection {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary-dark, #1e3a8a);
}

*:focus-visible {
  outline: 2.5px solid var(--site-primary, #2563eb);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--site-surface, #f0f9ff); }
::-webkit-scrollbar-thumb {
  background: var(--site-primary-border, #bfdbfe);
  border-radius: 4px;
  border: 2px solid var(--site-surface, #f0f9ff);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--site-primary, #2563eb);
}

/* ═══════════════════════════════════════════════════════
   BODY BACKGROUND — Fixed gradient canvas
   ═══════════════════════════════════════════════════════ */

body {
  background: linear-gradient(160deg, #f0f9ff 0%, #ffffff 40%, #f0fdf4 100%);
  background-attachment: fixed;
  color: var(--site-text, #0f172a);
  font-family: var(--font-body);
}

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY — Heading hierarchy
   ═══════════════════════════════════════════════════════ */

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-family: var(--font-heading);
}

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

/* ═══════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════
   HERO — Diagonal pattern, bold heading, gradient accent
   ═══════════════════════════════════════════════════════ */

.hero {
  position: relative;
  background: #ffffff;
  border-bottom: 3px solid transparent;
  background-clip: padding-box;
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

/* Subtle diagonal line pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 28px,
      rgba(37, 99, 235, 0.025) 28px,
      rgba(37, 99, 235, 0.025) 29px
    );
  pointer-events: none;
  z-index: 0;
}

/* Gradient accent line at bottom */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #2563eb) 0%, var(--site-accent, #10b981) 60%, var(--site-primary-light, #eff6ff) 100%);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--site-primary-dark, #1e3a8a);
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero .subtitle,
.hero .hero-subtitle {
  font-size: 1.1rem;
  color: var(--site-text-light, #475569);
  margin-top: 0.75rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* Hero stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 0.85rem 1.4rem;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  box-shadow: var(--shadow-card, 0 1px 4px rgba(37,99,235,0.08));
  transition: transform var(--dur-normal) var(--transition-smooth),
              box-shadow var(--dur-normal) var(--transition-smooth);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(37,99,235,0.14));
}

.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--site-primary, #2563eb);
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--site-text-muted, #64748b);
  margin-top: 0.15rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════════════════════ */

/* Breadcrumb — clean left-aligned text, no box */
.breadcrumb {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 0.5rem 0;
  margin: 0 0 0.5rem 0;
  text-align: left;
}

.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);
  justify-content: flex-start;
}

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

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

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

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

/* ═══════════════════════════════════════════════════════
   SET SWITCHER
   ═══════════════════════════════════════════════════════ */

.set-switcher {
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(37,99,235,0.06));
}

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

.set-btn {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-btn, 12px);
  color: var(--site-text, #0f172a);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--transition-smooth);
}

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

.set-btn.active {
  background: var(--site-primary, #2563eb);
  color: #ffffff;
  border-color: var(--site-primary-hover, #1d4ed8);
  box-shadow: var(--shadow-btn, 0 2px 8px rgba(37,99,235,0.30));
}

.set-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--site-primary, #2563eb);
  border-radius: 3px;
  animation: slideIn 200ms var(--transition-smooth);
}

@keyframes slideIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ═══════════════════════════════════════════════════════
   BUTTONS — Premium pill style
   ═══════════════════════════════════════════════════════ */

.btn {
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  border-radius: var(--radius-btn, 12px);
  background: #ffffff;
  color: var(--site-text, #0f172a);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(37,99,235,0.06));
  min-height: 44px;
  transition: transform var(--dur-fast) var(--transition-smooth),
              box-shadow var(--dur-fast) var(--transition-smooth),
              background var(--dur-fast) var(--transition-smooth);
}

.btn:hover {
  box-shadow: var(--shadow-btn-hover, 0 4px 16px rgba(37,99,235,0.40));
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.12);
  transition: transform 80ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--site-primary, #2563eb) 0%, var(--site-primary-hover, #1d4ed8) 100%);
  color: #ffffff;
  border-color: var(--site-primary-hover, #1d4ed8);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--site-primary-hover, #1d4ed8) 0%, var(--site-primary-dark, #1e3a8a) 100%);
  box-shadow: var(--shadow-btn-hover, 0 4px 16px rgba(37,99,235,0.40));
}

.btn-success, .btn-answers {
  background: linear-gradient(135deg, var(--site-accent, #10b981) 0%, var(--site-accent-hover, #059669) 100%);
  color: #ffffff;
  border-color: var(--site-accent-hover, #059669);
}

.btn-success:hover, .btn-answers:hover {
  background: linear-gradient(135deg, var(--site-accent-hover, #059669) 0%, var(--site-accent-dark, #047857) 100%);
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}

.btn-check {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border-color: #d97706;
}

.btn-check:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--site-primary, #2563eb);
  border-radius: var(--radius-btn, 12px);
  color: var(--site-primary, #2563eb);
  background: transparent;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px;
  transition: background var(--dur-normal) ease,
              color var(--dur-normal) ease,
              transform var(--dur-fast) ease;
}

.btn-outline:hover {
  background: var(--site-primary, #2563eb);
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-links-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════
   INTRO SECTION
   ═══════════════════════════════════════════════════════ */

.intro, .intro-section {
  background: linear-gradient(135deg, var(--site-primary-light, #eff6ff) 0%, #dbeafe 100%);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

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

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

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

/* ═══════════════════════════════════════════════════════
   BODY CONTENT / WORKSHEET
   ═══════════════════════════════════════════════════════ */

.body-content {
  background: #ffffff;
  border-radius: 0 0 var(--radius-card, 16px) var(--radius-card, 16px);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-top: none;
}

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

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

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

/* Problem number badge */
.problem .num {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary, #2563eb);
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Answer badge */
.problem .answer {
  background: #d1fae5;
  color: #065f46;
  font-weight: 700;
  border-radius: var(--radius-btn, 12px);
}

/* ═══════════════════════════════════════════════════════
   VARIANT CHIP
   ═══════════════════════════════════════════════════════ */

.variant-chip {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  color: var(--site-primary-hover, #1d4ed8);
  background: var(--site-primary-light, #eff6ff);
  border: 1px solid var(--site-primary-border, #bfdbfe);
}

/* ═══════════════════════════════════════════════════════
   SECTION HEADERS — Accent underline
   ═══════════════════════════════════════════════════════ */

.section-header {
  position: relative;
  padding-bottom: 1rem;
  margin: 1.5rem 0 1.75rem;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #2563eb), var(--site-accent, #10b981));
  border-radius: 2px;
}

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

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

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

/* ═══════════════════════════════════════════════════════
   CATEGORY CARDS — Left border + icon
   ═══════════════════════════════════════════════════════ */

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

.category-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-left: 4px solid var(--site-primary, #2563eb);
  border-radius: var(--radius-card, 16px);
  box-shadow: var(--shadow-card, 0 1px 4px rgba(37,99,235,0.08), 0 4px 16px rgba(37,99,235,0.04));
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-normal) var(--transition-smooth),
              box-shadow var(--dur-normal) var(--transition-smooth),
              border-color var(--dur-normal) var(--transition-smooth);
  animation: fadeInUp 0.5s var(--transition-smooth) both;
}

.category-card:hover {
  transform: translateY(-3px);
  border-left-color: var(--site-accent, #10b981);
  box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(37,99,235,0.14));
}

/* Bottom accent reveal on hover */
.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #2563eb), var(--site-accent, #10b981));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--transition-smooth);
}

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

.category-card:nth-child(1)  { animation-delay: 0.05s; }
.category-card:nth-child(2)  { animation-delay: 0.10s; }
.category-card:nth-child(3)  { animation-delay: 0.15s; }
.category-card:nth-child(4)  { animation-delay: 0.20s; }
.category-card:nth-child(5)  { animation-delay: 0.25s; }
.category-card:nth-child(6)  { animation-delay: 0.30s; }
.category-card:nth-child(7)  { animation-delay: 0.35s; }
.category-card:nth-child(8)  { animation-delay: 0.40s; }

.category-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

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

.category-card p {
  font-size: 0.85rem;
  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, #2563eb);
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════
   SUBCATEGORY CARDS — Top accent bar
   ═══════════════════════════════════════════════════════ */

.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 {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-top: 3px solid var(--site-primary, #2563eb);
  border-radius: var(--radius-card, 16px);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-normal) var(--transition-smooth),
              box-shadow var(--dur-normal) var(--transition-smooth),
              border-top-color var(--dur-normal) var(--transition-smooth);
}

.subcategory-card:hover {
  border-top-color: var(--site-accent, #10b981);
  box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(37,99,235,0.14));
  transform: translateY(-3px);
}

.subcategory-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #2563eb), var(--site-accent, #10b981));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--transition-smooth);
}

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

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

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

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

/* ═══════════════════════════════════════════════════════
   WORKSHEET GRID — Number badge cards
   ═══════════════════════════════════════════════════════ */

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

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

.worksheet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-bottom: 3px solid var(--site-primary, #2563eb);
  border-radius: var(--radius-card, 16px);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: all var(--dur-normal) var(--transition-smooth);
}

.worksheet-card:hover {
  border-bottom-color: var(--site-accent, #10b981);
  background: var(--site-primary-light, #eff6ff);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(37,99,235,0.10));
}

.worksheet-number {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--site-primary, #2563eb);
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--site-primary-light, #eff6ff);
  border-radius: 50%;
  transition: transform var(--dur-fast) var(--transition-bounce);
}

.worksheet-card:hover .worksheet-number {
  transform: scale(1.1);
}

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

/* ═══════════════════════════════════════════════════════
   CONTENT TOGGLE (Collapsible) — Chevron icon
   ═══════════════════════════════════════════════════════ */

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

.content-toggle { border: none; }

.content-toggle summary {
  padding: 0.9rem 1.25rem;
  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) ease;
  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, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: rgba(37,99,235,0.1);
  border-radius: 50%;
  transition: transform var(--dur-normal) ease;
}

.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-size: 1.3rem;
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
  margin: 1rem 0 0.5rem;
  font-family: var(--font-heading);
}

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

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

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

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

/* ═══════════════════════════════════════════════════════
   SCORE PANEL — Progress bar reveal
   ═══════════════════════════════════════════════════════ */

.score-panel {
  display: none;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  transition: all var(--dur-normal) ease;
}

.score-panel.score-visible {
  display: block;
  animation: scoreSlide 300ms ease-out;
}

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

.score-inner { position: relative; }

.score-inner::after {
  content: "";
  display: block;
  height: 6px;
  margin-top: 0.75rem;
  background: var(--site-primary-light, #eff6ff);
  border-radius: 3px;
  overflow: hidden;
}

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

.score-pct {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--site-primary, #2563eb);
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
}

/* Staggered score reveal */
.score-panel.score-visible .score-icon   { animation: fadeIn 200ms ease-out 0ms both; }
.score-panel.score-visible .score-detail { animation: fadeIn 200ms ease-out 80ms both; }
.score-panel.score-visible .score-pct    { animation: fadeIn 250ms ease-out 160ms both; }

/* ═══════════════════════════════════════════════════════
   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 {
  color: var(--site-primary-hover, #1d4ed8);
  font-weight: 600;
}

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

/* ═══════════════════════════════════════════════════════
   INTERACTIVE ANSWER INPUT
   ═══════════════════════════════════════════════════════ */

.answer-input {
  border: 2px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-btn, 12px);
  background: #ffffff;
  color: var(--site-text, #0f172a);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}

.answer-input:focus {
  border-color: var(--site-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

/* Problem states */
.problem.is-correct .answer-input {
  border-color: var(--site-accent, #10b981);
  background: #f0fdf4;
  color: var(--site-accent-dark, #047857);
}

.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: var(--site-accent, #10b981) !important; }
.problem.is-wrong   { border-left-color: #ef4444 !important; }

/* ═══════════════════════════════════════════════════════
   SCORE RETRY BUTTON
   ═══════════════════════════════════════════════════════ */

.score-retry {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary, #2563eb);
  border: 2px solid var(--site-primary-border, #bfdbfe);
  cursor: pointer;
  border-radius: var(--radius-btn, 12px);
  transition: all var(--dur-fast) ease;
}

.score-retry:hover {
  background: var(--site-primary, #2563eb);
  color: #ffffff;
  border-color: var(--site-primary-hover, #1d4ed8);
  box-shadow: var(--shadow-btn, 0 2px 8px rgba(37,99,235,0.30));
}

/* ═══════════════════════════════════════════════════════
   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(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in   { animation: fadeIn 300ms ease-out; }
.slide-up  { animation: slideUp 300ms ease-out; }
.hero      { animation: fadeInUp 0.6s ease-out both; }

/* ═══════════════════════════════════════════════════════
   SEO COMPONENTS — White cards with top-accent bars
   Palette: primary + accent (2-color, no rainbow)
   ═══════════════════════════════════════════════════════ */

.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: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-card, 0 1px 4px rgba(37,99,235,0.08));
  transition: box-shadow var(--dur-normal) ease,
              transform var(--dur-normal) ease;
}

.seo-block:hover {
  box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(37,99,235,0.14));
  transform: translateY(-2px);
}

/* SEO Card — top accent bar */
.seo-card {
  background: #ffffff;
  border-color: var(--site-border, #e2e8f0);
  border-top: none;
}

.seo-card::before {
  content: '';
  display: block;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 0.75rem;
  background: var(--site-primary, #2563eb);
}

.seo-card:hover {
  box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(37,99,235,0.14));
  transform: translateY(-3px);
}

/* Card band — primary/accent alternating */
.seo-card.features::before    { background: var(--site-primary, #2563eb); }
.seo-card.benefits::before    { background: var(--site-accent, #10b981); }
.seo-card.faq::before         { background: var(--site-primary-hover, #1d4ed8); }
.seo-card.tips::before        { background: var(--site-accent, #10b981); }
.seo-card.steps::before       { background: var(--site-primary, #2563eb); }
.seo-card.tutorial::before    { background: var(--site-accent, #10b981); }
.seo-card.examples::before    { background: var(--site-primary-hover, #1d4ed8); }
.seo-card.use-cases::before   { background: var(--site-accent, #10b981); }
.seo-card.common-mistakes::before { background: var(--site-primary, #2563eb); }
.seo-card.practice::before    { background: var(--site-accent, #10b981); }
.seo-card.requirements::before { background: var(--site-primary-hover, #1d4ed8); }
.seo-card.resources::before   { background: var(--site-accent, #10b981); }
.seo-card.next-steps::before  { background: var(--site-primary, #2563eb); }
.seo-card.summary::before     { background: var(--site-accent, #10b981); }
.seo-card.related::before     { background: var(--site-primary-hover, #1d4ed8); }

/* Secondary seo-blocks: tinted surface + left bar */
.seo-components--secondary .seo-block {
  background: var(--site-surface, #f0f9ff);
}

.seo-block.tutorial     { border-left: 3px solid var(--site-primary, #2563eb); }
.seo-block.examples     { border-left: 3px solid var(--site-accent, #10b981); }
.seo-block.use-cases    { border-left: 3px solid var(--site-primary-hover, #1d4ed8); }
.seo-block.common-mistakes { border-left: 3px solid var(--site-accent, #10b981); }
.seo-block.practice     { border-left: 3px solid var(--site-primary, #2563eb); }
.seo-block.requirements { border-left: 3px solid var(--site-accent, #10b981); }
.seo-block.resources    { border-left: 3px solid var(--site-primary-hover, #1d4ed8); }
.seo-block.next-steps   { border-left: 3px solid var(--site-accent, #10b981); }
.seo-block.summary      { border-left: 3px solid var(--site-primary, #2563eb); }
.seo-block.related      { border-left: 3px solid var(--site-accent, #10b981); }

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

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

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

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

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

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

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

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

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

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

.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;
}

/* ═══════════════════════════════════════════════════════
   PAGE NAVIGATION
   ═══════════════════════════════════════════════════════ */

.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  box-shadow: var(--shadow-card, 0 1px 4px rgba(37,99,235,0.08));
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-btn, 12px);
  color: var(--site-primary, #2563eb);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--dur-fast) ease;
}

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

/* ═══════════════════════════════════════════════════════
   IXL-STYLE HOMEPAGE CATEGORY CARDS V2
   ═══════════════════════════════════════════════════════ */

.category-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.category-card-v2 {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--site-primary-border, #bfdbfe);
  border-radius: var(--radius-card, 16px);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow-card, 0 1px 4px rgba(37,99,235,0.08));
  transition: transform var(--dur-normal) var(--transition-smooth),
              box-shadow var(--dur-normal) var(--transition-smooth);
  animation: fadeInUp 0.5s var(--transition-smooth) both;
}

.category-card-v2:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(37,99,235,0.14));
}

.category-card-v2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--site-primary, #2563eb), var(--site-accent, #10b981));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--transition-smooth);
}

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

.category-card-v2:nth-child(1)  { animation-delay: 0.05s; }
.category-card-v2:nth-child(2)  { animation-delay: 0.10s; }
.category-card-v2:nth-child(3)  { animation-delay: 0.15s; }
.category-card-v2:nth-child(4)  { animation-delay: 0.20s; }
.category-card-v2:nth-child(5)  { animation-delay: 0.25s; }
.category-card-v2:nth-child(6)  { animation-delay: 0.30s; }

.card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  background: var(--site-primary, #2563eb);
}

/* Alternate badge colors: primary / accent (2-color, no rainbow) */
.category-card-v2:nth-child(odd)  .cat-badge { background: var(--site-primary, #2563eb); }
.category-card-v2:nth-child(even) .cat-badge { background: var(--site-accent, #10b981); }

.card-header-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--site-primary-dark, #1e3a8a);
  text-decoration: none;
  line-height: 1.25;
  font-family: var(--font-heading);
}

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

.category-desc {
  font-size: 0.82rem;
  color: var(--site-text-muted, #64748b);
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.card-divider {
  border: none;
  border-top: 1px solid var(--site-primary-border, #bfdbfe);
  margin: 0.5rem 0 0.6rem;
  opacity: 0.7;
}

.subcategory-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.subcategory-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.28rem 0.35rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--site-primary-hover, #1d4ed8);
  text-decoration: none;
  min-height: 44px;
  transition: background var(--dur-fast) ease;
}

.subcategory-link:hover {
  background: var(--site-primary-light, #eff6ff);
  color: var(--site-primary-dark, #1e3a8a);
}

.sub-count {
  font-size: 0.75rem;
  color: var(--site-text-muted, #64748b);
  font-weight: 500;
  white-space: nowrap;
  margin-left: 0.4rem;
}

.subcategory-link--more {
  color: var(--site-text-muted, #64748b);
  font-weight: 600;
}

.subcategory-link--more:hover {
  color: var(--site-primary, #2563eb);
  background: var(--site-primary-light, #eff6ff);
}

.subcategory-link--explore {
  display: inline-flex;
  font-size: 0.85rem;
  color: var(--site-primary, #2563eb);
  font-weight: 600;
  text-decoration: none;
  padding: 0.28rem 0.35rem;
}

.subcategory-link--explore:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   HOMEPAGE HERO — Left-aligned variant
   ═══════════════════════════════════════════════════════ */

.homepage .hero {
  text-align: left;
  padding: 1.25rem 0 0.75rem;
  background: none;
  border: none;
  border-radius: 0;
}

.homepage .hero::before { display: none; }
.homepage .hero::after  { display: none; }

.homepage .hero h1,
.homepage .hero-title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 800;
  color: var(--site-primary-dark, #1e3a8a);
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
}

.homepage .hero-subtitle { font-size: 0.95rem; color: var(--site-text-light, #475569); }
.homepage .hero-stats { justify-content: flex-start; margin-top: 0.6rem; }
.homepage .hero-actions { margin-top: 0.8rem; }

/* ═══════════════════════════════════════════════════════
   MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════ */

/* Breadcrumb transition */
.breadcrumb a {
  transition: color var(--dur-fast) ease;
}

.breadcrumb li:not(:last-child)::after {
  transition: color var(--dur-fast) ease;
}

/* ═══════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════ */
/* All print rules are consolidated in the platform layer:
   - print-base.css (dedicated print route)
   - main.css @media print (browser Ctrl+P path)
   - print-profile-math.css (math-specific density) */


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hero h1 { font-size: clamp(1.5rem, 5vw, 1.9rem); }
  .hero .subtitle, .hero .hero-subtitle { max-width: 100%; }
  .hero-stats { gap: 1.2rem; }
  .stat-number { font-size: 1.3rem; }
  .categories-grid { grid-template-columns: 1fr; }
  .subcategories-grid { grid-template-columns: 1fr; }
  .worksheets-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 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: 1.5rem 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { flex-direction: column; gap: 0.8rem; }
  .categories-grid { grid-template-columns: 1fr; }
  .subcategories-grid { grid-template-columns: 1fr; }
  .category-grid-v2 { grid-template-columns: 1fr; gap: 1rem; }
  .homepage .hero h1,
  .homepage .hero-title { font-size: 1.5rem; }
}


/* ═══════════════════════════════════════════════════════
   DARK MODE — Full brand-matched dark theme
   ═══════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════
   ANTI-GRAVITY HOMEPAGE THEME
   ═══════════════════════════════════════════════════════ */

/* 1. Global Reset for Antigravity Theme */
.homepage.antigravity-theme {
  font-family: var(--font-body);
  color: var(--site-text);
  background: var(--site-background);
  /* The anti-gravity gradient background sits behind the whole page */
  background-image: radial-gradient(circle at 15% 50%, rgba(125,211,252,0.08), transparent 40%),
                    radial-gradient(circle at 85% 10%, rgba(167,243,208,0.1), transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

.hero-ag-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* 2. Floating Premium Hero Section */
.hero-ag {
  position: relative;
  overflow: hidden;
  margin: 1rem 0 2.5rem;
  padding: 2.5rem 2rem;
  border-radius: var(--detail-border-radius);
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  box-shadow: var(--shadow-lg);
  max-width: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-ag-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: floatOrb 12s ease-in-out infinite alternate;
}
.orb-1 { width: 400px; height: 400px; background: var(--site-primary-border); top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: rgba(167,243,208,0.3); bottom: -50px; right: 50px; animation-duration: 15s; }
.orb-3 { width: 250px; height: 250px; background: rgba(254,240,138,0.2); top: 30%; left: 40%; animation-duration: 9s; }

.paper-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--site-border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--site-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 80%);
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-40px) scale(1.1); }
}

.hero-ag-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

@media (max-width: 900px) {
  .hero-ag-container { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
}

.brand-eyebrow {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 99px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--site-primary-border);
}

.hero-ag-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--site-text);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  font-family: var(--font-heading);
}

.hero-ag-subtitle {
  font-size: 1.15rem;
  color: var(--site-text-light);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 500px;
}
@media (max-width: 900px) { .hero-ag-subtitle { margin-left: auto; margin-right: auto; } }

.hero-ag-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
@media (max-width: 900px) { .hero-ag-stats { justify-content: center; } }

.ag-stat-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--site-surface);
  border: 1px solid var(--site-border-dark);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-badge);
  font-size: 0.9rem;
  color: var(--site-text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--transition-bounce);
}
.ag-stat-badge:hover {
  transform: translateY(-2px);
  border-color: var(--site-primary);
}
.ag-stat-text strong {
  color: var(--site-primary-dark);
  font-family: var(--font-number);
  font-size: 1.05rem;
}

.btn-ag-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--site-primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-btn);
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  transition: all var(--dur-normal) var(--transition-smooth);
  border: 2px solid transparent;
}
.btn-ag-primary:hover {
  background: var(--site-primary-hover);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-2px);
  color: #fff;
}
.btn-ag-primary .btn-arrow {
  transition: transform var(--dur-fast) ease;
}
.btn-ag-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.hero-ag-visual {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-sheets {
  position: relative;
  width: 100%;
  height: 100%;
}

.sheet {
  position: absolute;
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 220px;
}
.sheet-1 {
  top: 10%;
  right: 15%;
  transform: rotate(4deg);
  animation: float1 6s ease-in-out infinite alternate;
  border-top: 6px solid var(--site-primary);
}
.sheet-2 {
  top: 30%;
  left: 0;
  transform: rotate(-6deg);
  animation: float2 7s ease-in-out infinite alternate-reverse;
  border-top: 6px solid var(--site-accent-dark);
}
.sheet-math {
  font-family: var(--font-number);
  font-size: 1.5rem;
  color: var(--site-text);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.1em;
}

.sheet-badge {
  position: absolute;
  top: 0;
  right: 5%;
  background: var(--site-accent2);
  color: #a16207;
  font-family: var(--font-number);
  font-size: 2rem;
  font-weight: 900;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transform: rotate(15deg);
  box-shadow: var(--shadow-md);
  animation: float3 5s ease-in-out infinite alternate;
  border: 4px solid #fff;
}

@keyframes float1 { 0% { transform: translateY(0) rotate(4deg); } 100% { transform: translateY(-15px) rotate(6deg); } }
@keyframes float2 { 0% { transform: translateY(0) rotate(-6deg); } 100% { transform: translateY(15px) rotate(-4deg); } }
@keyframes float3 { 0% { transform: translateY(0) rotate(15deg) scale(1); } 100% { transform: translateY(-10px) rotate(20deg) scale(1.05); } }


/* 3. Grouped Category Framework (Anti-gravity cards) */
.ag-explore-section {
  padding: 2rem 0;
}

/* All .container sections inherit standard padding from .container global rule */

.ag-section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.ag-section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--site-text);
  margin-bottom: 0.5rem;
}
.ag-section-subtitle {
  color: var(--site-text-muted);
  font-size: 1.1rem;
}

.ag-level-group {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--site-border);
  border-radius: var(--detail-border-radius);
  padding: 2rem;
  margin-bottom: 3rem;
  backdrop-filter: blur(10px);
}

.ag-level-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.ag-level-icon {
  width: 60px;
  height: 60px;
  background: var(--site-surface);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--site-border-dark);
}
.ag-level-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--site-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}
.ag-level-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--site-text);
  margin: 0;
}

.ag-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Category Card (Anti-gravity floating style) */
.ag-cat-card {
  background: var(--site-surface);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  border: 1px solid var(--site-border-dark);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-normal) var(--transition-bounce);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ag-cat-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--site-primary-border);
}

.ag-cat-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.ag-cat-icon {
  width: 48px;
  height: 48px;
  background: var(--site-primary-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--site-primary-dark);
  flex-shrink: 0;
}
.icon-multiplication, .icon-division { background: rgba(167,243,208,0.3); }

.ag-cat-title-link {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--site-text);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
  line-height: 1.2;
}
.ag-cat-title-link:hover {
  color: var(--site-primary-dark);
}
.ag-cat-desc {
  font-size: 0.9rem;
  color: var(--site-text-light);
  margin: 0.4rem 0 0;
  line-height: 1.4;
}

.ag-cat-body {
  border-top: 1px dashed var(--site-border-dark);
  padding-top: 1rem;
}

.ag-subcat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ag-subcat-pill {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--site-text-light);
  background: var(--site-background);
  border: 1px solid var(--site-border);
  padding: 0.35rem 0.7rem;
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--dur-fast) ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.ag-subcat-pill:hover {
  background: var(--site-primary-light);
  color: var(--site-primary-dark);
  border-color: var(--site-primary-border);
}

.ag-subcat-count {
  background: var(--site-border);
  color: var(--site-text-light);
  font-size: 0.7rem;
  font-family: var(--font-number);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  font-weight: 700;
}

.pill-more, .pill-explore {
  background: transparent;
  color: var(--site-primary-dark);
  border-color: transparent;
}
.pill-more:hover, .pill-explore:hover {
  background: var(--site-primary-dark);
  color: #fff;
}

/* 4. SEO Collapsibles & Blocks (Anti-gravity version) */
.ag-seo-content {
  margin: 2rem auto;
}
.ag-content-toggle {
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: var(--detail-border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ag-content-toggle > summary {
  padding: 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--site-text);
  cursor: pointer;
  list-style: none;
  transition: background var(--dur-fast) ease;
}
.ag-content-toggle > summary:hover { background: var(--site-background); }
.ag-toggle-panel {
  padding: 0 1.5rem 1.5rem;
  color: var(--site-text-light);
  line-height: 1.7;
}

.ag-seo-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.ag-seo-card {
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.ag-seo-card h2, .ag-seo-card h3 {
  font-family: var(--font-heading);
  color: var(--site-text);
  font-weight: 800;
  margin-top: 0;
}

/* 5. Detail & List Layout Controls (Strict Global Width Pacts) */
/* Globally overriding .container so header, main, and footer perfectly align */
.container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
@media (min-width: 1024px) {
  .container {
    padding: 0 32px !important;
  }
}

/* Constrain .site-header to 1200px so its visible bar matches content width.
   body is display:flex, so flex child needs explicit width to avoid shrink-wrap. */
.site-header {
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-bottom: none !important;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  box-shadow: var(--shadow-sm) !important;
}

/* Force .homepage padding to exactly match .container */
.homepage {
  padding: 0 24px !important;
}
@media (min-width: 1024px) {
  .homepage {
    padding: 0 32px !important;
  }
}

/* .container inside .homepage must NOT add its own padding, or it stacks. */
.homepage .container {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Logo sizing handled by platform .logo-img in main.css */


main.homepage.antigravity-theme {
  box-sizing: border-box !important;
}

.ag-page-header {
  margin: 2rem 0;
  padding: 1.5rem 0 2rem 0; /* Remove left/right padding to keep text flush with container */
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--site-border-dark); /* Education standard clean underline */
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.ag-header-visual {
  margin-top: 1rem;
}

.ag-set-switcher-wrapper {
  margin-bottom: 2rem;
  width: 100%;
}
.ag-set-switcher {
  background: var(--site-surface);
  border: 1px solid var(--site-border-dark);
  padding: 1.5rem 2rem;
  border-radius: var(--detail-border-radius);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.ag-set-switcher-label {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--site-text);
  font-size: 1.1rem;
}
.ag-set-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.ag-set-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--site-background);
  border: 1px solid var(--site-border);
  border-radius: var(--radius-btn);
  color: var(--site-text-light);
  font-family: var(--font-number);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all var(--dur-fast) var(--transition-bounce);
}
.ag-set-btn:hover {
  border-color: var(--site-primary-hover);
  color: var(--site-primary-dark);
  transform: translateY(-2px);
}
.ag-set-btn.active {
  background: var(--site-primary-dark);
  color: #fff;
  border-color: var(--site-primary-dark);
  box-shadow: var(--shadow-sm);
}

.ag-detail-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 6. Worksheet Customizations (Detail Page Anti-gravity Theme & Dark Mode Overrides) */
/* Eradicate any 1060px wild widths from detail-atom.css to follow 1200px layout contract */
.ag-detail-main .form-exercise-container {
  max-width: 100% !important;
}

/* Eradicate native detail-atom-mount padding to align with SEO cards */
#detail-atom-mount {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Unify toolbars and UI controls */
.ag-detail-main .da-toolbar {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin-bottom: 2rem !important;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* Absolute Light Theme Enforcer for problem cells to prevent prefers-color-scheme: dark bleed */
.ag-detail-main .form-problem {
  background: var(--site-surface) !important;
  border: 1px solid var(--site-border) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius-card) !important;
  padding: 1.25rem 2rem !important;
  margin-bottom: 0 !important;
  transition: all var(--dur-fast) var(--transition-smooth) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
}
.ag-detail-main .form-problem:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--site-primary-border) !important;
}
.ag-detail-main .form-problem .problem-text {
  color: var(--site-text) !important;
  font-family: var(--font-number) !important;
}
.ag-detail-main .form-problem .problem-number {
  background: var(--site-primary-light) !important;
  color: var(--site-primary-dark) !important;
  font-family: var(--font-number) !important;
  font-weight: 800 !important;
  border-radius: var(--radius-badge) !important;
  border: 1px solid var(--site-primary-border) !important;
  min-width: 2rem !important;
  height: 2rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 0.5rem !important;
}
.ag-detail-main .form-problem .problem-input {
  border: 2px solid var(--site-border-dark) !important;
  background: var(--site-background) !important;
  color: var(--site-primary-dark) !important;
  font-family: var(--font-number) !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
  padding: 0.4rem !important;
  width: 5rem !important;
  text-align: center !important;
}
.ag-detail-main .form-problem .problem-input:focus {
  border-color: var(--site-primary) !important;
  background: var(--site-surface) !important;
  box-shadow: 0 0 0 3px var(--site-primary-light) !important;
  outline: none !important;
}
.ag-detail-main .form-problem.answered { 
  background: #f0fdf4 !important; 
  border-left-color: var(--site-accent-dark) !important; 
}
.ag-detail-main .form-problem.is-wrong { 
  border-left-color: #ef4444 !important; 
}

/* 7. Breadcrumb Overrides (Clean, light, left-aligned textbook path) */
.breadcrumb {
  background: transparent !important;
  border: none !important;
  padding: 0 0 0.5rem 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  width: 100%;
}
.breadcrumb ol {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important; /* Force left alignment */
  gap: 0.5rem !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--site-text-light) !important;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
}
.breadcrumb li:not(:last-child)::after {
  content: '/';
  color: var(--site-border-dark);
  margin-left: 0.5rem;
  font-weight: 400;
}
.breadcrumb a {
  color: var(--site-text-muted) !important;
  text-decoration: none !important;
  background: transparent !important;
  padding: 0 !important;
}
.breadcrumb a:hover {
  color: var(--site-primary-dark) !important;
}
