/* ============================================================
   Orion Arithmetic Technical Solutions — stylesheet
   Design system referenced from speedmath.in (Onest type,
   blue/orange gradient accents, dotted hero pattern, dark mode)
   ============================================================ */

:root {
  /* Typography */
  --font-main: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Onest", system-ui, sans-serif;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;

  /* Colors — light theme */
  --bg-page: #f9fbff;
  --bg-section: #ffffff;
  --bg-section-soft: #f5f7ff;
  --bg-card: #f7f8ff;
  --text-main: #0f172a;
  --text-soft: #5b6472;
  --text-muted: #9ca3af;
  --text-cta: #ffffff;

  --accent-primary: #007eff;
  --accent-secondary: #ff6800;
  --accent-rgb: 63, 0, 209;
  --accent-gradient: linear-gradient(135deg, #3f00d1, #ff6800);
  --btn-gradient: linear-gradient(135deg, #ff6800, #3f00d1);

  --border-subtle: rgba(15, 23, 42, 0.08);

  --hero-pattern: radial-gradient(circle, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0.16) 1px, transparent 1px);
  --hero-pattern-size: 32px 32px;

  --gradient-blue: linear-gradient(135deg, #1d4ed8, #3b82f6);
  --gradient-orange: linear-gradient(135deg, #ff6800, #fb923c);
  --gradient-green: linear-gradient(135deg, #16a34a, #4ade80);
  --gradient-teal: linear-gradient(135deg, #0f9b8e, #17c3b2);

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 20px 48px rgba(15, 23, 42, 0.16);

  /* Spacing */
  --space-2: 0.5rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.125rem;
  --radius-2xl: 1.25rem;
  --radius-full: 999px;

  --transition-base: 0.25s ease;

  --container-max: 1200px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #060912;
  --bg-section: #0b0f1c;
  --bg-section-soft: #0b0f1c;
  --bg-card: #111729;
  --text-main: #e7eaf3;
  --text-soft: #9aa3b5;
  --text-muted: #6b7488;

  --border-subtle: rgba(148, 163, 184, 0.18);
  --hero-pattern: radial-gradient(circle, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.08) 1px, transparent 1px);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  overflow-x: hidden; /* clips off-canvas fixed drawer/overlay — must be on the root, not just body */
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--bg-page);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

.page-wrapper { min-height: 100vh; padding-top: 76px; } /* offset for the fixed header */

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 22px;
}

.d-flex { display: flex; align-items: center; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; color: var(--text-main); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: var(--fw-extrabold); letter-spacing: -0.5px; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); font-weight: var(--fw-bold); }
h3 { font-size: 1.2rem; font-weight: var(--fw-bold); }
h4 { font-size: 1.05rem; font-weight: var(--fw-bold); }
p { margin: 0 0 1rem; color: var(--text-main); }
em { font-style: italic; color: var(--accent-primary); }

.lucide {
  width: 20px; height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Theme-toggle icon visibility (only one shows per theme) */
#icon-sun { display: none; }
[data-theme="dark"] #icon-moon { display: none; }
[data-theme="dark"] #icon-sun { display: inline-block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--font-head);
  font-weight: var(--fw-semibold);
  font-size: 1rem;
  padding: .85rem 1.6rem;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, border-color .18s ease, color .18s ease;
  text-align: center;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}
.btn .lucide { width: 18px; height: 18px; }
.btn-gradient {
  background: var(--accent-gradient);
  background-clip: border-box;   /* gradient fills to the rounded edge cleanly */
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-gradient:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); filter: brightness(1.05); }
.btn-gradient:active { transform: translateY(0); filter: brightness(0.98); }
.btn-outline {
  background: var(--bg-section);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-outline:hover { border-color: var(--accent-primary); color: var(--accent-primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; }

.btn-icon {
  width: 42px; height: 42px; border-radius: var(--radius-lg);
  background: transparent; border: 2px solid var(--border-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-main); cursor: pointer; transition: all var(--transition-base);
  flex: none;
}
.btn-icon:hover { border-color: rgba(0, 126, 255, 0.4); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(249, 251, 255, .9);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
[data-theme="dark"] .site-header { background: rgba(6, 9, 18, .82); }

.site-header .container { height: 76px; }
.site-logo-img { height: 46px; width: auto; }

.nav-list { display: flex; align-items: center; gap: .3rem; }
.nav-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: var(--fw-semibold); font-size: .92rem; color: var(--text-soft);
  padding: .55rem .8rem; border-radius: var(--radius-full);
  transition: all var(--transition-base);
}
.nav-link .lucide { width: 16px; height: 16px; }
.nav-link:hover { color: var(--accent-primary); background: rgba(0, 126, 255, .08); }

.desktop-actions { display: flex; align-items: center; gap: .7rem; }
.nav-cta { padding: .6rem 1.3rem; }
.mobile-menu-btn { display: none; }

/* Mobile drawer */
.mobile-overlay {
  position: fixed; inset: 0; width: 100%; background: rgba(15, 23, 42, .5);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility 0s linear .25s; z-index: 199;
}
.mobile-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s ease; }

.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 84vw); max-width: 100%;
  background: var(--bg-section); z-index: 200;
  padding: 1.2rem 1.4rem; box-shadow: var(--shadow-xl);
  transform: translateX(100%); visibility: hidden;
  transition: transform .3s ease, visibility 0s linear .3s;
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateX(0); visibility: visible; transition: transform .3s ease; }
.mobile-drawer-header { margin-bottom: 1.2rem; }
.mobile-drawer-title { font-family: var(--font-head); font-weight: var(--fw-bold); font-size: 1.1rem; }
.mobile-drawer nav { align-items: stretch; }
.mobile-drawer .nav-link { justify-content: flex-start; width: 100%; padding: .8rem .6rem; font-size: 1rem; color: var(--text-main); }
.mobile-drawer .nav-link span { display: inline; }
.mobile-drawer hr { border: none; border-top: 1px solid var(--border-subtle); margin: .6rem 0; }

/* ---------- Hero ---------- */
.hero-section { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3rem); position: relative; }
.hero-section::before {
  content: ""; position: absolute; inset: -2rem -50vw auto -50vw; height: 620px;
  background-image: var(--hero-pattern); background-size: var(--hero-pattern-size);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 20%, black 40%, transparent 80%);
  pointer-events: none; z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  padding: .5rem 1rem; border-radius: var(--radius-full);
  font-size: .85rem; font-weight: var(--fw-semibold); color: var(--text-soft);
  margin-bottom: 1.3rem;
}
.hero-badge .lucide { width: 15px; height: 15px; color: var(--accent-primary); animation: heroSpin 2.4s linear infinite; }
@keyframes heroSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.hero-title { margin-bottom: .8rem; }
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-description { font-size: 1.08rem; color: var(--text-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.6rem 0 1.6rem; }

/* Google rating chip */
.google-rating {
  display: inline-flex; align-items: center; gap: .7rem;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  padding: .55rem .9rem; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: transform .18s ease;
}
.google-rating:hover { transform: translateY(-2px); }
.g-logo {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: var(--fw-black);
  font-size: 1rem; color: #fff;
  background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0 100%);
}
.g-logo.big { width: 44px; height: 44px; font-size: 1.5rem; margin-bottom: .5rem; }
.g-body { display: flex; flex-direction: column; line-height: 1.1; }
.g-top { display: flex; align-items: center; gap: .4rem; }
.g-top strong { font-family: var(--font-head); font-size: 1.15rem; }
.g-stars { color: #fbbc05; letter-spacing: 1px; font-size: .95rem; }
.g-sub { font-size: .72rem; color: var(--text-muted); font-weight: var(--fw-semibold); }
.g-score { font-family: var(--font-head); font-weight: var(--fw-bold); font-size: .85rem; }
.google-rating-footer { margin-top: .9rem; padding: .45rem .8rem; }

/* Hero visual — abacus + floating badges */
.hero-visual-col { position: relative; display: flex; justify-content: center; min-height: 340px; }
.abacus-frame-wrap { position: relative; z-index: 1; }
.abacus {
  background: var(--bg-card); padding: 22px; border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl); transform: rotate(-3deg);
  animation: floaty 6s ease-in-out infinite; border: 1px solid var(--border-subtle);
}
@keyframes floaty { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-12px); } }

/* ---------- Soroban (Japanese abacus) ---------- */
.soroban { --bead-w: 26px; --bead-h: 16px; --col-gap: 7px; }
.soroban-frame {
  background: linear-gradient(160deg, #e7cca0, #d3ac7c);
  border: 10px solid #5a3a1c; border-radius: 12px;
  padding: 14px 16px; position: relative;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.10), inset 0 2px 6px rgba(0,0,0,.15);
}
.soroban-heaven, .soroban-earth { display: flex; justify-content: center; gap: var(--col-gap); }
.sb-col {
  position: relative; width: var(--bead-w);
  display: flex; flex-direction: column; align-items: center;
}
.sb-col::before {   /* the vertical rod */
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  transform: translateX(-50%); border-radius: 2px;
  background: linear-gradient(90deg, #a9835a, #7d5c3a); z-index: 0;
}
.soroban-heaven .sb-col { height: 42px; justify-content: flex-start; }
.soroban-earth  .sb-col { height: 86px; justify-content: flex-end; gap: 1px; }
.sb-bead {
  width: var(--bead-w); height: var(--bead-h); position: relative; z-index: 1;
  background: linear-gradient(150deg, #8a5326 0%, #5a3418 55%, #3f240f 100%);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.sb-bead::after {   /* subtle highlight */
  content: ""; position: absolute; inset: 2px 30% auto 30%; height: 2px;
  background: rgba(255,225,190,.35); border-radius: 2px;
}
.soroban-beam {
  height: 9px; margin: 3px 0; border-radius: 2px; position: relative; z-index: 2;
  background: linear-gradient(#412a15, #22140a);
  display: flex; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.soroban-beam > span { flex: 1; display: flex; align-items: center; justify-content: center; }
.soroban-beam > span.on::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #e7cca0; }

.hero-float-badge {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: .6rem;
  background: var(--bg-section); border: 1px solid var(--border-subtle);
  padding: .7rem 1rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  font-family: var(--font-head);
}
.hero-float-badge .lucide { color: var(--accent-primary); width: 22px; height: 22px; }
.hero-float-badge strong { display: block; font-size: 1.1rem; font-weight: var(--fw-extrabold); line-height: 1.1; }
.hero-float-badge span { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.hero-badge-levels { top: 6%; left: -4%; animation: floaty2 5s ease-in-out infinite; }
.hero-badge-images { bottom: 22%; right: -6%; animation: floaty2 5.6s ease-in-out infinite .3s; }
.hero-badge-fingers { bottom: -2%; left: 8%; animation: floaty2 5.2s ease-in-out infinite .6s; }
@keyframes floaty2 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Stats bar ---------- */
.stats-bar-section { background: var(--bg-card); border-block: 1px solid var(--border-subtle); margin: 2rem 0; }
.stats-bar { display: flex; justify-content: space-between; padding: 1.8rem 22px; flex-wrap: wrap; gap: 1.5rem; }
.stats-bar-item { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; min-width: 120px; }
.stats-bar-value { font-family: var(--font-head); font-weight: var(--fw-extrabold); font-size: clamp(1.4rem, 3vw, 1.9rem); background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stats-bar-label { font-size: .82rem; color: var(--text-muted); font-weight: var(--fw-medium); margin-top: .2rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-head { max-width: 720px; margin-bottom: 2.2rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-head); font-weight: var(--fw-bold);
  font-size: .8rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent-primary); margin-bottom: .6rem;
}
.kicker .lucide { width: 15px; height: 15px; }
.kicker-light { color: var(--accent-secondary); }
.section-sub { font-size: 1.05rem; color: var(--text-soft); }

.two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.2rem; align-items: start; }
.prose p { color: var(--text-soft); font-size: 1.02rem; }
.prose strong { color: var(--text-main); }

.callout-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  padding: 2rem; border-radius: var(--radius-2xl); box-shadow: var(--shadow-md);
}
.callout-card p { color: var(--text-soft); font-size: 1rem; }
.callout-card .callout-foot { border-top: 1px solid var(--border-subtle); padding-top: 1rem; margin-top: 1.2rem; font-size: .95rem; }

/* Icon boxes */
.icon-box {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 1rem; flex: none;
}
.icon-box .lucide { width: 26px; height: 26px; stroke-width: 2.5px; }
.icon-box-gradient { background: var(--accent-gradient); }
.icon-box-lg { width: 66px; height: 66px; }
.icon-box-lg .lucide { width: 32px; height: 32px; }
.icon-box-sm { width: 44px; height: 44px; background: var(--gradient-blue); }
.icon-box-sm .lucide { width: 22px; height: 22px; }

/* Aim band */
.aim-band {
  display: flex; gap: 1.6rem; align-items: flex-start;
  background: var(--bg-section); border: 1px solid var(--border-subtle); border-left: 4px solid var(--accent-secondary);
  border-radius: var(--radius-2xl); padding: 2rem; box-shadow: var(--shadow-md);
}

/* Miracles */
.miracle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.miracle-card {
  position: relative; background: var(--bg-section); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl); padding: 2rem 1.6rem 1.6rem;
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.miracle-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.miracle-card::before { content: ""; position: absolute; top: 0; left: 0; height: 4px; width: 100%; background: var(--accent-gradient); }
.mc-num { font-family: var(--font-head); font-weight: var(--fw-black); font-size: 2.2rem; color: var(--border-subtle); display: block; line-height: 1; margin-bottom: .3rem; }
.miracle-card p { color: var(--text-soft); margin: 0; font-size: .96rem; }

/* Dark brain section */
.section-dark { background: linear-gradient(160deg, #0b0f1c, #060912); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.brain-split { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.5rem; align-items: center; margin: 1rem 0 2rem; }
.brain-side { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-2xl); padding: 1.8rem; }
.brain-side.left { border-top: 4px solid #17c3b2; }
.brain-side.right { border-top: 4px solid var(--accent-secondary); }
.brain-side p { color: rgba(255,255,255,.78); margin: 0; }
.brain-tag { font-family: var(--font-head); font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.6); }
.brain-core { text-align: center; position: relative; padding: 1rem; }
.brain-core span { position: relative; z-index: 1; font-family: var(--font-head); font-weight: var(--fw-bold); font-size: .95rem; }
.brain-orb {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%);
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, #3f00d1, transparent 70%); filter: blur(6px);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .8; } 50% { transform: translate(-50%,-50%) scale(1.25); opacity: 1; } }
.brain-note { max-width: 780px; margin: 0 auto; text-align: center; color: rgba(255,255,255,.85); font-size: 1.05rem; }
.brain-note strong { color: var(--accent-secondary); }

/* Enhances */
.enhance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; list-style: none; margin: 0; padding: 0; max-width: 760px; margin-inline: auto; }
.enhance-grid li {
  display: flex; align-items: center; gap: .8rem;
  background: var(--bg-section); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 1rem 1.2rem; font-family: var(--font-head); font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, border-color .18s ease;
}
.enhance-grid li:hover { transform: translateY(-4px); border-color: var(--accent-primary); }
.e-ico { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--accent-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.e-ico .lucide { width: 18px; height: 18px; }

/* Benefits */
.benefit-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.6rem; }
.benefit { display: flex; gap: .9rem; align-items: flex-start; }
.check {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gradient-teal); color: #fff;
  display: grid; place-items: center; margin-top: 2px;
}
.check .lucide { width: 16px; height: 16px; stroke-width: 3px; }
.benefit p { margin: 0; color: var(--text-soft); }
.benefit strong { color: var(--text-main); }

/* Techniques */
.tech-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.tech-card { background: var(--bg-section); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); padding: 2rem; box-shadow: var(--shadow-sm); }
.tech-card-wide { grid-column: 1 / -1; }
.tech-card header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.tech-card header h3 { margin: 0; }
.tech-badge {
  flex: none; width: 46px; height: 46px; border-radius: var(--radius-lg);
  background: var(--accent-gradient); color: #fff;
  font-family: var(--font-head); font-weight: var(--fw-black); font-size: 1.4rem;
  display: grid; place-items: center;
}
.tech-card p { color: var(--text-soft); }
.tech-card strong { color: var(--text-main); }
.tech-example { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1rem 1.2rem; margin: 1rem 0; }
.tech-example span { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .3rem; }
.tech-example code { font-family: "Courier New", monospace; font-size: 1.05rem; color: var(--accent-secondary); font-weight: var(--fw-bold); }
.tech-example.small code { font-size: .95rem; }
.tech-foot { font-size: .92rem; }
.tech-points { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--text-soft); }
.tech-points li { margin-bottom: .4rem; }

.subtech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; margin-top: 1.2rem; }
.subtech { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.4rem; border: 1px solid var(--border-subtle); }
.subtech h4 { font-size: 1.02rem; margin-bottom: .5rem; }
.subtech p { font-size: .94rem; margin: 0; }
.subtech .tech-example { margin-bottom: 0; }

/* Competitions */
.comp-band {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 2rem; align-items: center;
  background: var(--accent-gradient); color: #fff; border-radius: var(--radius-2xl);
  padding: clamp(2rem, 5vw, 3.2rem); box-shadow: var(--shadow-xl);
}
.comp-copy h2 { color: #fff; }
.comp-copy .kicker { color: #ffd9b0; }
.comp-copy .prose p { color: rgba(255,255,255,.88); }
.comp-copy strong { color: #fff; }
.comp-badges { position: relative; height: 200px; color: #fff; }
.comp-badges div { position: absolute; display: grid; place-items: center; filter: drop-shadow(0 8px 12px rgba(0,0,0,.25)); }
.comp-badges .lucide { width: 3rem; height: 3rem; }
.trophy .lucide { width: 4.4rem; height: 4.4rem; }
.trophy { top: 10px; left: 50%; transform: translateX(-50%); animation: floaty2 5s ease-in-out infinite; }
.medal.m1 { bottom: 10px; left: 10%; animation: floaty2 4s ease-in-out infinite .2s; }
.medal.m2 { bottom: 40px; left: 44%; animation: floaty2 4.6s ease-in-out infinite .4s; }
.medal.m3 { bottom: 0; right: 8%; animation: floaty2 4.2s ease-in-out infinite .6s; }

/* Google reviews band */
.reviews-card {
  display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center;
  background: var(--bg-section); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl);
  padding: clamp(1.8rem, 4vw, 3rem); box-shadow: var(--shadow-md);
}
.reviews-score {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0b0f1c, #060912); color: #fff;
  border-radius: var(--radius-2xl); padding: 1.6rem 2.2rem; min-width: 170px;
}
.rs-num { font-family: var(--font-head); font-weight: var(--fw-black); font-size: 3.2rem; line-height: 1; color: var(--accent-secondary); }
.rs-stars { color: #fbbc05; font-size: 1.2rem; letter-spacing: 2px; margin: .3rem 0; }
.rs-of { font-size: .8rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: 1px; }
.reviews-copy p { color: var(--text-soft); max-width: 52ch; }
.reviews-copy .btn { margin-top: .6rem; }

/* CTA — theme-adaptive (light in light mode, dark in dark mode) */
.cta { background: var(--bg-section-soft); color: var(--text-main); border-top: 1px solid var(--border-subtle); }
.cta-inner { max-width: 640px; margin-inline: auto; text-align: center; }
.cta h2 { color: var(--text-main); }
.cta p { color: var(--text-soft); font-size: 1.08rem; }
.cta-form {
  margin-top: 2rem; background: var(--bg-section); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl); padding: 1.8rem; text-align: left; box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field:first-child { grid-column: 1 / -1; }
.field label { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: .85rem; color: var(--text-main); }
.field input { padding: .8rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-page); font-family: var(--font-main); font-size: 1rem; color: var(--text-main); }
.field input::placeholder { color: var(--text-muted); }
.field input:focus { outline: 2px solid var(--accent-primary); border-color: transparent; }
.cta-form .btn-block { grid-column: 1 / -1; }
.form-msg { grid-column: 1 / -1; margin: 0; text-align: center; font-weight: var(--fw-bold); min-height: 1.2em; color: var(--accent-primary); }

/* Footer — theme-adaptive */
.footer-logo { height: 56px; width: auto; }
.site-footer { background: var(--bg-card); color: var(--text-soft); padding-top: 3rem; border-top: 1px solid var(--border-subtle); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; max-width: 360px; }
.footer-brand p { font-size: .92rem; margin: .3rem 0 0; color: var(--text-soft); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-start; }
.footer-links a { font-weight: var(--fw-semibold); color: var(--text-main); }
.footer-links a:hover { color: var(--accent-primary); }
.footer-bottom { border-top: 1px solid var(--border-subtle); padding: 1.2rem 0; font-size: .85rem; color: var(--text-muted); }
.footer-bottom p { margin: 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsive — laptop / tablet / mobile
   ============================================================ */

/* Large laptop / small desktop */
@media (max-width: 1180px) {
  .hero-badge-images { right: 0; }
  .hero-badge-levels { left: 0; }
}

/* Tablet landscape */
@media (max-width: 1024px) {
  :root { --container-max: 100%; }
  /* Icon-only compact nav — scoped to the desktop header bar so drawer labels stay visible */
  .nav-list { gap: 0; }
  .nav-list .nav-link span { display: none; }
  .nav-list .nav-link { padding: .6rem; }
  .nav-list .nav-link .lucide { width: 19px; height: 19px; }
  .hero-grid { gap: 1.8rem; }
  .miracle-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait / large mobile */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual-col { order: -1; margin-bottom: 1.5rem; min-height: 300px; }
  .two-col, .tech-cards, .comp-band, .reviews-card { grid-template-columns: 1fr; }
  .reviews-card { text-align: center; justify-items: center; }
  .subtech-grid { grid-template-columns: 1fr; }
  .benefit-list { grid-template-columns: 1fr; }
  .comp-badges { height: 150px; }
  .brain-split { grid-template-columns: 1fr; }
  .brain-core { order: -1; }
  .stats-bar { justify-content: space-around; }
}

@media (max-width: 768px) {
  .nav-list { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .nav-cta { display: none; }
  .miracle-grid, .enhance-grid { grid-template-columns: 1fr 1fr; }
  .hero-float-badge { padding: .55rem .8rem; }
  .hero-float-badge strong { font-size: .95rem; }
  .hero-float-badge span { font-size: .65rem; }
}

/* Small mobile */
@media (max-width: 560px) {
  .site-header .container { height: 66px; }
  .page-wrapper { padding-top: 66px; } /* match shrunk fixed header */
  .site-logo-img { height: 36px; }
  .hero-section::before { height: 420px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .miracle-grid, .enhance-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; align-items: center; gap: 1.2rem; }
  .cta-form { grid-template-columns: 1fr; padding: 1.4rem; }
  .field:first-child { grid-column: auto; }
  .hero-visual-col { min-height: 260px; flex-direction: column; }
  .hero-float-badge { position: static; margin-top: .8rem; width: 100%; justify-content: center; }
  .abacus-frame-wrap { margin-inline: auto; }
  .google-rating { flex-wrap: wrap; }
  .soroban { --bead-w: 20px; --bead-h: 13px; --col-gap: 5px; } /* shrink 9-rod soroban to fit small phones */
  .soroban-frame { padding: 12px 12px; }
}
@media (max-width: 380px) {
  .soroban { --bead-w: 17px; --bead-h: 11px; --col-gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   SPEEDMATH-ALIGNED COMPONENTS (style + structure alignment)
   ============================================================ */

:root {
  /* Fluid type scale (from speedmath) */
  --fs-xs: 0.75rem; --fs-sm: 0.8125rem; --fs-base: 0.9375rem; --fs-md: 1rem;
  --fs-lg: 1.0625rem; --fs-xl: 1.125rem; --fs-2xl: 1.1875rem; --fs-3xl: 1.5rem;
  --fs-4xl: 2rem; --fs-5xl: 2.1875rem;
  --lh-tight: 1.2; --lh-normal: 1.6; --lh-relaxed: 1.7;
  --space-1: .25rem; --space-3: .75rem; --space-5: 1.25rem; --space-7: 1.75rem;
  --space-10: 2.5rem; --space-12: 3rem; --space-14: 3.5rem; --space-16: 4rem;
  --gradient-purple: linear-gradient(135deg, #6d28d9, #9333ea);
}

/* Buttons — speedmath uses a small radius, not a pill */
.btn { border-radius: var(--radius-sm); padding: .72rem 1.7rem; }
.btn-icon { border-radius: var(--radius-md); }

/* Section scaffolding */
.section-padding { padding-block: clamp(2.6rem, 6vw, 4.2rem); }
.text-center { text-align: center; }
.section-title { font-size: clamp(1.7rem, 3.5vw, 2rem); font-weight: var(--fw-extrabold); line-height: var(--lh-tight); margin: 0 auto .6rem; max-width: 20ch; }
.section-subtitle { font-size: var(--fs-lg); color: var(--text-soft); margin: 0 auto var(--space-8); max-width: 60ch; }
.text-accent { color: var(--accent-secondary); -webkit-text-fill-color: initial; background: none; }

/* Icon color fills (shared by cards, steps, illustrations) */
.icon-blue   { background: var(--gradient-blue); }
.icon-orange { background: var(--gradient-orange); }
.icon-green  { background: var(--gradient-green); }
.icon-purple { background: var(--gradient-purple); }

/* Feature cards */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.3rem; margin-top: var(--space-8); }
.card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-2xl); padding: 1.6rem 1.4rem; transition: all var(--transition-base); }
.card:hover { transform: translateY(-4px); border-color: rgba(0,126,255,.6); box-shadow: var(--shadow-lg); }
.card h3 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); margin-bottom: .5rem; }
.card p { font-size: var(--fs-base); color: var(--text-soft); margin: 0; line-height: var(--lh-normal); }

/* How it works — 5 step */
.how-it-works-grid-enhanced { display: flex; flex-direction: column; gap: 1.4rem; margin-top: var(--space-10); }
.how-step-card-enhanced { display: grid; grid-template-columns: 1fr 1fr; gap: 3.4rem; align-items: center; }
.how-step-card-enhanced.reverse { direction: rtl; }
.how-step-card-enhanced.reverse > * { direction: ltr; }
.step-content-side { display: flex; flex-direction: column; gap: .9rem; padding: 1rem; }
.step-header-enhanced { display: flex; align-items: center; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border-subtle); }
.step-icon-badge { width: 60px; height: 60px; border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.step-icon-badge .lucide { width: 30px; height: 30px; }
.step-number-enhanced { flex: none; font-size: 2.6rem; font-weight: var(--fw-black); line-height: 1; letter-spacing: -.02em; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.step-title-enhanced { font-size: 1.5rem; font-weight: var(--fw-extrabold); line-height: 1.25; margin: 0; }
.step-description-enhanced { font-size: 1rem; color: var(--text-soft); line-height: 1.65; margin: 0; }
.step-features-list-enhanced { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .7rem; }
.step-features-list-enhanced li { display: flex; align-items: center; gap: .6rem; color: var(--text-soft); font-size: var(--fs-base); font-weight: 500; }
.feature-check-icon-enhanced { width: 20px; height: 20px; color: var(--color-emerald, #10b981); flex: none; }
.step-image-side { display: flex; align-items: center; justify-content: center; }
.step-illustration { width: 100%; max-width: 460px; aspect-ratio: 4 / 3; border-radius: var(--radius-2xl); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-lg); }
.step-illustration .lucide { width: 92px; height: 92px; stroke-width: 1.6; opacity: .95; }
.step-img { width: 100%; max-width: 520px; height: auto; border-radius: var(--radius-2xl); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-lg); object-fit: cover; }

/* Personas */
.persona-item { text-align: center; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 22px; padding: 1.6rem 1.4rem; transition: all var(--transition-base); }
.persona-item:hover { transform: translateY(-4px); border-color: rgba(0,126,255,.6); box-shadow: var(--shadow-lg); }
.persona-icon { width: 54px; height: 54px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; margin: 0 auto .9rem; background: var(--bg-section-soft); border: 1px solid var(--border-subtle); }
.persona-icon .lucide { width: 27px; height: 27px; }
.persona-icon--blue   { color: #2563eb; }
.persona-icon--orange { color: #f97316; }
.persona-icon--green  { color: #16a34a; }
.persona-icon--purple { color: #7c3aed; }
.persona-item h3 { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin-bottom: .4rem; }
.persona-item p { font-size: var(--fs-base); color: var(--text-soft); margin: 0; line-height: var(--lh-normal); }

/* Testimonials */
.tm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: var(--space-8); }
.tm-card { position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.tm-bg-quote { position: absolute; bottom: 16px; right: 18px; width: 52px; height: 52px; color: var(--text-muted); opacity: .12; pointer-events: none; }
.tm-card-stars { display: flex; gap: 2px; margin-bottom: .8rem; }
.tm-star { width: 16px; height: 16px; color: #e3e7f2; fill: #e3e7f2; }
.tm-star-filled { color: #fbbf24; fill: #fbbf24; }
.tm-card-quote { flex: 1; font-size: var(--fs-base); line-height: 1.6; color: var(--text-soft); margin: 0 0 1.2rem; position: relative; z-index: 1; }
.tm-card-author { display: flex; align-items: center; gap: .8rem; }
.tm-card-avatar-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-section-soft); border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.tm-card-avatar-icon .lucide { width: 24px; height: 24px; }
.tm-card-author-info { display: flex; flex-direction: column; }
.tm-card-name { font-weight: var(--fw-bold); font-size: var(--fs-base); }
.tm-card-context { font-size: var(--fs-xs); color: var(--text-muted); }
.tm-cta { margin-top: var(--space-8); }

/* FAQ accordion */
.faq-container { max-width: 800px; margin: var(--space-10) auto 0; display: flex; flex-direction: column; gap: .8rem; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); overflow: hidden; transition: all var(--transition-base); }
.faq-item:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-sm); }
.faq-item.active { border-color: var(--accent-primary); box-shadow: var(--shadow-md); }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; background: transparent; border: none; text-align: left; cursor: pointer; font-family: var(--font-head); font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-main); }
.faq-question:hover { color: var(--accent-primary); }
.faq-icon { width: 22px; height: 22px; color: var(--accent-primary); transition: transform var(--transition-base); flex: none; }
.faq-item.active .faq-icon { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.25,.8,.25,1); }
.faq-answer p { margin: 0; padding: .3rem 1.2rem 1.1rem; font-size: var(--fs-base); color: var(--text-soft); line-height: var(--lh-relaxed); }

/* CTA section (kept light per request) */
.cta-section { text-align: center; background: var(--bg-section-soft); border-top: 1px solid var(--border-subtle); }
.cta-title { font-size: clamp(1.7rem, 3.5vw, 2rem); font-weight: var(--fw-extrabold); margin-bottom: .6rem; }
.cta-description { font-size: var(--fs-lg); color: var(--text-soft); max-width: 60ch; margin: 0 auto; }

/* Footer — speedmath footer-grid */
.footer-main { border-top: 1px solid var(--border-subtle); padding: 3.2rem 0 2.4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; align-items: start; }
.footer-brand { display: flex; flex-direction: column; gap: .9rem; align-items: flex-start; max-width: none; }
.footer-logo-link { display: inline-block; line-height: 1; }
.footer-tagline { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.6; max-width: 420px; margin: 0; }
.footer-email { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-sm); color: var(--text-soft); font-weight: var(--fw-medium); transition: color var(--transition-base); }
.footer-email .lucide { width: 15px; height: 15px; }
.footer-email:hover { color: var(--accent-primary); }
.footer-col { display: flex; flex-direction: column; gap: .7rem; }
.footer-col h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: .2rem; }
.footer-col a { font-size: var(--fs-base); color: var(--text-soft); font-weight: var(--fw-medium); transition: color var(--transition-base); }
.footer-col a:hover { color: var(--accent-primary); }

/* Responsive for aligned components */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .how-step-card-enhanced { grid-template-columns: 1fr; gap: 1rem; }
  .how-step-card-enhanced.reverse { direction: ltr; }
  .step-image-side { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .tm-grid { grid-template-columns: 1fr; }
  .step-img { max-width: 100%; }
  .step-content-side { padding: .2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
