/* ============ Tokens ============ */
:root {
  --bg: #ffffff;
  --bg-2: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --line: #e5e9f2;
  --line-2: #d6dcea;
  --text: #0b1220;
  --text-2: #3b4559;
  --muted: #6b7489;
  --blue: #2563eb;
  --blue-2: #1d4fd8;
  --blue-soft: #eaf1ff;
  --blue-ink: #1e40af;
  --ok: #059669;
  --ok-soft: #e7f7f1;
  --warn: #b45309;
  --warn-soft: #fff6e6;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --code-bg: #0b1020;
  --code-text: #dfe7ff;
  --code-muted: #7d8bb0;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .12);
  --shadow-lg: 0 24px 64px -20px rgba(16, 32, 80, .28);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-d: "Inter Tight", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --topbar: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05070d; --bg-2: #080b14; --surface: #0b0f1a; --surface-2: #10162430;
    --surface-2: #111827; --line: #1a2133; --line-2: #263049;
    --text: #e8ecf5; --text-2: #c2c9d8; --muted: #8b95a9;
    --blue: #4d8dff; --blue-2: #6aa0ff; --blue-soft: rgba(77, 141, 255, .12); --blue-ink: #9cc0ff;
    --ok: #34d399; --ok-soft: rgba(52, 211, 153, .1);
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .1);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .1);
    --code-bg: #070a14; --code-text: #dfe7ff; --code-muted: #6f7ca0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 64px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #05070d; --bg-2: #080b14; --surface: #0b0f1a;
  --surface-2: #111827; --line: #1a2133; --line-2: #263049;
  --text: #e8ecf5; --text-2: #c2c9d8; --muted: #8b95a9;
  --blue: #4d8dff; --blue-2: #6aa0ff; --blue-soft: rgba(77, 141, 255, .12); --blue-ink: #9cc0ff;
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .1);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .1);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .1);
  --code-bg: #070a14; --code-text: #dfe7ff; --code-muted: #6f7ca0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 64px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
img, video, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-d); letter-spacing: -.02em; line-height: 1.15; margin: 0; color: var(--text); }
p { margin: 0 0 1em; }
kbd {
  font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); color: var(--text-2);
}
::selection { background: color-mix(in srgb, var(--blue) 25%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--blue); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.only-mobile, .icon-btn.only-mobile { display: none; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ============ Topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { height: 100%; width: min(1440px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 17px/1 var(--font-d); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__mark svg rect { transition: transform .4s var(--ease); transform-origin: center; }
.brand:hover .brand__mark svg rect { transform: rotate(-8deg); }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { color: var(--text-2); font-weight: 500; font-size: 14.5px; padding: 8px 12px; border-radius: 9px; transition: background .2s, color .2s; }
.topnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.topnav a.is-active { color: var(--blue); background: var(--blue-soft); }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px;
  transition: border-color .2s;
}
.search-btn:hover { border-color: var(--line-2); }
.search-btn span { min-width: 72px; text-align: left; }
.seg { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 5px 9px; border-radius: 7px; font: 600 12px/1 var(--font); color: var(--muted); letter-spacing: .02em; transition: all .2s var(--ease); }
.seg button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); transition: border-color .2s, transform .2s; }
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.progress-line { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--blue); transition: width .1s linear; }

/* ============ Buttons, chips ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px;
  font: 600 15px/1 var(--font); border: 1px solid transparent; transition: transform .2s var(--ease), background .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--blue) 70%, transparent); }
.btn--primary:hover { background: var(--blue-2); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--line-2); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn svg { transition: transform .25s var(--ease); }
.btn:hover svg.arr { transform: translateX(3px); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font: 600 12.5px/1.2 var(--font); background: var(--blue-soft); color: var(--blue-ink); }
.chip--line { background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--blue) 0%, transparent); } }

/* ============ Home ============ */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 700px; z-index: -1;
  background:
    radial-gradient(600px 300px at 15% 20%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 70%),
    radial-gradient(500px 320px at 85% 10%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 70%);
}
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.2vw, 62px); font-weight: 800; letter-spacing: -.022em; margin: 18px 0 18px; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero__lead { font-size: 18.5px; color: var(--text-2); max-width: 560px; margin-bottom: 28px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__meta { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.hero__meta b { display: block; color: var(--text); font: 700 22px/1.1 var(--font-d); }

.stage { position: relative; height: 540px; }
.term {
  position: absolute; left: 0; top: 40px; width: 78%; z-index: 2;
  background: var(--code-bg); color: var(--code-text); border-radius: 16px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; font: 13px/1.6 var(--mono);
}
.term__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4258; }
.term__bar i:nth-child(1) { background: #ff5f57; } .term__bar i:nth-child(2) { background: #febc2e; } .term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 8px; color: var(--code-muted); font-size: 12px; }
.term__body { padding: 16px 18px 20px; min-height: 330px; white-space: pre-wrap; word-break: break-word; }
.term__body .p { color: #7aa2ff; }
.term__body .u { color: #fff; }
.term__body .m { color: var(--code-muted); }
.term__body .ok { color: #4ade80; }
.term__body .y { color: #fcd34d; }
.term__body .bar { display: inline-block; width: 160px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.1); vertical-align: middle; overflow: hidden; }
.term__body .bar > b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4d8dff, #8db5ff); transition: width .12s linear; }
.caret { display: inline-block; width: 8px; height: 15px; background: #cfe0ff; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.phone {
  position: absolute; right: 0; top: 0; width: 250px; aspect-ratio: 9 / 19.2; z-index: 3;
  border-radius: 38px; padding: 9px; background: #0d0f14; box-shadow: var(--shadow-lg), inset 0 0 0 1.5px #2a2f3a;
  transform: rotate(4deg); transition: transform .6s var(--ease);
}
.stage:hover .phone { transform: rotate(1.5deg) translateY(-6px); }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; background: #111; }
.phone__notch { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); width: 76px; height: 20px; border-radius: 12px; background: #0d0f14; z-index: 2; }
.phone__badge {
  position: absolute; left: -56px; bottom: 64px; z-index: 4; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.35; max-width: 220px;
  animation: floaty 5s var(--ease) infinite;
}
.phone__badge b { display: block; font-size: 13.5px; }
@keyframes floaty { 50% { transform: translateY(-6px); } }

.made-with {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-top: 8px;
  border: 1px dashed color-mix(in srgb, var(--blue) 45%, var(--line)); border-radius: 14px; background: var(--blue-soft); color: var(--blue-ink); font-weight: 500;
}
.made-with svg { flex: none; }

.section { padding: 72px 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section__head { max-width: 680px; margin-bottom: 36px; }
.section__head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; margin: 12px 0 12px; }
.section__head p { color: var(--text-2); font-size: 17px; margin: 0; }
.eyebrow { font: 600 12.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); box-shadow: var(--shadow); }
.card h3 { font-size: 18px; margin: 14px 0 6px; }
.card p { color: var(--text-2); font-size: 14.5px; margin: 0; }
.card__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.card__num { position: absolute; top: 18px; right: 20px; font: 600 12px/1 var(--mono); color: var(--muted); }

.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: f; }
.flow__step { position: relative; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.flow__step::before { counter-increment: f; content: "0" counter(f); font: 600 12px/1 var(--mono); color: var(--blue); }
.flow__step h4 { font-size: 15.5px; margin: 10px 0 4px; }
.flow__step p { font-size: 13.5px; color: var(--text-2); margin: 0; }
.flow__step:not(:last-child)::after {
  content: ""; position: absolute; right: -9px; top: 50%; width: 6px; height: 6px; border-top: 1.5px solid var(--line-2); border-right: 1.5px solid var(--line-2); transform: translateY(-50%) rotate(45deg);
}

/* curriculum list on home */
.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.module { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.module__head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.module__n { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font: 700 14px/1 var(--font-d); flex: none; }
.module__head h3 { font-size: 16.5px; }
.module__head small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.module ol { list-style: none; margin: 0; padding: 6px; }
.module li a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 9px; color: var(--text-2); font-size: 14.5px; }
.module li a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.module li a .tick { margin-left: auto; color: var(--ok); opacity: 0; }
.module li a.done .tick { opacity: 1; }

/* ============ Wizard ============ */
.wizard { max-width: 860px; margin: 48px auto 80px; }
.wizard__steps { display: flex; gap: 8px; margin-bottom: 26px; }
.wizard__steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .4s var(--ease); }
.wizard__steps span.on { background: var(--blue); }
.wizard h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin: 8px 0 10px; }
.wizard__lead { color: var(--text-2); font-size: 17px; margin-bottom: 26px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.choice {
  text-align: left; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); padding: 20px; position: relative;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.choice:hover { border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.choice.is-on { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.choice h3 { font-size: 18px; margin: 14px 0 6px; }
.choice p { color: var(--text-2); font-size: 14px; margin: 0; }
.choice__logo { height: 44px; width: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font: 800 15px/1 var(--font-d); }
.choice__check { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: #fff; transition: all .2s; }
.choice.is-on .choice__check { background: var(--blue); border-color: var(--blue); }
.wizard__nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.plan-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 18px; }

/* ============ Learn layout ============ */
.learn { display: grid; grid-template-columns: 290px minmax(0, 1fr) 220px; gap: 40px; width: min(1440px, 100% - 32px); margin-inline: auto; }
.sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 24px 6px 40px 0; scrollbar-width: thin; }
.sidebar__ctx { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); margin-bottom: 18px; }
.sidebar__ctx label { font: 600 11.5px/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.mini-seg { display: flex; padding: 3px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.mini-seg button { flex: 1; border: 0; background: none; padding: 6px 4px; border-radius: 6px; font: 600 12.5px/1 var(--font); color: var(--muted); transition: all .2s; }
.mini-seg button.is-on { background: var(--blue); color: #fff; }
.sidebar__progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sidebar__progress .track { flex: 1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.sidebar__progress .track b { display: block; height: 100%; background: var(--ok); border-radius: 6px; transition: width .5s var(--ease); }
.nav-mod { margin-bottom: 6px; }
.nav-mod > button {
  width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 9px 10px; border-radius: 9px;
  font: 650 13.5px/1.3 var(--font); color: var(--text); text-align: left;
}
.nav-mod > button:hover { background: var(--surface-2); }
.nav-mod > button .n { font: 600 11px/1 var(--mono); color: var(--muted); width: 18px; }
.nav-mod > button svg { margin-left: auto; transition: transform .25s var(--ease); color: var(--muted); }
.nav-mod.is-open > button svg { transform: rotate(90deg); }
.nav-mod ul { list-style: none; margin: 2px 0 8px 19px; padding: 0 0 0 10px; border-left: 1px solid var(--line); display: none; }
.nav-mod.is-open ul { display: block; }
.nav-mod li a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; line-height: 1.35; }
.nav-mod li a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-mod li a.is-active { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }
.nav-mod li a .tick { margin-left: auto; color: var(--ok); flex: none; display: none; }
.nav-mod li a.done .tick { display: block; }

.doc { padding: 34px 0 80px; min-width: 0; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.doc__title { font-size: clamp(30px, 3.6vw, 42px); font-weight: 800; letter-spacing: -.022em; margin-bottom: 12px; }
.doc__lead { font-size: 18px; color: var(--text-2); margin-bottom: 18px; }
.doc__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }

.prose { font-size: 16.5px; color: var(--text-2); }
.prose h2 { font-size: 25px; font-weight: 750; margin: 44px 0 14px; scroll-margin-top: calc(var(--topbar) + 20px); }
.prose h3 { font-size: 19px; font-weight: 700; margin: 30px 0 10px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--blue); }
.prose code:not(pre code) { font: 500 .86em/1 var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; color: var(--text); word-break: break-word; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose img { border-radius: 12px; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 650; color: var(--text); background: var(--bg-2); white-space: nowrap; }
.prose td code { white-space: nowrap; }

/* code block */
.code { position: relative; margin: 14px 0 20px; border-radius: 12px; background: var(--code-bg); border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; }
.code__head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; background: rgba(255, 255, 255, .03); border-bottom: 1px solid rgba(255, 255, 255, .06); font: 500 12px/1 var(--mono); color: var(--code-muted); }
.code__head .lang { text-transform: lowercase; }
.copy {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: #c9d6ff; font: 500 12px/1 var(--font);
  transition: background .2s, color .2s;
}
.copy:hover { background: rgba(255, 255, 255, .1); }
.copy.ok { color: #4ade80; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.65 var(--mono); color: var(--code-text); }
.code pre .c { color: var(--code-muted); }
.code pre .pr { color: #7aa2ff; user-select: none; }

/* tabs */
.tabs { margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tabs__bar { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--bg-2); border-radius: 14px 14px 0 0; }
.tabs__bar button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 8px 12px; border-radius: 9px; font: 600 13.5px/1 var(--font); color: var(--muted); white-space: nowrap; transition: all .2s; }
.tabs__bar button:hover { color: var(--text); }
.tabs__bar button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs__bar button .tag { font: 600 10px/1 var(--font); padding: 3px 5px; border-radius: 5px; background: var(--blue-soft); color: var(--blue-ink); }
.tabs__panel { padding: 4px 18px 6px; }
.tabs__panel[hidden] { display: none; }
.tabs__panel > :first-child { margin-top: 14px; }

/* callouts */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; margin: 16px 0 22px; border: 1px solid; font-size: 15px; }
.note > svg { flex: none; margin-top: 3px; }
.note > div > :last-child { margin-bottom: 0; }
.note b:first-child { color: inherit; }
.note--tip { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.note--tip > svg { color: var(--blue); }
.note--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.note--ok > svg { color: var(--ok); }
.note--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.note--warn > svg { color: var(--warn); }
.note--bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.note--bad > svg { color: var(--bad); }

/* steps */
.steps { list-style: none; padding: 0 !important; margin: 18px 0 24px !important; counter-reset: s; }
.steps > li { position: relative; padding: 0 0 22px 48px; margin: 0 !important; }
.steps > li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--blue); color: var(--blue); font: 700 13px/1 var(--font-d);
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1.5px; background: var(--line); }
.steps > li > b:first-child { display: block; color: var(--text); margin-bottom: 2px; }

/* tree */
.tree { font: 13.5px/1.75 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 14px 0 22px; overflow-x: auto; white-space: pre; color: var(--text); }
.tree .c { color: var(--muted); }
.tree .f { color: var(--blue); font-weight: 600; }

/* compare / grid */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0 22px; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); }
.box h4 { font-size: 16px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.box p, .box li { font-size: 14.5px; }
.box > :last-child { margin-bottom: 0; }
.price { font: 800 30px/1 var(--font-d); color: var(--text); margin: 8px 0 4px; letter-spacing: -.03em; }
.price small { font: 500 14px/1 var(--font); color: var(--muted); letter-spacing: 0; }
.box--hl { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }

.prompt { position: relative; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 10px; background: var(--bg-2); padding: 14px 16px; margin: 12px 0 18px; font-size: 15px; color: var(--text); }
.prompt .copy { position: absolute; top: 10px; right: 10px; background: var(--surface); border-color: var(--line); color: var(--text-2); }
.prompt .copy:hover { background: var(--surface-2); }
.prompt__label { display: block; font: 600 11.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; }
.prompt__text { padding-right: 70px; white-space: pre-wrap; }

.vid { margin: 16px 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.vid figure { margin: 0; }
.vid video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 14px; background: #000; border: 1px solid var(--line); }
.vid figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

.doc__done { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-top: 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); flex-wrap: wrap; }
.doc__done p { margin: 0; color: var(--text-2); font-size: 15px; }
.btn--done.is-done { background: var(--ok); color: #fff; box-shadow: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.pager a { display: block; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: var(--text); transition: border-color .2s, transform .25s var(--ease); }
.pager a:hover { text-decoration: none; border-color: var(--blue); transform: translateY(-2px); }
.pager small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.pager b { font-weight: 650; }
.pager .next { text-align: right; grid-column: 2; }

.toc { position: sticky; top: var(--topbar); align-self: start; padding: 38px 0; max-height: calc(100vh - var(--topbar)); overflow-y: auto; }
.toc h5 { font: 600 11.5px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc a { display: block; padding: 5px 0 5px 12px; font-size: 13.5px; color: var(--muted); border-left: 1.5px solid var(--line); line-height: 1.4; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-on { color: var(--blue); border-color: var(--blue); }

/* ============ Videos page ============ */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.vcard { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); transition: transform .3s var(--ease), box-shadow .3s; }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vcard__media { position: relative; aspect-ratio: 9/16; background: #000; }
.vcard__media video { width: 100%; height: 100%; object-fit: cover; }
.vcard__play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.55)); color: #fff; }
.vcard__play span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.35); transition: transform .3s var(--ease); }
.vcard:hover .vcard__play span { transform: scale(1.08); }
.vcard__media.playing .vcard__play { display: none; }
.vcard__body { padding: 14px 16px 16px; }
.vcard__body h3 { font-size: 15.5px; margin-bottom: 4px; }
.vcard__body p { font-size: 13.5px; color: var(--text-2); margin: 0 0 10px; }
.vcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.vcard__tags span { font: 600 11px/1 var(--font); padding: 4px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ccard { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--surface); }
.ccard h3 { font-size: 20px; margin: 6px 0 4px; }
.ccard .num { font: 700 24px/1.2 var(--font-d); color: var(--text); margin: 10px 0 18px; letter-spacing: -.01em; }
.ccard__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn--wa { background: #25d366; color: #05210f; }
.btn--wa:hover { background: #1fbe5b; }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--line); padding: 36px 0 44px; background: var(--bg-2); color: var(--muted); font-size: 14px; }
.footer__in { width: min(1200px, 100% - 32px); margin-inline: auto; display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.footer__in p { margin: 0; }
.footer a { color: var(--text-2); }

/* WhatsApp FAB */
.wa-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 10px 30px -8px rgba(37, 211, 102, .6); transition: transform .3s var(--ease); }
.wa-fab:hover { transform: scale(1.07); text-decoration: none; }

/* ============ Search modal ============ */
.search-modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 16, .45); backdrop-filter: blur(4px); display: flex; justify-content: center; padding: 12vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-modal__box { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.search-modal__head { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-modal__head input { flex: 1; height: 54px; border: 0; outline: 0; background: none; font: 500 16px/1 var(--font); color: var(--text); }
.search-modal__list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-modal__list a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.search-modal__list a:hover, .search-modal__list a.is-sel { background: var(--blue-soft); text-decoration: none; }
.search-modal__list small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.search-modal__list mark { background: color-mix(in srgb, var(--blue) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-modal__empty { padding: 24px; text-align: center; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; z-index: 70; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; transition: all .3s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* reveal */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.page-enter { animation: enter .45s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* ============ Responsive ============ */
@media (max-width: 1240px) {
  .learn { grid-template-columns: 270px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1080px) {
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 36px; padding: 0; justify-content: center; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow__step::after { display: none; }
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stage { height: 520px; max-width: 560px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .modules { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .only-mobile, .icon-btn.only-mobile { display: grid; }
  .learn { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar); bottom: 0; height: auto; width: min(340px, 88vw); z-index: 35; background: var(--bg);
    border-right: 1px solid var(--line); padding: 18px 14px 40px; transform: translateX(-102%); transition: transform .35s var(--ease);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: var(--topbar) 0 0; background: rgba(5,8,16,.35); z-index: 34; }
  .mobile-nav { display: grid !important; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .hero { padding: 40px 0 36px; }
  .hero__lead { font-size: 16.5px; }
  .stage { height: 470px; }
  .term { width: 92%; top: 150px; font-size: 11.5px; }
  .term__body { min-height: 260px; padding: 12px 14px; }
  .phone { width: 170px; right: 4px; top: 0; }
  .phone__badge { display: none; }
  .cards, .grid2, .grid3, .contact-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .brand__name { font-size: 15.5px; }
  .seg button { padding: 5px 7px; }
  .prose { font-size: 15.5px; }
  .prose h2 { font-size: 22px; }
  .tabs__panel { padding: 2px 12px 4px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .doc { padding-top: 22px; }
  .topbar__in { gap: 10px; }
}
@media (max-width: 400px) {
  .brand__name { display: none; }
}
.mobile-nav { display: none; gap: 4px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mobile-nav a { padding: 9px 10px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: 15px; }
.mobile-nav a:hover { background: var(--surface-2); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}
@media (max-width: 960px) {
  body.nav-open:not(.on-learn) .topnav {
    display: flex; flex-direction: column; position: fixed; top: var(--topbar); left: 0; right: 0; z-index: 39; margin: 0;
    background: var(--bg); padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  body.nav-open:not(.on-learn) .topnav a { padding: 12px; font-size: 16px; }
}

/* ============ Terminal simulator ============ */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 0; margin: 18px 0 26px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--code-bg); }
.sim__term { display: flex; flex-direction: column; min-height: 420px; max-height: 520px; }
.sim__bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.07); color: var(--code-muted); font: 500 12px/1 var(--mono); }
.sim__bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .sim__bar i + i { background: #febc2e; } .sim__bar i + i + i { background: #28c840; }
.sim__bar span { margin-left: 6px; }
.sim__bar button { margin-left: auto; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #c9d6ff; border-radius: 7px; padding: 5px 9px; font: 500 12px/1 var(--font); }
.sim__out { flex: 1; overflow-y: auto; padding: 12px 16px 4px; font: 13px/1.65 var(--mono); color: var(--code-text); white-space: pre-wrap; word-break: break-word; }
.sim__out .p { color: #7aa2ff; } .sim__out .e { color: #f87171; } .sim__out .ok { color: #4ade80; } .sim__out .m { color: var(--code-muted); } .sim__out .a { color: #fbbf77; }
.sim__in { display: flex; align-items: center; gap: 8px; padding: 6px 16px 14px; font: 13px/1.6 var(--mono); color: #7aa2ff; }
.sim__in input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; caret-color: #cfe0ff; }
.sim__tasks { background: var(--surface); border-left: 1px solid var(--line); padding: 16px; font-size: 14px; overflow-y: auto; max-height: 520px; }
.sim__tasks h5 { margin: 0 0 10px; font: 600 11.5px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sim__tasks ol { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.sim__tasks li { position: relative; padding: 7px 0 7px 30px; color: var(--text-2); line-height: 1.4; border-bottom: 1px dashed var(--line); margin: 0; }
.sim__tasks li::before { counter-increment: q; content: counter(q); position: absolute; left: 0; top: 7px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 600 11px/1 var(--font); color: var(--muted); }
.sim__tasks li.done { color: var(--muted); text-decoration: line-through; }
.sim__tasks li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.sim__tasks li.cur { color: var(--text); font-weight: 600; }
.sim__tasks li.cur::before { border-color: var(--blue); color: var(--blue); }
.sim__tasks li code { font-size: 12px; }
.sim__hint { margin-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .sim { grid-template-columns: 1fr; } .sim__tasks { border-left: 0; border-top: 1px solid var(--line); max-height: none; } .sim__term { min-height: 340px; } }

/* glossary */
.gloss { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 24px; }
.gloss div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); font-size: 14.5px; }
.gloss b { display: block; color: var(--text); margin-bottom: 2px; }
@media (max-width: 720px) { .gloss { grid-template-columns: 1fr; } }
/* checklist */
.check { list-style: none; padding: 0 !important; margin: 10px 0 22px !important; }
.check li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0 !important; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex: none; }
.check label { cursor: pointer; }
.check input:checked + label { color: var(--muted); text-decoration: line-through; }
