:root {
  --page-bg: #f4f6ff;
  --page-gradient: linear-gradient(180deg, #f8faff 0%, #eef2ff 45%, #f9f5ff 100%);
  --surface: #ffffff;
  --surface-alt: #f0f4ff;
  --surface-muted: #f7f9ff;
  --border: #d8def2;
  --border-strong: #c0c9e8;
  --text: #0f172a;
  --text-soft: #475569;
  --text-subtle: #64748b;
  --text-inverse: #f8fafc;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.12);
  --success: #16a34a;
  --danger: #ef4444;
  --shadow-xs: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-s: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-m: 0 18px 40px rgba(15, 23, 42, 0.14);
  --shadow-l: 0 24px 48px rgba(15, 23, 42, 0.16);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --gradient-text: linear-gradient(120deg, #2563eb 0%, #7c3aed 55%, #f97316 100%);
  --transition: 0.28s ease;

  /* Aliases used by legacy inline styles */
  --bg: var(--surface);
  --bg-alt: var(--surface-alt);
  --text-light: var(--text-soft);
  --gradient: var(--page-gradient);
  --border-soft: var(--border);
  --shadow: var(--shadow-s);
  --primary-gradient: linear-gradient(120deg, #2563eb, #7c3aed);
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-shadow: var(--shadow-s);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", Tahoma, sans-serif;
  background: var(--page-gradient);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--primary);
}

p {
  margin: 0 0 1rem;
}

main {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 3.5rem 0 4.5rem;
  flex: 1;
}

main.site-main,
main.page-shell {
  width: min(1120px, 94vw);
}

.container {
  width: min(1120px, 94vw);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  z-index: 99;
  transition: transform var(--transition);
}

.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  z-index: 10;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.brand-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-xs);
}

.brand-title {
  font-size: clamp(1.35rem, 2vw, 1.55rem);
  letter-spacing: 0.01em;
}

.nav-toggle {
  display: none;
  border: none;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
}

.primary-nav a {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--text);
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  box-shadow: var(--shadow-xs);
}

.primary-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--primary);
}

.nav-cta {
  margin-left: 0.75rem;
}

@media (max-width: 960px) {
  .primary-nav {
    gap: 0.6rem;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  .nav-bar {
    flex-wrap: wrap;
  }

  .primary-nav {
    width: 100%;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 18px;
    box-shadow: var(--shadow-s);
    border: 1px solid rgba(15, 23, 42, 0.08);
  }

  .primary-nav[data-open="false"] {
    display: none;
  }

  .nav-cta {
    margin-left: 0;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-s);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Sections */
.section {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: var(--shadow-s);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.section::after {
  content: "";
  position: absolute;
  inset: auto -160px -160px auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 65%);
  pointer-events: none;
}

.section-header {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.8rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.section-subtitle {
  margin: 0;
  color: var(--text-soft);
  max-width: 62ch;
}

.section--alt {
  background: rgba(37, 99, 235, 0.06);
  box-shadow: none;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.narrow {
  max-width: 680px;
}

/* Quote strip */
.quote-strip {
  margin: 2rem 0 3rem;
}

.quote-strip__inner {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.14), rgba(124, 58, 237, 0.16));
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
}

.quote-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.quote-text {
  flex: 1;
  font-weight: 600;
}

.quote-refresh {
  border: none;
  background: rgba(255, 255, 255, 0.9);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-xs);
}

/* Feature grid */
.feature-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 2rem;
}

.feature-card,
.category-card,
.info-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 0.8rem;
}

.feature-card:hover,
.category-card:hover,
.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-m);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.14);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.feature {
  background: var(--surface-muted);
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-highlights {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 2rem;
}

.highlight-card {
  background: rgba(37, 99, 235, 0.08);
  border-radius: 18px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.highlight-card strong {
  display: block;
  font-size: 1.8rem;
  color: var(--primary);
}

/* Cards & lists */
.card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.resources {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.resource-list a {
  color: var(--primary);
  font-weight: 600;
}

.contact-card {
  background: var(--surface);
  padding: 1.6rem;
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--glow {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.18));
  color: var(--primary);
}

/* Flashcards */
.flashcards-page {
  display: grid;
  gap: 2.5rem;
  justify-items: center;
  text-align: center;
}

.flashcards-page h1 {
  margin: 0;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  color: transparent;
}

.flashcards-page p.intro {
  max-width: 640px;
  color: var(--text-soft);
}

.flashcard {
  width: min(92vw, 420px);
  height: 260px;
  perspective: 1000px;
  position: relative;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  border-radius: 18px;
  box-shadow: var(--shadow-m);
  cursor: pointer;
}

.flashcard.flipped .flashcard-inner,
.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  place-items: center;
  padding: 1.6rem;
}

.flashcard-face.back {
  transform: rotateY(180deg);
}

.flashcard-complete .flashcard-inner {
  box-shadow: var(--shadow-xs);
}

.flashcard-complete .flashcard-face {
  opacity: 0.8;
}

.controls {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.input-box {
  display: flex;
  gap: 0.6rem;
  width: min(92vw, 420px);
}

.input-box input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
}

.mode-switch {
  display: flex;
  gap: 0.6rem;
}

.mode-switch button {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.mode-switch button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Maths page */
.maths-engine__layout,
.triangle-engine__layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  align-items: start;
}

.maths-engine__sidebar,
.triangle-engine__info {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.maths-stats,
.triangle-stats {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0;
}

.maths-stats__label,
.triangle-stats__label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.maths-stats__value,
.triangle-stats__value {
  font-size: 1.4rem;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #f97316);
  background-size: 200% 100%;
  animation: flow 8s linear infinite;
  transition: width 0.3s ease;
}

@keyframes flow {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

.maths-question,
.triangle-question {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

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

.triangle-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  padding: 1.4rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.triangle-card:hover,
.triangle-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-m);
}

.triangle-card--active {
  border-color: var(--primary);
  box-shadow: var(--shadow-m);
}

.triangle-svg {
  width: 100%;
  max-height: 220px;
  margin-bottom: 1rem;
}

.triangle-shape {
  fill: rgba(37, 99, 235, 0.12);
  stroke: rgba(37, 99, 235, 0.55);
  stroke-width: 4;
}

.triangle-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.2rem 0;
}

.triangle-actions {
  display: flex;
  justify-content: flex-end;
}

.triangle-controls .btn.btn--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.triangle-controls .btn.btn--active:hover,
.triangle-controls .btn.btn--active:focus-visible {
  background: var(--primary-hover);
}

.maths-options,
.triangle-options {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0;
}

.option-btn,
.maths-options button,
.triangle-options button {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.option-btn:hover,
.option-btn:focus-visible,
.maths-options button:hover,
.maths-options button:focus-visible,
.triangle-options button:hover,
.triangle-options button:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.option-btn.correct,
.maths-options button.correct,
.triangle-options button.correct {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(22, 163, 74, 0.6);
}

.option-btn.incorrect,
.maths-options button.incorrect,
.triangle-options button.incorrect {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.6);
}

.maths-feedback,
.triangle-feedback,
.feedback {
  font-weight: 600;
  min-height: 1.2rem;
  color: var(--text-soft);
}

.feedback.ok,
.maths-feedback.ok,
.triangle-feedback.ok {
  color: var(--success);
}

.feedback.no,
.maths-feedback.no,
.triangle-feedback.no {
  color: var(--danger);
}

.sparkle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(124, 58, 237, 0.25), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(37, 99, 235, 0.2), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.sparkle-active {
  opacity: 1;
}

.status-pop {
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% {
    transform: scale(0.98);
    opacity: 0.6;
  }
  60% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* Mock page */
.mock-page {
  display: grid;
  gap: 2.5rem;
}

.intro-card,
.result-card {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-s);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.category-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1rem;
}

.category-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), opacity var(--transition);
}

.category-chip:hover,
.category-chip:focus-visible {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
}

.category-chip.fade-out {
  opacity: 0.4;
  pointer-events: none;
}

.config-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 1.5rem;
}

.control label {
  font-weight: 600;
}

.control input,
.control select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
}

.hud {
  display: grid;
  gap: 1rem;
  align-items: center;
  grid-template-columns: 1fr auto auto;
  margin: 1.4rem 0 1rem;
}

.progress-outer {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.progress-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #f97316);
  background-size: 200% 100%;
  animation: flow 8s linear infinite;
  transition: width 0.3s ease;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.question-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1.6rem;
}

.q-text {
  font-weight: 700;
  font-size: 1.1rem;
}

.options {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0;
}

.controls-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.result-list {
  margin: 0.6rem 0 0 1.2rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 1rem;
}

details.faq-item {
  background: var(--surface);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-xs);
}

details.faq-item[open] {
  box-shadow: var(--shadow-s);
}

details.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  float: right;
  transition: transform var(--transition);
}

details.faq-item[open] summary::after {
  transform: rotate(45deg);
}

/* Pricing */
.hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  background: var(--surface);
  border-radius: 26px;
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: var(--shadow-s);
  margin-bottom: 3rem;
}

.hero-content h1 {
  margin-top: 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.hero-illustration {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-illustration .orbit {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15), transparent 70%);
}

.hero-illustration .hero-card {
  position: absolute;
  padding: 1.1rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-m);
  text-align: center;
  width: 180px;
}

.grid {
  display: grid;
  gap: 1.4rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  max-width: 520px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
}

.input-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.consent-banner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: min(360px, 92vw);
  background: var(--surface);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow-l);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.9rem;
  z-index: 50;
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Blog */
.blog-hero {
  background: var(--surface);
  border-radius: 26px;
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: var(--shadow-s);
  margin-bottom: 3rem;
}

.blog-teasers {
  display: grid;
  gap: 1.5rem;
}

.blog-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 0.8rem;
}

.blog-card h3 {
  margin: 0;
}

.blog-card a {
  color: var(--primary);
}

.post-header {
  display: grid;
  gap: 0.6rem;
  text-align: center;
  margin-bottom: 2rem;
}

.post-meta {
  color: var(--text-subtle);
  font-size: 0.95rem;
}

.post {
  background: var(--surface);
  border-radius: 26px;
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: var(--shadow-s);
  font-size: 1.05rem;
  color: var(--text);
}

.post p,
.post li {
  color: var(--text-soft);
}

.post-lede {
  font-size: clamp(1.12rem, 2.3vw, 1.3rem);
  color: var(--text);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.post-body {
  display: block;
}

.post h2 {
  margin-top: 2rem;
}

.post ul,
.post ol {
  padding-left: 1.4rem;
}

.post-body section + section {
  margin-top: 2.25rem;
}

.responsive-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .responsive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .responsive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.info-card {
  background: var(--surface-alt);
  padding: 1.4rem;
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  color: var(--text);
}

.numbered-steps {
  counter-reset: steps;
  list-style: none;
  padding-left: 0;
}

.numbered-steps li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.4rem;
}

.numbered-steps li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.callout {
  background: rgba(37, 99, 235, 0.08);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 14px;
  margin-top: 1.25rem;
  color: var(--text);
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1.25rem;
  border-radius: 16px;
}

.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.post-table caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.post-table th,
.post-table td {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  vertical-align: top;
  text-align: left;
  color: var(--text-soft);
}

.post-table thead th {
  background: rgba(37, 99, 235, 0.1);
  color: var(--text);
}

.post-table tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.5);
}

/* Footer */
.site-footer {
  background: rgba(15, 23, 42, 0.94);
  color: var(--text-inverse);
  padding: 2.8rem 0 2.4rem;
}

.footer-inner {
  display: grid;
  gap: 1.6rem;
  width: min(1120px, 94vw);
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.footer-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-brand .brand-logo {
  box-shadow: none;
}

.footer-links,
.footer-meta {
  display: grid;
  gap: 0.6rem;
}

.footer-links a {
  color: rgba(248, 250, 252, 0.85);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #fff;
}

.footer-meta span {
  display: block;
  color: rgba(248, 250, 252, 0.7);
}

.footer-meta strong,
.footer-meta [data-visitor-count] {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

@media (max-width: 640px) {
  main {
    padding: 2.5rem 0 3rem;
  }

  .section {
    padding: 1.8rem;
  }

  .maths-engine__layout,
  .triangle-engine__layout {
    grid-template-columns: 1fr;
  }

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

  .quote-strip__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
