/* ============================================================
   PyMastery — Design System (light, editorial, professional)
   ============================================================ */

:root {
  /* surfaces */
  --bg: #FFFFFF;
  --bg-alt: #F7F8FA;
  --bg-sunken: #F2F4F7;
  --card: #FFFFFF;
  --line: #E4E7EC;
  --line-strong: #D0D5DD;

  /* ink */
  --ink: #0A0F1C;
  --ink-2: #38404F;
  --muted: #667085;
  --faint: #98A2B3;

  /* brand */
  --accent: #2F5BEA;
  --accent-dark: #1E3ACD;
  --accent-soft: #EEF3FF;
  --accent-line: #C7D5FF;
  --warm: #B54708;
  --warm-soft: #FFF6ED;
  --good: #12B76A;
  --good-soft: #ECFDF3;
  --bad: #F04438;
  --bad-soft: #FEF3F2;
  --warn: #F79009;
  --warn-soft: #FFFAEB;
  --violet: #7A5AF8;
  --violet-soft: #F4F3FF;

  /* code */
  --code-bg: #FFFFFF;
  --code-head: #F7F8FA;
  --term-bg: #0B1220;
  --term-txt: #D7DEEC;

  /* shape */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-xs: 0 1px 2px rgba(10, 15, 28, .05);
  --shadow-sm: 0 2px 6px rgba(10, 15, 28, .06);
  --shadow-md: 0 12px 28px rgba(10, 15, 28, .10);
  --shadow-lg: 0 24px 60px rgba(10, 15, 28, .14);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  --nav-h: 66px;
  --max: 1160px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html {
  -webkit-text-size-adjust: 100%
}

html,
body {
  overflow-x: hidden
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-2);
  line-height: 1.65;
  font-size: 16.5px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #D6E0FF;
  color: var(--ink)
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px
}

::-webkit-scrollbar-track {
  background: var(--bg-alt)
}

::-webkit-scrollbar-thumb {
  background: #C9CEDA;
  border: 3px solid var(--bg-alt);
  border-radius: 8px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--faint)
}

a {
  color: var(--accent);
  text-decoration: none
}

a:hover {
  color: var(--accent-dark)
}

img,
svg {
  max-width: 100%
}

button {
  font-family: inherit;
  cursor: pointer
}

input,
select,
textarea {
  font-family: inherit
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.18
}

.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em
}

code,
kbd,
pre,
.mono {
  font-family: var(--mono)
}

p code,
k li code,
li code,
.desc code,
.faq-a-inner code,
.card p code {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-dark);
  padding: .08em .38em;
  border-radius: 6px;
  font-size: .86em;
}

/* icons */
.ico {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -.125em;
  flex: none
}

.ico-20 {
  width: 20px;
  height: 20px
}

.ico-24 {
  width: 24px;
  height: 24px
}

/* ---------- scroll progress ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: var(--accent);
  z-index: 2000;
  transition: width .08s linear
}

/* ---------- NAVBAR ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(20px, calc((100vw - var(--max)) / 2));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s ease, border-color .3s ease;
}

.navbar.scrolled {
  box-shadow: 0 1px 0 rgba(10, 15, 28, .04), 0 8px 24px rgba(10, 15, 28, .06)
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--ink);
  letter-spacing: -.02em
}

.brand:hover {
  color: var(--ink)
}

.brand .logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: -.04em;
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  align-items: center
}

.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: .925rem;
  transition: .2s;
  display: block;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--bg-sunken)
}

.nav-links a.active {
  color: var(--ink);
  font-weight: 600
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  animation: underlineIn .35s ease;
}

@keyframes underlineIn {
  from {
    transform: scaleX(0);
    opacity: 0
  }

  to {
    transform: scaleX(1);
    opacity: 1
  }
}

.nav-cta {
  padding: 9px 18px !important;
  border-radius: 9px !important;
  background: var(--ink) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: .9rem !important;
  border: 1px solid var(--ink);
  transition: .22s;
}

.nav-cta:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  transform: translateY(-1px)
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 9px;
  border-radius: 8px
}

.hamburger:hover {
  background: var(--bg-sunken)
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: .3s
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg)
}

.hamburger.open span:nth-child(2) {
  opacity: 0
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg)
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .97rem;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(47, 91, 234, .35)
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px rgba(47, 91, 234, .28)
}

.btn-dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink)
}

.btn-dark:hover {
  background: #000;
  color: #fff;
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md)
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong)
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-sm)
}

.btn-sm {
  padding: 9px 16px;
  font-size: .885rem;
  border-radius: 8px
}

.btn-block {
  width: 100%
}

/* ---------- CHIPS / PILLS ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip.beginner {
  background: var(--good-soft);
  color: #067647;
  border-color: #ABEFC6
}

.chip.intermediate {
  background: var(--warn-soft);
  color: #B54708;
  border-color: #FEDF89
}

.chip.advanced {
  background: var(--bad-soft);
  color: #B42318;
  border-color: #FECDCA
}

.chip.pro {
  background: var(--violet-soft);
  color: #5A3AE0;
  border-color: #D9D6FE
}

.chip.easy {
  background: var(--good-soft);
  color: #067647;
  border-color: #ABEFC6
}

.chip.medium {
  background: var(--warn-soft);
  color: #B54708;
  border-color: #FEDF89
}

.chip.hard {
  background: var(--bad-soft);
  color: #B42318;
  border-color: #FECDCA
}

.chip.topic {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: var(--accent-line)
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center
}

.pill {
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-weight: 600;
  font-size: .875rem;
  transition: .18s;
}

.pill:hover {
  border-color: var(--ink);
  color: var(--ink)
}

.pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: var(--shadow-xs)
}

/* ---------- LAYOUT ---------- */
.section {
  padding: 88px max(20px, calc((100vw - var(--max)) / 2))
}

.section-tight {
  padding-top: 0
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line)
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px
}

.section-head.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.kicker::before {
  content: '';
  width: 22px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px
}

.section-head.center .kicker::after {
  content: '';
  width: 22px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  margin-bottom: 14px
}

.section-head p {
  color: var(--muted);
  font-size: 1.05rem
}

.grid {
  display: grid;
  gap: 22px
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr))
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr))
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr))
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2, .7, .3, 1), transform .6s cubic-bezier(.2, .7, .3, 1)
}

.reveal.visible {
  opacity: 1;
  transform: none
}

.reveal-d1 {
  transition-delay: .07s
}

.reveal-d2 {
  transition-delay: .14s
}

.reveal-d3 {
  transition-delay: .21s
}

.reveal-d4 {
  transition-delay: .28s
}

/* ---------- HERO (editorial split) ---------- */
.hero {
  padding: calc(var(--nav-h) + 76px) max(20px, calc((100vw - var(--max)) / 2)) 84px;
  background:
    linear-gradient(180deg, #FBFCFE 0%, #FFFFFF 62%),
    radial-gradient(900px 420px at 12% -10%, rgba(47, 91, 234, .10), transparent 60%);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  font-size: .83rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 26px;
}

.eyebrow .tag {
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, .18)
}

.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.65rem);
  letter-spacing: -.035em;
  line-height: 1.07;
  margin-bottom: 20px
}

.hero h1 .serif {
  color: var(--accent)
}

.hero .lede {
  font-size: 1.09rem;
  color: var(--muted);
  max-width: 540px;
  margin-bottom: 30px
}

.typing-line {
  font-family: var(--mono);
  font-size: .94rem;
  color: var(--ink);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  min-height: 44px;
}

.typing-line::before {
  content: '›';
  color: var(--accent);
  font-weight: 700
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite
}

@keyframes blink {
  50% {
    opacity: 0
  }
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px
}

.hero-meta {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 26px
}

.hero-meta .num {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.03em;
  line-height: 1.1
}

.hero-meta .lbl {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase
}

/* hero code card */
.code-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.code-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  background: var(--code-head);
  border-bottom: 1px solid var(--line);
  font-size: .79rem;
  color: var(--muted);
  font-family: var(--mono);
}

.win-dots {
  display: flex;
  gap: 6px
}

.win-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
  background: #E4E7EC;
  border: 1px solid var(--line-strong)
}

.code-card pre {
  padding: 20px;
  font-size: .845rem;
  line-height: 1.75;
  background: var(--code-bg);
  overflow-x: auto
}

.term-mini {
  background: var(--term-bg);
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--term-txt);
  line-height: 1.75;
  border-top: 1px solid #1B2436
}

.term-mini .p {
  color: #7AA2FF
}

.term-mini .ok {
  color: #5BD8A6
}

.float-badge {
  position: absolute;
  right: -14px;
  bottom: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- STATS STRIP ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.stats-strip .cell {
  padding: 26px 22px;
  border-right: 1px solid var(--line)
}

.stats-strip .cell:last-child {
  border-right: 0
}

.stats-strip .num {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.03em
}

.stats-strip .num span {
  color: var(--accent)
}

.stats-strip .lbl {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-top: 3px
}

/* ---------- CARDS ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong)
}

.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  margin-bottom: 18px;
}

.card .icon svg {
  width: 20px;
  height: 20px
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px
}

.card p {
  color: var(--muted);
  font-size: .94rem
}

.card .link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--accent);
  transition: gap .2s;
}

.card:hover .link {
  gap: 11px
}

.card-num {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: .1em;
  margin-bottom: 14px;
  display: block;
}

/* numbered track rows */
.track-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff
}

.track-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  transition: background .18s;
}

.track-row:last-child {
  border-bottom: 0
}

.track-row:hover {
  background: #FBFCFE
}

.track-row .n {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .06em
}

.track-row h4 {
  font-size: 1rem;
  margin-bottom: 2px
}

.track-row p {
  color: var(--muted);
  font-size: .9rem
}

.track-row .arrow {
  color: var(--faint);
  transition: .2s
}

.track-row:hover .arrow {
  color: var(--accent);
  transform: translateX(4px)
}

/* roadmap */
.roadmap {
  position: relative;
  padding-left: 34px
}

.roadmap::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-soft))
}

.r-item {
  position: relative;
  padding-bottom: 30px
}

.r-item:last-child {
  padding-bottom: 0
}

.r-item::before {
  content: '';
  position: absolute;
  left: -34px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
}

.r-item .r-level {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px
}

.r-item h4 {
  font-size: 1rem
}

.r-item p {
  color: var(--muted);
  font-size: .93rem;
  margin-top: 3px
}

/* ---------- CODE BLOCKS ---------- */
.code-wrap {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 16px 0;
  box-shadow: var(--shadow-xs);
}

.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--code-head);
  border-bottom: 1px solid var(--line);
}

.code-title {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted)
}

.code-head .actions {
  margin-left: auto;
  display: flex;
  gap: 8px
}

.copy-btn {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  padding: 4px 11px;
  border-radius: 7px;
  font-size: .73rem;
  font-weight: 700;
  transition: .18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  border-color: var(--ink);
  color: var(--ink)
}

pre {
  margin: 0;
  padding: 17px 19px;
  overflow-x: auto;
  font-size: .845rem;
  line-height: 1.75;
  color: #1F2937;
  tab-size: 4
}

code .k {
  color: #CF222E;
  font-weight: 600
}

code .s {
  color: #0A3069
}

code .n {
  color: #0550AE
}

code .c {
  color: #6E7781;
  font-style: italic
}

code .f {
  color: #8250DF
}

code .b {
  color: #953800
}

code .d {
  color: #0550AE;
  font-weight: 600
}

code .o {
  color: #57606A
}

/* terminal / CLI blocks */
.cmd {
  background: var(--term-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid #1B2436;
  box-shadow: var(--shadow-sm);
}

.cmd-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #0F1729;
  border-bottom: 1px solid #1B2436;
  font-family: var(--mono);
  font-size: .73rem;
  color: #8493B5;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.cmd-head .actions {
  margin-left: auto
}

.cmd pre {
  color: var(--term-txt);
  padding: 16px 19px;
  font-size: .83rem
}

.cmd pre .pr {
  color: #7AA2FF
}

.cmd pre .cm {
  color: #64748B
}

.cmd pre .ok {
  color: #5BD8A6
}

.cmd .copy-btn {
  background: #1B2436;
  border-color: #2C3851;
  color: #C3CDDD
}

.cmd .copy-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.cmd.dark-code pre code span.k {
  color: #FF7B72
}

.cmd.dark-code pre code span.s {
  color: #A5D6FF
}

.cmd.dark-code pre code span.c {
  color: #8B949E
}

/* output panel */
.output {
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: .81rem;
  color: #067647;
  white-space: pre-wrap;
  word-break: break-word;
}

.output .label {
  display: block;
  color: var(--faint);
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  margin-bottom: 7px;
  font-family: var(--font);
  font-weight: 700;
}

.output.error {
  background: var(--bad-soft);
  color: #B42318
}

/* ---------- PAGE HEADER (inner pages) ---------- */
.page-hero {
  padding: calc(var(--nav-h) + 66px) max(20px, calc((100vw - var(--max)) / 2)) 44px;
  background: linear-gradient(180deg, #FBFCFE, #FFFFFF);
  border-bottom: 1px solid var(--line);
}

.page-hero .inner {
  max-width: var(--max);
  margin: 0 auto
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.03em;
  margin-bottom: 14px
}

.page-hero h1 .serif {
  color: var(--accent)
}

.page-hero p {
  color: var(--muted);
  max-width: 660px;
  font-size: 1.06rem
}

.crumb {
  font-size: .8rem;
  color: var(--faint);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 16px
}

.crumb a {
  color: var(--muted)
}

/* ---------- TOOLBAR / PROGRESS ---------- */
.toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px max(20px, calc((100vw - var(--max)) / 2)) 0;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 430px
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: .94rem;
  transition: .18s;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 91, 234, .13)
}

.search-box .s-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.progress-panel {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px max(20px, calc((100vw - var(--max)) / 2)) 0;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.progress-track {
  flex: 1;
  min-width: 180px;
  height: 8px;
  border-radius: 99px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  overflow: hidden
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width .7s cubic-bezier(.2, .7, .3, 1)
}

.progress-text {
  font-weight: 700;
  color: var(--ink);
  font-size: .92rem;
  font-family: var(--mono)
}

/* ---------- LESSONS ---------- */
.lesson {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color .22s, box-shadow .22s;
}

.lesson:hover {
  border-color: var(--line-strong)
}

.lesson.open {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md)
}

.lesson-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: none;
  border: 0;
  text-align: left;
  color: inherit;
  transition: background .18s;
}

.lesson-head:hover {
  background: #FBFCFE
}

.lesson-num {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink-2);
  font-size: .86rem;
}

.lesson.open .lesson-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.lesson-meta {
  flex: 1;
  min-width: 0
}

.lesson-meta h3 {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 5px
}

.lesson-meta .sub {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center
}

.check-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  color: var(--faint);
  transition: .18s;
  flex: none;
}

.check-btn:hover {
  border-color: var(--good);
  color: var(--good)
}

.check-btn.done {
  background: var(--good-soft);
  border-color: #ABEFC6;
  color: #067647
}

.lesson-toggle {
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: .3s;
  font-size: .85rem;
  flex: none;
}

.lesson.open .lesson-toggle {
  transform: rotate(180deg);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.lesson-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s cubic-bezier(.3, .8, .3, 1)
}

.lesson-body-inner {
  padding: 2px 22px 24px;
  border-top: 1px dashed var(--line);
  margin-top: 2px
}

.lesson-body-inner p {
  margin: 16px 0 4px;
  color: var(--ink-2)
}

.keypoints {
  list-style: none;
  margin: 10px 0 4px
}

.keypoints li {
  padding: 7px 0 7px 26px;
  position: relative;
  color: var(--ink-2);
  font-size: .93rem;
  border-bottom: 1px dashed var(--line)
}

.keypoints li:last-child {
  border-bottom: 0
}

.keypoints li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg)
}

.h4 {
  color: var(--ink);
  font-weight: 700;
  margin: 22px 0 6px;
  font-size: .95rem;
  letter-spacing: -.01em
}

/* ---------- MODULES ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(255px, 100%), 1fr));
  gap: 16px
}

.module-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: .2s;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md)
}

.module-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

.module-card .m-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  color: var(--ink);
}

.module-card .m-icon svg {
  width: 19px;
  height: 19px
}

.module-card h3 {
  font-family: var(--mono);
  font-size: .99rem;
  font-weight: 600
}

.module-card .m-cat {
  font-size: .7rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700
}

.module-card p {
  font-size: .875rem;
  color: var(--muted);
  margin-top: 7px
}

/* modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 28, .44);
  backdrop-filter: blur(3px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .25s;
}

.modal-overlay.show {
  display: flex;
  opacity: 1
}

.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 860px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.98);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.1);
}

.modal-overlay.show .modal {
  transform: none
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  transition: .18s;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: var(--bad-soft);
  border-color: #FECDCA;
  color: #B42318
}

.modal h2 {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.02em
}

.modal .m-desc {
  color: var(--muted);
  margin-bottom: 16px
}

/* ---------- PRACTICE ---------- */
.problem {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  transition: .22s;
  box-shadow: var(--shadow-xs);
}

.problem:hover {
  border-color: var(--line-strong)
}

.problem.solved {
  border-color: #ABEFC6;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, .07)
}

.problem-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line)
}

.problem-head .p-num {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: .85rem;
}

.problem.solved .p-num {
  background: var(--good)
}

.problem-head .p-title {
  flex: 1;
  min-width: 190px
}

.problem-head h3 {
  font-size: 1.03rem
}

.problem-head .p-tags {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap
}

.problem-body {
  padding: 18px 22px 24px
}

.problem-body>p.desc {
  color: var(--ink-2);
  margin-bottom: 6px
}

.ex-rows {
  display: grid;
  gap: 10px;
  margin: 14px 0
}

.ex-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

@media (max-width:700px) {
  .ex-row {
    grid-template-columns: 1fr
  }
}

.ex {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: .79rem;
  color: var(--ink);
}

.ex .tag {
  display: block;
  font-family: var(--font);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--faint);
  font-weight: 800;
  margin-bottom: 4px;
}

.ex.in .val {
  color: var(--accent-dark)
}

.ex.out .val {
  color: #067647
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0
}

@media (max-width:900px) {
  .editor-grid {
    grid-template-columns: 1fr
  }
}

textarea.editor {
  width: 100%;
  min-height: 200px;
  background: #fff;
  color: #1F2937;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 15px;
  font-family: var(--mono);
  font-size: .83rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: .18s;
  tab-size: 4;
  box-shadow: var(--shadow-xs);
}

textarea.editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 91, 234, .13)
}

.run-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center
}

.run-btn {
  background: var(--good);
  color: #fff;
  border: 1px solid var(--good);
  padding: 11px 22px;
  border-radius: 9px;
  font-weight: 700;
  font-size: .89rem;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: .18s;
  box-shadow: 0 1px 2px rgba(18, 183, 106, .35);
}

.run-btn:hover {
  background: #0EA55F;
  border-color: #0EA55F;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(18, 183, 106, .3)
}

.run-btn:disabled {
  opacity: .6;
  cursor: wait;
  transform: none
}

.sol-btn {
  background: #fff;
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 600;
  font-size: .875rem;
  transition: .18s;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.sol-btn:hover {
  border-color: var(--ink);
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-sm)
}

.sol-btn.hide-sol:hover {
  border-color: #FECDCA;
  background: var(--bad-soft);
  color: #B42318
}

.solution-box,
.hint-box {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s cubic-bezier(.3, .8, .3, 1)
}

.solution-box.open {
  max-height: 4000px
}

.hint-box.open {
  max-height: 700px
}

.hint-inner {
  margin-top: 14px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid #FEDF89;
  color: #93370D;
  font-size: .93rem;
}

.hint-inner .h-title {
  font-weight: 800;
  margin-bottom: 5px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--warm)
}

.verify-badge {
  display: none;
  padding: 7px 14px;
  border-radius: 9px;
  font-weight: 700;
  font-size: .8rem;
  align-items: center;
  gap: 7px;
}

.verify-badge.pass {
  display: inline-flex;
  background: var(--good-soft);
  color: #067647;
  border: 1px solid #ABEFC6
}

.verify-badge.fail {
  display: inline-flex;
  background: var(--bad-soft);
  color: #B42318;
  border: 1px solid #FECDCA
}

/* ---------- PLAYGROUND ---------- */
.play-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px max(20px, calc((100vw - var(--max)) / 2)) 90px
}

.snippet-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 26px max(20px, calc((100vw - var(--max)) / 2)) 0;
  max-width: var(--max);
  margin: 0 auto
}

.snippet {
  padding: 7px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-size: .79rem;
  font-weight: 600;
  font-family: var(--mono);
  transition: .18s;
}

.snippet:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink)
}

.play-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px
}

@media (max-width:960px) {
  .play-grid {
    grid-template-columns: 1fr
  }
}

.play-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column
}

.pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--code-head);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: .85rem;
  color: var(--ink-2);
}

.pane-head .lang {
  font-family: var(--mono);
  font-size: .7rem;
  background: var(--ink);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
}

#play-output {
  min-height: 330px;
  max-height: 520px;
  overflow: auto;
  padding: 18px;
  font-family: var(--mono);
  font-size: .83rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #067647;
  background: #fff;
  flex: 1;
}

#play-output .err {
  color: #B42318
}

#play-output .sys {
  color: var(--faint);
  font-style: italic
}

.play-pane textarea.editor {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 400px;
  flex: 1
}

.play-pane .run-bar {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: var(--code-head);
  margin-top: 0
}

.loading-ring {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -3px;
}

.btn .loading-ring,
.run-btn .loading-ring {
  border-color: rgba(255, 255, 255, .45);
  border-top-color: #fff
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ---------- SETUP / GUIDE PAGES ---------- */
.guide {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px max(20px, calc((100vw - var(--max)) / 2)) 96px
}

.guide-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 46px;
  align-items: start
}

@media (max-width:1000px) {
  .guide-grid {
    grid-template-columns: 1fr
  }
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-xs)
}

.toc .toc-title {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 800;
  margin-bottom: 10px
}

.toc ol {
  list-style: none;
  counter-reset: t;
  display: grid;
  gap: 2px
}

.toc li {
  counter-increment: t
}

.toc a {
  display: flex;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: .875rem;
  color: var(--ink-2);
  font-weight: 500;
  transition: .15s;
}

.toc a::before {
  content: counter(t, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--faint);
  font-weight: 700;
  padding-top: 3px
}

.toc a:hover {
  background: var(--bg-sunken);
  color: var(--ink)
}

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  scroll-margin-top: 90px
}

.step-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 6px
}

.step-num {
  min-width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .85rem;
  flex: none;
}

.step h2 {
  font-size: 1.24rem;
  margin-bottom: 4px
}

.step .step-sub {
  color: var(--muted);
  font-size: .94rem
}

.step p {
  margin: 14px 0 4px;
  color: var(--ink-2);
  font-size: .96rem
}

.step ul.plain {
  margin: 10px 0 4px 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 7px
}

.step ul.plain li {
  position: relative;
  padding-left: 24px;
  font-size: .94rem;
  color: var(--ink-2)
}

.step ul.plain li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55
}

.callout {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: .93rem;
  color: var(--ink-2);
}

.callout svg {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px
}

.callout.info {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: #1E3ACD
}

.callout.info svg {
  color: var(--accent)
}

.callout.warn {
  background: var(--warn-soft);
  border-color: #FEDF89;
  color: #93370D
}

.callout.warn svg {
  color: var(--warm)
}

.callout.good {
  background: var(--good-soft);
  border-color: #ABEFC6;
  color: #067647
}

.callout.good svg {
  color: var(--good)
}

.callout b {
  font-weight: 700
}

/* OS tabs */
.os-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.os-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-2);
  transition: .18s;
}

.os-tab svg {
  width: 17px;
  height: 17px
}

.os-tab:hover {
  border-color: var(--ink);
  color: var(--ink)
}

.os-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm)
}

.os-pane {
  display: none;
  animation: fadeIn .35s ease
}

.os-pane.active {
  display: block
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* checklist */
.checklist {
  display: grid;
  gap: 10px;
  margin: 16px 0
}

.check-item {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: .18s;
}

.check-item:hover {
  border-color: var(--line-strong);
  background: #FBFCFE
}

.check-item input {
  display: none
}

.check-box {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  transition: .18s;
  margin-top: 2px;
  background: #fff;
}

.check-box svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transition: .18s
}

.check-item.done .check-box {
  background: var(--good);
  border-color: var(--good)
}

.check-item.done .check-box svg {
  opacity: 1
}

.check-item.done .c-text {
  color: var(--faint);
  text-decoration: line-through
}

.c-text {
  font-size: .94rem;
  color: var(--ink-2)
}

.c-text b {
  display: block;
  color: var(--ink);
  font-weight: 650
}

/* tables */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: auto;
  margin: 16px 0
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .91rem;
  min-width: 520px
}

.tbl th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: .73rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top
}

.tbl tr:last-child td {
  border-bottom: 0
}

.tbl td code {
  font-family: var(--mono);
  font-size: .83rem;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  padding: .1em .4em;
  border-radius: 6px;
  color: var(--ink)
}

.tbl tr:hover td {
  background: #FBFCFE
}

kbd.kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font-size: .78rem;
  color: var(--ink);
  font-family: var(--mono);
}

/* file tree */
.file-tree {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: .83rem;
  line-height: 1.9;
  color: var(--ink-2);
}

.file-tree b {
  color: var(--ink);
  font-weight: 600
}

.file-tree .dim {
  color: var(--faint)
}

/* deploy steps */
.method {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow-xs)
}

.method h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  margin-bottom: 6px
}

.method .badge {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--accent-line);
  padding: 3px 9px;
  border-radius: 999px;
}

.numlist {
  list-style: none;
  counter-reset: s;
  display: grid;
  gap: 14px;
  margin: 16px 0
}

.numlist li {
  counter-increment: s;
  position: relative;
  padding-left: 44px;
  min-height: 26px;
  font-size: .95rem;
  color: var(--ink-2)
}

.numlist li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.numlist li b {
  color: var(--ink)
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 800px;
  margin: 0 auto
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: #fff;
  transition: .2s;
  overflow: hidden
}

.faq-item:hover {
  border-color: var(--line-strong)
}

.faq-item.open {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm)
}

.faq-q {
  width: 100%;
  text-align: left;
  padding: 17px 20px;
  background: none;
  border: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: .99rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.fq-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: .3s;
  color: var(--ink);
  flex: none;
  font-size: 1rem;
}

.faq-item.open .fq-ico {
  transform: rotate(45deg);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease
}

.faq-a-inner {
  padding: 0 20px 18px;
  color: var(--muted)
}

/* ---------- CTA BANNER ---------- */
.banner {
  border-radius: 20px;
  padding: 52px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.banner h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 12px
}

.banner p {
  color: #38509E;
  max-width: 560px;
  margin: 0 auto 26px
}

.banner .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1
}

/* ---------- FOOTER ---------- */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: 56px max(20px, calc((100vw - var(--max)) / 2)) 28px;
  margin-top: 0
}

.foot-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px
}

@media (max-width:900px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:520px) {
  .foot-grid {
    grid-template-columns: 1fr
  }
}

.foot-grid h5 {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 13px;
  font-size: .9rem
}

.foot-grid ul {
  list-style: none
}

.foot-grid li {
  margin-bottom: 8px
}

.foot-grid a {
  color: var(--muted);
  font-size: .895rem;
  transition: .15s;
  display: inline-block
}

.foot-grid a:hover {
  color: var(--accent);
  transform: translateX(3px)
}

.foot-brand p {
  color: var(--muted);
  font-size: .895rem;
  max-width: 330px;
  margin-top: 14px
}

.foot-bottom {
  max-width: var(--max);
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: .83rem;
}

.foot-bottom a {
  color: var(--muted)
}

/* ---------- TOAST ---------- */
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(130%);
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 11px;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.25);
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(92vw, 560px);
}

#toast.show {
  transform: translateX(-50%) translateY(0)
}

/* back to top */
#to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: .28s;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

#to-top.show {
  opacity: 1;
  pointer-events: auto
}

#to-top:hover {
  background: var(--ink);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md)
}

/* ---------- RESPONSIVE ---------- */
@media (max-width:1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px
  }

  .hero .lede {
    max-width: none
  }

  .float-badge {
    right: 14px
  }
}

@media (max-width:860px) {
  .hamburger {
    display: flex
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 20px;
    gap: 3px;
    box-shadow: var(--shadow-md);
    transform: translateY(-130%);
    transition: transform .35s cubic-bezier(.2, .9, .3, 1.1);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }

  .nav-links.open {
    transform: translateY(0)
  }

  .nav-links a {
    padding: 13px 14px;
    font-size: 1rem;
    border-radius: 9px
  }

  .nav-links a.active::after {
    display: none
  }

  .nav-links a.active {
    background: var(--accent-soft);
    color: var(--accent-dark)
  }

  .nav-cta {
    margin-top: 10px;
    text-align: center
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr
  }

  .stats-strip .cell:nth-child(2n) {
    border-right: 0
  }

  .stats-strip .cell:nth-child(-n+2) {
    border-bottom: 1px solid var(--line)
  }

  .section {
    padding: 64px 20px
  }

  .track-row {
    grid-template-columns: 44px 1fr;
    gap: 12px;
    padding: 16px 18px
  }

  .track-row .arrow {
    display: none
  }

  .hero-meta {
    gap: 20px
  }
}

@media (max-width:560px) {
  body {
    font-size: 16px
  }

  .hero {
    padding-top: calc(var(--nav-h) + 48px)
  }

  .hero-actions .btn {
    width: 100%
  }

  .hero-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
  }

  .stats-strip {
    grid-template-columns: 1fr
  }

  .stats-strip .cell {
    border-right: 0;
    border-bottom: 1px solid var(--line)
  }

  .stats-strip .cell:last-child {
    border-bottom: 0
  }

  .lesson-head {
    padding: 15px;
    gap: 11px
  }

  .lesson-body-inner {
    padding: 2px 15px 20px
  }

  .problem-head,
  .problem-body {
    padding-left: 16px;
    padding-right: 16px
  }

  .modal {
    padding: 22px
  }

  .step {
    padding: 20px 17px
  }

  .banner {
    padding: 38px 22px
  }

  .page-hero {
    padding-top: calc(var(--nav-h) + 46px)
  }

  .toolbar,
  .progress-panel,
  .snippet-bar {
    padding-left: 20px;
    padding-right: 20px
  }

  .search-box {
    max-width: none
  }
}

/* ---------- component extras ---------- */
#to-top .ico {
  transform: rotate(180deg)
}

.sol-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px
}

.m-icon.lg {
  width: 58px;
  height: 58px;
  border-radius: 15px
}

.m-icon.lg svg {
  width: 26px;
  height: 26px
}

.toc::-webkit-scrollbar {
  width: 6px
}

.toc::-webkit-scrollbar-thumb {
  border: 0;
  border-radius: 6px
}

.step code:not(pre code),
.method code:not(pre code) {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-dark);
  padding: .08em .38em;
  border-radius: 6px;
  font-size: .85em
}

.code-card {
  margin-right: 26px
}

@media (max-width:1080px) {
  .code-card {
    margin-right: 0
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important
  }

  html {
    scroll-behavior: auto
  }
}

@media print {

  .navbar,
  footer,
  #to-top,
  #scroll-progress,
  .run-bar,
  .hamburger {
    display: none !important
  }

  body {
    background: #fff;
    color: #000
  }

  .lesson-body {
    max-height: none !important
  }
}