:root {
  --ink: #18213a;
  --ink-soft: #4b5672;
  --muted: #6b7590;
  --line: #e3e7f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --brand: #1f3a8a;
  --brand-2: #2f5bd3;
  --accent: #ff6a3d;
  --accent-dark: #e8552a;
  --good: #1f9d63;
  --bad: #d64545;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(24, 33, 58, .06), 0 8px 24px rgba(24, 33, 58, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 17px; }
a { color: var(--brand-2); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 1.8em 0 .6em; }
h3 { font-size: 1.15rem; margin: .4em 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* header / footer */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.logo b { color: var(--accent); }
.logo-bubble { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); font-size: 18px; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
@media (max-width: 560px) { .nav a:not(.btn) { display: none; } }
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 32px 0 24px; margin-top: 64px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.logo-footer { margin-bottom: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-big { padding: 15px 28px; font-size: 1.05rem; }
.btn-small { padding: 7px 14px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink-soft); }
.linklike { background: none; border: 0; color: var(--brand-2); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

/* hero */
.hero { background: radial-gradient(1200px 500px at 80% -10%, #dfe7ff 0%, transparent 60%), linear-gradient(180deg, #fff, var(--bg)); padding: 56px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } .hero-chat { display: none; } }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--brand-2); margin: 0; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 14px; }
.online-line { color: var(--ink-soft); font-weight: 500; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(31, 157, 99, .15); vertical-align: middle; }
.hero-chat { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: .97rem; }
.bubble.them { background: #eef1f8; align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me { background: var(--brand-2); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }

/* sections & cards */
.section { padding: 8px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e7ecff; color: var(--brand); font-weight: 800; }
.step p { margin: 0; color: var(--ink-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.topic-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.topic-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(24, 33, 58, .1); }
.topic-icon { font-size: 1.8rem; }
.topic-title { font-weight: 700; font-size: 1.08rem; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef1f8; color: var(--ink-soft); width: fit-content; }
.pill-beginner { background: #e3f6ec; color: #17784b; }
.pill-intermediate { background: #fff1e2; color: #a5530c; }
.pill-advanced { background: #f1e8ff; color: #6b34c4; }
.pill-ai { background: #e7ecff; color: var(--brand); }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; }
.ticks li { padding-left: 28px; position: relative; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.safety h3 { margin-top: 0; }
.faq details { background: #fff; border-radius: 12px; box-shadow: var(--shadow); margin: 10px 0; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }
.cta-band { background: var(--brand); color: #fff; text-align: center; padding: 44px 0; margin-top: 48px; }
.cta-band h2 { margin-top: 0; }

/* article pages */
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 28px 0 20px; }
.crumbs { font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.meta { display: flex; gap: 12px; align-items: center; margin: 0; }
.article { max-width: 820px; padding-top: 12px; }
.cta-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fff7f2; border: 1.5px solid #ffd9c9; border-radius: var(--radius); padding: 18px 20px; margin: 24px 0; flex-wrap: wrap; }
.dialogue { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 18px; }
.line { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .who { font-weight: 700; color: var(--brand); }
.line-B .who { color: var(--accent-dark); }
@media (max-width: 560px) { .line { grid-template-columns: 1fr; gap: 0; } }
.tip { color: var(--ink-soft); }
.phrases { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.phrases th, .phrases td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.phrases th { background: #f0f3fa; font-size: .9rem; }
.mistakes { display: grid; gap: 12px; }
.mistake { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 16px; }
.mistake p { margin: 3px 0; }
.wrong { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.right { color: var(--good); font-weight: 650; }
.starters li { margin: 6px 0; }
.prose ol li, .prose ul li { margin: 6px 0; }

/* games */
.games { display: grid; gap: 16px; }
.game { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.game-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.game-title { font-weight: 750; }
.game-q { font-size: 1.1rem; font-weight: 600; margin: 8px 0 12px; }
.options { display: grid; gap: 8px; }
.option { text-align: left; background: #f4f6fb; border: 1.5px solid transparent; border-radius: 12px; padding: 11px 14px; font: inherit; cursor: pointer; color: var(--ink); }
.option:hover:not(:disabled) { border-color: var(--brand-2); }
.option.correct { background: #e3f6ec; border-color: var(--good); }
.option.wrong { background: #fde8e8; border-color: var(--bad); }
.option:disabled { cursor: default; }
.explain { margin: 10px 0 0; color: var(--ink-soft); }
.game-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; flex-wrap: wrap; }
.progress { height: 6px; background: #eef1f8; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand-2); transition: width .25s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 46px; padding: 8px; border-radius: 12px; }
.chips.answer { background: #f4f6fb; border: 1.5px dashed var(--line); }
.chip { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 12px; font: inherit; cursor: pointer; }
.chip:hover { border-color: var(--brand-2); }
.result-good { color: var(--good); font-weight: 700; }
.result-bad { color: var(--bad); font-weight: 700; }

/* chat app */
.chat-body .site-footer { margin-top: 24px; }
.chat-app { padding: 24px 0; }
.chat-wrap { max-width: 760px; }
.panel h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-top: 0; }
#setup-form { display: grid; gap: 14px; margin-top: 12px; }
label { display: grid; gap: 6px; font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 5px; }
input[type=text], select { font: inherit; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
input[type=text]:focus, select:focus { outline: none; border-color: var(--brand-2); }
#waiting { text-align: center; }
#waiting .games { text-align: left; }
.wait-game { margin: 20px 0; text-align: left; }
.ai-offer { background: #eef2ff; border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.spinner { width: 42px; height: 42px; margin: 6px auto 0; border-radius: 50%; border: 4px solid #e3e7f0; border-top-color: var(--brand-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; height: min(78vh, 720px); overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-actions { display: flex; gap: 8px; }
.topic-banner { background: #fff7f2; border-bottom: 1px solid #ffe2d6; padding: 10px 16px; font-size: .93rem; }
.topic-banner ul { margin: 4px 0 0; padding-left: 18px; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fbfcfe; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; white-space: pre-wrap; }
.msg.me { background: var(--brand-2); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.msg.them { background: #eef1f8; align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.ai { background: #eef2ff; border: 1px solid #d6defd; }
.msg.system { align-self: center; background: none; color: var(--muted); font-size: .88rem; text-align: center; max-width: 95%; }
.typing { padding: 0 16px 6px; color: var(--muted); font-size: .85rem; background: #fbfcfe; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; }
.chat-foot { margin: 0; padding: 0 16px 10px; }
.chat-about { max-width: 760px; }
dialog { border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); padding: 22px; width: min(420px, 92vw); }
dialog::backdrop { background: rgba(10, 15, 30, .45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
