/* ==========================================================================
   Skillify — Faqeer Hussain
   Design system: warm paper light mode, deep ink dark mode, emerald accent.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --paper:        #FBFAF7;
  --paper-2:      #F4F2ED;
  --surface:      #FFFFFF;
  --surface-2:    #FAF8F4;

  --ink:          #16191C;
  --ink-2:        #3A424B;
  --muted:        #6B7480;
  --faint:        #98A1AC;

  --line:         rgba(22, 25, 28, 0.10);
  --line-soft:    rgba(22, 25, 28, 0.06);

  --accent:       #0E6B5A;
  --accent-ink:   #0A5245;
  --accent-soft:  rgba(14, 107, 90, 0.09);
  --accent-line:  rgba(14, 107, 90, 0.24);

  --clay:         #B0552C;
  --clay-soft:    rgba(176, 85, 44, 0.10);

  --shadow-sm: 0 1px 2px rgba(16, 20, 24, .04), 0 2px 8px rgba(16, 20, 24, .04);
  --shadow-md: 0 2px 6px rgba(16, 20, 24, .05), 0 12px 32px rgba(16, 20, 24, .07);
  --shadow-lg: 0 4px 12px rgba(16, 20, 24, .06), 0 24px 60px rgba(16, 20, 24, .10);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1160px;
  --wrap-narrow: 760px;
  --radius: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --paper:        #0B0D0F;
  --paper-2:      #101315;
  --surface:      #121618;
  --surface-2:    #161B1E;

  --ink:          #ECEEEF;
  --ink-2:        #C3CACF;
  --muted:        #939CA5;
  --faint:        #6E7880;

  --line:         rgba(236, 238, 239, 0.13);
  --line-soft:    rgba(236, 238, 239, 0.07);

  --accent:       #4FD3B0;
  --accent-ink:   #7BE3C7;
  --accent-soft:  rgba(79, 211, 176, 0.11);
  --accent-line:  rgba(79, 211, 176, 0.28);

  --clay:         #E08A5C;
  --clay-soft:    rgba(224, 138, 92, 0.12);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 2px 6px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.45);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  overflow-x: hidden;
}

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

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
/* Fluid from the smallest phone up: the floor is a mobile size, and the
   vw term starts doing real work well before tablet width. */
h1 { font-size: clamp(2.05rem, 7.5vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.7rem); }
h3 { font-size: clamp(1.15rem, 3vw, 1.45rem); letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; letter-spacing: -0.005em; }

p { text-wrap: pretty; }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

.serif-italic { font-family: var(--font-display); font-style: italic; }

.eyebrow {
  font-family: var(--font-body);
  font-size: .715rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--accent { color: var(--accent); }

.lead {
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  line-height: 1.68;
  color: var(--ink-2);
}

/* ---------- Layout ---------- */
/* Mobile gets a tighter gutter; it widens once there is room for it. */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
@media (min-width: 600px) { .wrap { padding-inline: 24px; } }

.wrap--narrow { max-width: var(--wrap-narrow); }
.section { padding-block: clamp(52px, 9vw, 120px); }
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.section--line { border-top: 1px solid var(--line-soft); }

/* Grid and flex children default to min-width:auto, which refuses to shrink
   below their content. Every wide thing here (code, tables) scrolls inside its
   own container, so the tracks must be allowed to shrink. */
.grid > *, .hero__grid > *, .course-layout > *, .footer__grid > * { min-width: 0; }

.section-head { max-width: 660px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .eyebrow { display: block; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line-soft);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; padding-block: 5px; }
.brand__mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: .92rem;
  flex: none;
  transition: transform .35s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.04); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); }
.brand__sub { font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }

/* Base = mobile: the nav is a panel that drops out of the header. */
.nav {
  position: fixed;
  inset: 72px 0 auto 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 14px 20px 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .26s var(--ease), opacity .26s var(--ease), visibility .26s;
}
.nav.is-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;          /* comfortable thumb target */
  padding: 4px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color .22s var(--ease), background .22s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--line-soft); }
.nav a.is-active { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: all .22s var(--ease);
}
@media (min-width: 880px) { .icon-btn { width: 38px; height: 38px; border-radius: 10px; } }
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav-toggle { display: grid; }

/* Enhancement: once there is room, the nav returns to a normal header row. */
@media (min-width: 880px) {
  .nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border-bottom: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav a { min-height: 0; padding: 8px 13px; font-size: .895rem; }
  .nav a.is-active::after {
    content: "";
    position: absolute;
    left: 13px; right: 13px; bottom: 2px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 2px;
  }
  .nav-toggle { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 21px;
  border-radius: 11px;
  font-size: .9rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-1.5px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: var(--shadow-md); }
.btn--primary:hover svg { transform: translateX(3px); }

.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); background: var(--surface); }

.btn--accent { background: var(--accent); color: #fff; }
html[data-theme="dark"] .btn--accent { color: #06231D; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 550;
  color: var(--accent);
}
.link-arrow svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(56px, 8vw, 104px) clamp(48px, 6vw, 88px); overflow: hidden; }
.hero__glow {
  position: absolute;
  top: -280px; right: -180px;
  width: 720px; height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent-soft), transparent 66%);
  pointer-events: none;
  filter: blur(10px);
}
.hero__glow--2 {
  top: auto; bottom: -380px; right: auto; left: -260px;
  width: 640px; height: 640px;
  background: radial-gradient(circle at center, var(--clay-soft), transparent 66%);
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}
@media (min-width: 940px) {
  .hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  margin-bottom: 26px;
  font-size: .74rem;
  font-weight: 550;
  letter-spacing: .04em;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}
.dot--pulse { animation: pulse 2.6s var(--ease) infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50% { box-shadow: 0 0 0 7px transparent; }
}

.hero h1 { margin-bottom: 22px; }
.hero h1 .accent-word { color: var(--accent); font-style: italic; }
.hero__lead { max-width: 54ch; margin-bottom: 34px; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  font-size: .84rem;
  color: var(--muted);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 15px; height: 15px; color: var(--faint); flex: none; }

/* Portrait card */
.portrait {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
  overflow: hidden;
}
.portrait::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(circle at 70% 0%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 70% 0%, #000, transparent 72%);
  pointer-events: none;
}
.portrait__monogram {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 20px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.portrait__name { position: relative; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-bottom: 4px; }
.portrait__role { position: relative; font-size: .87rem; color: var(--muted); margin-bottom: 24px; }
.portrait__list { position: relative; list-style: none; padding: 0; display: grid; gap: 12px; }
.portrait__list li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: .875rem; color: var(--ink-2);
}
.portrait__list svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 3px; }

/* ---------- Marquee strip ---------- */
.strip {
  border-block: 1px solid var(--line-soft);
  background: var(--paper-2);
  overflow: hidden;
  padding-block: 15px;
}
.strip__track {
  display: flex;
  gap: 46px;
  width: max-content;
  animation: slide 40s linear infinite;
}
.strip:hover .strip__track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.strip__item {
  display: inline-flex; align-items: center; gap: 46px;
  font-family: var(--font-display);
  font-size: .98rem;
  color: var(--muted);
  white-space: nowrap;
}
.strip__item::after { content: "\25E6"; color: var(--accent); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
/* min() keeps the track from demanding more width than the screen has —
   without it, a 320px track overflows a 320px phone. */
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.card {
  position: relative;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-line); }
.card__icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 20px;
}
.card__icon svg { width: 19px; height: 19px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .92rem; color: var(--muted); }
.card__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }

.tag {
  font-size: .7rem;
  font-weight: 550;
  letter-spacing: .03em;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
}
.tag--accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* Course card */
.course-card {
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  position: relative;
  transition: transform .32s var(--ease), box-shadow .32s var(--ease), border-color .32s var(--ease);
}
.course-card::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-line); }
.course-card:hover::after { transform: scaleX(1); }
.course-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.course-card__code {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--faint);
}
.course-card h3 { margin-bottom: 12px; }
.course-card p { font-size: .92rem; color: var(--muted); flex: 1; }
.course-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .75rem; font-weight: 550; color: var(--muted);
}
.status--live { color: var(--accent); }

/* ---------- Numbered list ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 2px; counter-reset: s; }
.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  counter-increment: s;
}
.steps li:last-child { border-bottom: 1px solid var(--line-soft); }
.steps li::before {
  content: "0" counter(s);
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  padding-top: 4px;
  letter-spacing: .04em;
}
.steps h4 { margin-bottom: 6px; }
.steps p { font-size: .92rem; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  padding: clamp(34px, 5vw, 60px);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.contact-panel::before {
  content: "";
  position: absolute; top: -160px; right: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
}
.contact-panel > * { position: relative; }
.contact-list { list-style: none; padding: 0; display: grid; gap: 14px; margin-top: 28px; }
.contact-list li { display: flex; align-items: center; gap: 12px; font-size: .93rem; min-height: 40px; }
.contact-list svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.contact-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  border-bottom: 1px solid var(--accent-line);
  transition: border-color .2s var(--ease);
}
.contact-list a:hover { border-bottom-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--paper-2);
  padding-block: 52px 34px;
  margin-top: auto;
}
/* Base = mobile: a single stacked column. */
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 30px;
}
@media (min-width: 560px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .footer__grid { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
  .footer__brand { grid-column: auto; }
}
.footer__brand p { font-size: .88rem; color: var(--muted); max-width: 34ch; margin-top: 14px; }
.site-footer h4 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 0; }
.site-footer ul a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: .92rem;
  color: var(--muted);
  transition: color .2s var(--ease);
}
@media (min-width: 900px) {
  .site-footer h4 { margin-bottom: 16px; }
  .site-footer ul { gap: 10px; }
  .site-footer ul a { min-height: 0; font-size: .89rem; }
}
.site-footer ul a:hover { color: var(--ink); }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  font-size: .8rem;
  color: var(--faint);
}

/* ==========================================================================
   Course pages
   ========================================================================== */
.course-hero {
  position: relative;
  padding-block: clamp(48px, 6vw, 78px) clamp(34px, 4vw, 52px);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.course-hero__glow {
  position: absolute; top: -300px; left: 45%;
  width: 760px; height: 620px;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 66%);
  pointer-events: none;
}
.course-hero > .wrap { position: relative; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: .8rem; color: var(--faint); margin-bottom: 20px; }
.crumbs a { color: var(--muted); padding-block: 7px; transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--accent); }
.crumbs svg { width: 13px; height: 13px; opacity: .55; }

.course-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 20px; }
.course-hero .lead { max-width: 62ch; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-2);
}
.chip svg { width: 14px; height: 14px; color: var(--muted); }
.chip--live { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chip--live svg { color: var(--accent); }

/* Layout with sticky TOC */
/* Base = mobile: one column. minmax(0,...) is essential — code blocks and
   tables have a large min-content, and an `auto` minimum would let them
   stretch the whole column far past the viewport. */
.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
  padding-block: clamp(36px, 6vw, 72px);
}

/* On mobile the contents list is a card above the lesson. */
.toc {
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
/* The contents list is a disclosure on phones — 15 entries at a comfortable
   tap size would otherwise fill the screen before the lesson begins. */
.toc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
.toc__summary::-webkit-details-marker { display: none; }
.toc__chevron { width: 17px; height: 17px; flex: none; transition: transform .25s var(--ease); }
.toc__panel[open] .toc__chevron { transform: rotate(180deg); }
.toc__panel[open] > ul { margin-top: 12px; }

.toc ul { list-style: none; padding: 0; display: grid; gap: 1px; border-left: 1px solid var(--line); }
.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0 4px 16px;
  margin-left: -1px;
  border-left: 1.5px solid transparent;
  font-size: .9rem;
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

@media (min-width: 940px) {
  .course-layout { grid-template-columns: 244px minmax(0, 1fr); }
  .toc {
    position: sticky;
    top: 100px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .toc a { min-height: 0; padding: 7px 0 7px 16px; font-size: .855rem; }
  /* On desktop the summary is just the heading again — never collapsible. */
  .toc__summary { min-height: 0; margin-bottom: 16px; cursor: default; pointer-events: none; }
  .toc__chevron { display: none; }
  .toc__panel[open] > ul { margin-top: 0; }
}
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--accent); border-left-color: var(--accent); font-weight: 550; }

/* Prose */
.prose { max-width: 74ch; }
.prose > * + * { margin-top: 20px; }
.prose h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.05rem);
  margin-top: 62px;
  scroll-margin-top: 100px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 40px; scroll-margin-top: 100px; }
.prose h4 { margin-top: 30px; }
.prose p { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 22px; display: grid; gap: 9px; }
.prose li { color: var(--ink-2); }
.prose li::marker { color: var(--accent); }
.prose a:not(.btn):not(.link-arrow) {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-line);
  transition: border-color .2s var(--ease);
}
.prose a:not(.btn):not(.link-arrow):hover { border-bottom-color: var(--accent); }
.prose code:not(pre code) {
  font-family: var(--font-mono);
  font-size: .855em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent-line);
}
html[data-theme="dark"] .prose code:not(pre code) { color: var(--accent); }

.prose blockquote {
  margin-top: 28px;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-style: italic;
  color: var(--ink);
}

/* Callout */
.callout {
  display: flex;
  gap: 15px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-top: 28px;
}
.callout__icon { flex: none; color: var(--accent); margin-top: 1px; }
.callout__icon svg { width: 21px; height: 21px; }
.callout h4 { margin-bottom: 5px; margin-top: 0; }
.callout p { font-size: .91rem; color: var(--muted); }
.callout > div > * + * { margin-top: 8px; }
.callout--clay { background: var(--clay-soft); border-color: var(--clay-soft); }
.callout--clay .callout__icon { color: var(--clay); }

/* Code blocks */
.code-block {
  position: relative;
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.code-block__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px 9px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.code-block__name {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--muted);
  letter-spacing: .02em;
}
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 550;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s var(--ease);
}
@media (min-width: 880px) {
  .copy-btn { min-height: 32px; padding: 5px 11px; font-size: .72rem; border-radius: 7px; }
}
.copy-btn:hover { color: var(--ink); border-color: var(--ink); }
.copy-btn.is-copied { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.copy-btn svg { width: 13px; height: 13px; }

.code-block pre {
  margin: 0;
  padding: 16px 16px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.7;
  tab-size: 2;
}
@media (min-width: 600px) {
  .code-block pre { padding: 18px 18px 20px; font-size: .82rem; line-height: 1.72; }
}
.code-block code { font-family: inherit; color: var(--ink-2); white-space: pre; }

/* Syntax colors */
.tok-com { color: var(--faint); font-style: italic; }
.tok-pre { color: var(--clay); }
.tok-str { color: #B0552C; }
.tok-num { color: #7C51B0; }
.tok-key { color: var(--accent); font-weight: 550; }
.tok-typ { color: #2A66AC; }
.tok-fn  { color: var(--ink); font-weight: 550; }
html[data-theme="dark"] .tok-str { color: #E0A05C; }
html[data-theme="dark"] .tok-num { color: #C39BEE; }
html[data-theme="dark"] .tok-typ { color: #79B8F3; }

/* Data table */
/* Wide content scrolls inside its own box; the page itself never does.
   overscroll-behavior stops a sideways swipe from dragging the whole page. */
.table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: .885rem; min-width: 440px; }
thead th {
  text-align: left;
  padding: 13px 18px;
  font-size: .71rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
table code { font-family: var(--font-mono); font-size: .86em; color: var(--accent); }

/* Lesson header */
.lesson-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  margin-top: 62px;
  scroll-margin-top: 100px;
}
.lesson-head__num {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  background: var(--surface);
}
.lesson-head h2 { margin: 0 !important; font-size: clamp(1.4rem, 2.4vw, 1.75rem) !important; }

/* Coming soon */
.coming-soon { display: grid; place-items: center; text-align: center; padding-block: clamp(70px, 12vw, 140px); }
.coming-soon__inner { max-width: 620px; }
.coming-soon__badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: .78rem;
  font-weight: 550;
  letter-spacing: .05em;
  color: var(--ink-2);
  margin-bottom: 30px;
}
.coming-soon h2 { margin-bottom: 20px; }
.coming-soon p { color: var(--muted); }
.coming-soon .btn-row { justify-content: center; margin-top: 34px; }

.plan-list { list-style: none; padding: 0; display: grid; gap: 0; text-align: left; margin-top: 44px; }
.plan-list li {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--line-soft);
  font-size: .93rem;
  color: var(--ink-2);
}
.plan-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.plan-list svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 4px; }

/* Page nav */
.page-nav {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: space-between; align-items: center;
  margin-top: 68px; padding-top: 30px;
  border-top: 1px solid var(--line);
}

/* ---------- 404 ---------- */
.error-page { display: grid; place-items: center; text-align: center; padding-block: clamp(90px, 16vw, 170px); }
.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 16vw, 10rem);
  line-height: 1;
  color: var(--accent);
  opacity: .22;
  margin-bottom: -6px;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */
.page { display: flex; flex-direction: column; min-height: 100vh; }
.page > main { flex: 1; }
.center { text-align: center; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 18px; background: var(--ink); color: var(--paper); border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }
