:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef4ff;
  --text: #111827;
  --muted: #5b6472;
  --border: #d9e1ec;
  --primary: #2457d6;
  --primary-dark: #183f9d;
  --accent: #ffb020;
  --danger: #c62828;
  --success: #147a44;
  --shadow: 0 20px 45px rgba(17, 24, 39, .08);
  --radius: 22px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; }
img, svg { max-width: 100%; }
button, input, select { font: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: white; padding: 8px 12px; z-index: 20; }
.skip-link:focus { left: 8px; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primary); color: white; font-size: 24px; }
.site-nav { display: flex; gap: 22px; align-items: center; font-weight: 650; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--primary); }
.nav-cta { color: white !important; background: var(--primary); border-radius: 999px; padding: 10px 16px; }
.nav-toggle { display: none; background: transparent; border: 0; font-size: 28px; }
.hero { padding: 72px 0 48px; background: radial-gradient(circle at 20% 20%, #dce8ff 0, transparent 38%), linear-gradient(180deg, #fff, var(--bg)); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin: 0 0 8px; }
h1, h2, h3 { line-height: 1.12; margin-top: 0; letter-spacing: -0.04em; }
h1 { font-size: clamp(2.4rem, 6vw, 5rem); margin-bottom: 18px; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: 1.35rem; }
.hero-text { font-size: 1.18rem; color: var(--muted); max-width: 720px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px; border: 1px solid transparent; text-decoration: none; font-weight: 800; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--primary); color: white; box-shadow: 0 12px 22px rgba(36, 87, 214, .22); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: white; color: var(--primary); border-color: var(--border); }
.button-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.full { width: 100%; }
.hero-card, .settings-panel, .game-panel, .review-card, .feature-list-card, .post-card, .blog-card, .article-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: 28px; transform: rotate(1deg); }
.score-preview { display: inline-flex; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--primary); font-weight: 800; margin: 0 0 18px; }
.mock-problem { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 900; letter-spacing: -0.05em; padding: 28px 0; }
.check-list, .feature-list { padding-left: 0; list-style: none; margin: 0; }
.check-list li, .feature-list li { position: relative; padding-left: 28px; margin: 10px 0; color: var(--muted); }
.check-list li::before, .feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.tool-section { padding: 70px 0; }
.section-heading { max-width: 760px; text-align: center; margin: 0 auto 34px; }
.section-heading.left { text-align: left; margin-left: 0; }
.section-heading p { color: var(--muted); }
.tool-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
.settings-panel, .game-panel { padding: 24px; }
.settings-panel { position: sticky; top: 92px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin: 0 0 16px; }
legend { font-weight: 800; padding: 0 8px; }
fieldset label, .toggle-grid label { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 8px 0; }
.form-row { display: grid; gap: 7px; margin-bottom: 16px; }
label { font-weight: 750; }
input[type="number"], select { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: white; color: var(--text); }
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.toggle-grid { display: grid; gap: 8px; margin-bottom: 18px; }
.game-topline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.game-topline div, .stats-grid div { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: #fbfcff; }
.stat-label, .stats-grid span { display: block; color: var(--muted); font-size: .86rem; font-weight: 750; }
.game-topline strong { font-size: 2rem; }
.problem-card { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, #fff, #f7faff); padding: 28px; margin-bottom: 18px; text-align: center; }
.game-status { color: var(--muted); margin-top: 0; }
.problem-text { font-size: clamp(3rem, 10vw, 6.7rem); font-weight: 950; letter-spacing: -0.06em; margin: 20px 0; }
.answer-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.answer-form input { font-size: 1.35rem; text-align: center; border: 2px solid var(--border); border-radius: 999px; padding: 12px 18px; }
.answer-form input:focus { outline: 3px solid rgba(36, 87, 214, .15); border-color: var(--primary); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-grid strong { font-size: 1.55rem; }
.result-box { margin-top: 18px; padding: 18px; border-radius: var(--radius-sm); background: #fff8e8; border: 1px solid #f3d79a; }
.review-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.review-card { padding: 24px; box-shadow: none; }
.mistake-list { margin: 0; padding-left: 22px; }
.mistake-list li { margin: 8px 0; }
.weak-report { display: grid; gap: 8px; }
.weak-pill { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; background: #fbfcff; }
.content-section { padding: 72px 0; }
.content-section.alt { background: white; }
.content-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
.feature-list-card { padding: 26px; }
.card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.post-card { display: block; padding: 18px; min-height: 160px; text-decoration: none; box-shadow: none; transition: transform .15s ease, border .15s ease; }
.post-card:hover, .blog-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.post-card span { display: block; color: var(--primary); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.post-card strong { display: block; margin-top: 12px; font-size: 1.08rem; line-height: 1.25; }
.faq-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; }
details { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 850; }
.site-footer { padding: 44px 0; background: #101827; color: #d7deeb; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.footer-brand, .footer-title { color: white; font-weight: 900; margin-top: 0; }
.site-footer a { display: block; color: #d7deeb; text-decoration: none; margin: 8px 0; }
.site-footer a:hover { color: white; }
.small-note { font-size: .9rem; color: #aeb8c9; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.kid-mode .problem-card { background: linear-gradient(180deg, #fff9d9, #eaf8ff); }
.correct-flash { animation: correctFlash .25s ease; }
.wrong-flash { animation: wrongFlash .25s ease; }
@keyframes correctFlash { 0% { box-shadow: 0 0 0 0 rgba(20,122,68,.35); } 100% { box-shadow: 0 0 0 12px rgba(20,122,68,0); } }
@keyframes wrongFlash { 0% { box-shadow: 0 0 0 0 rgba(198,40,40,.35); } 100% { box-shadow: 0 0 0 12px rgba(198,40,40,0); } }
.blog-hero { padding: 62px 0 34px; background: linear-gradient(180deg, white, var(--bg)); }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 24px 0 72px; }
.blog-card { display: block; padding: 22px; text-decoration: none; box-shadow: none; min-height: 230px; }
.blog-card .tag { display: inline-flex; border-radius: 999px; background: var(--surface-2); color: var(--primary); padding: 5px 10px; font-weight: 800; font-size: .78rem; }
.blog-card h2 { font-size: 1.45rem; margin: 18px 0 10px; }
.blog-card p { color: var(--muted); }
.article-hero { padding: 56px 0 24px; background: linear-gradient(180deg, white, var(--bg)); }
.breadcrumbs { color: var(--muted); font-size: .92rem; margin-bottom: 24px; }
.breadcrumbs a { color: var(--primary); text-decoration: none; font-weight: 750; }
.article-hero h1 { max-width: 920px; font-size: clamp(2.1rem, 5vw, 4rem); }
.article-meta { color: var(--muted); font-weight: 700; }
.article-wrap { padding: 24px 0 72px; }
.article-body { padding: clamp(22px, 5vw, 52px); box-shadow: none; }
.article-body p, .article-body li { color: #3d4654; }
.article-body h2 { font-size: 2rem; margin-top: 34px; }
.placeholder-box { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 18px; background: #fbfcff; color: var(--muted); }
.inline-cta { margin: 28px 0; padding: 22px; border-radius: var(--radius-sm); background: #eff5ff; border: 1px solid #cddcff; }
.inline-cta a { color: var(--primary); font-weight: 900; }
.related-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.related-links a { border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-decoration: none; font-weight: 800; }
.related-links a:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 920px) {
  .hero-grid, .tool-layout, .content-grid, .faq-grid, .review-layout { grid-template-columns: 1fr; }
  .settings-panel { position: static; }
  .card-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .site-nav { display: none; position: absolute; left: 16px; right: 16px; top: 72px; padding: 16px; border: 1px solid var(--border); border-radius: 18px; background: white; box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 24px, 1120px); }
  .hero { padding-top: 44px; }
  .game-topline, .stats-grid, .range-grid, .card-grid, .blog-grid, .footer-grid, .related-links { grid-template-columns: 1fr; }
  .answer-form { grid-template-columns: 1fr; }
  .problem-card, .settings-panel, .game-panel { padding: 18px; }
  .problem-text { font-size: 3.4rem; }
}
