@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light;

  /* Mintlify palette */
  --primary: #0a0a0a;
  --on-primary: #ffffff;
  --brand-green: #00d4a4;
  --brand-green-deep: #00b48a;
  --brand-green-soft: #e6faf4;

  --canvas: #ffffff;
  --surface: #f7f7f7;
  --surface-soft: #fafafa;

  --hairline: #e5e5e5;
  --hairline-soft: #ededed;

  --ink: #0a0a0a;
  --charcoal: #1c1c1e;
  --slate: #3a3a3c;
  --steel: #5a5a5c;
  --stone: #888888;
  --muted: #a8a8aa;

  /* Radius */
  --rounded-xs: 4px;
  --rounded-sm: 6px;
  --rounded-md: 8px;
  --rounded-lg: 12px;
  --rounded-full: 9999px;

  /* Shadows */
  --shadow-subtle: rgba(0, 0, 0, 0.04) 0px 1px 2px 0px;
  --shadow-card: rgba(0, 0, 0, 0.08) 0px 4px 12px 0px;

  /* Transition */
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
a {
  font: inherit;
}

/* ─── Layout ─── */

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

/* ─── Sidebar ─── */

.sidebar {
  background: var(--canvas);
  border-right: 1px solid var(--hairline);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: var(--rounded-full);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--rounded-md);
  display: grid;
  place-items: center;
  background: var(--brand-green);
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

.eyebrow {
  color: var(--steel);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0 0 1px;
  text-transform: uppercase;
}

.brand h1 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}

.persona {
  background: var(--surface);
  border-radius: var(--rounded-md);
  margin: 20px 12px;
  padding: 12px 14px;
}

.persona p {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}

.persona p + p {
  color: var(--steel);
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
}

.nav-label {
  color: var(--steel);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 16px 12px 8px;
  margin: 0;
}

.lesson-list {
  display: grid;
  gap: 16px;
}

.unit-group h2 {
  color: var(--steel);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0 0 4px;
  padding: 0 12px;
  text-transform: uppercase;
}

.lesson-link {
  align-items: center;
  border-radius: var(--rounded-sm);
  color: var(--steel);
  display: grid;
  gap: 8px;
  grid-template-columns: 28px 1fr;
  margin-bottom: 1px;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: all var(--transition);
}

.lesson-link:hover {
  background: var(--surface);
  color: var(--ink);
}

.lesson-link.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.lesson-number {
  color: var(--stone);
  font-weight: 500;
  font-size: 13px;
  font-family: 'Geist Mono', 'SF Mono', Menlo, Consolas, monospace;
}

.lesson-link.active .lesson-number {
  color: var(--brand-green-deep);
}

/* ─── Main panel ─── */

.main-panel {
  min-width: 0;
  padding: 32px 48px;
  background: var(--surface-soft);
}

.lesson-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin: 0 auto 20px;
  max-width: 720px;
}

.nav-button {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-full);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  padding: 10px 20px;
  transition: all var(--transition);
}

.nav-button:hover:not(:disabled) {
  background: var(--surface);
}

.nav-button:active:not(:disabled) {
  background: var(--charcoal);
  color: var(--on-primary);
  border-color: var(--charcoal);
}

.nav-button:disabled {
  color: var(--muted);
  background: var(--canvas);
  border-color: var(--hairline);
  cursor: not-allowed;
}

/* ─── Lesson content card ─── */

.lesson-content {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  margin: 0 auto;
  max-width: 720px;
  padding: 40px 48px;
}

.lesson-content h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--ink);
}

.lesson-content h1 + p {
  color: var(--steel);
  font-size: 16px;
  margin-top: 0;
}

.lesson-content h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 40px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline-soft);
  color: var(--ink);
}

.lesson-content h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.lesson-content h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin: 24px 0 8px;
}

.lesson-content p,
.lesson-content li {
  font-size: 16px;
  line-height: 1.5;
  color: var(--charcoal);
}

.lesson-content ul,
.lesson-content ol {
  padding-left: 1.35rem;
}

.lesson-content li {
  margin-bottom: 4px;
}

.lesson-content li::marker {
  color: var(--brand-green);
}

.lesson-content code {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-xs);
  color: var(--charcoal);
  font-family: 'Geist Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  padding: 2px 6px;
}

/* ─── Dialogue ─── */

.dialogue-line {
  display: grid;
  gap: 10px;
  grid-template-columns: 54px minmax(0, 1fr);
  margin: 4px 0;
  padding: 10px 14px;
  border-radius: var(--rounded-md);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.dialogue-line:hover {
  background: var(--surface);
  border-color: var(--hairline-soft);
}

.speaker {
  color: var(--brand-green-deep);
  font-weight: 600;
  font-size: 14px;
}

/* ─── Utility ─── */

.muted {
  color: var(--muted);
}

.error {
  color: #d45656;
  font-weight: 600;
  background: #fef2f2;
  padding: 12px 16px;
  border-radius: var(--rounded-md);
  border: 1px solid #fecaca;
}

/* ─── Mobile menu toggle ─── */

.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: var(--rounded-full);
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  place-items: center;
  transition: all var(--transition);
}

.menu-toggle:active {
  background: var(--surface);
}

.sidebar-overlay {
  display: none;
}

/* ─── Responsive ─── */

@media (max-width: 820px) {
  .menu-toggle {
    display: grid;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    border-right: 1px solid var(--hairline);
    border-bottom: none;
    padding: 20px 16px;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 800;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .main-panel {
    padding: 64px 16px 24px;
  }

  .lesson-toolbar {
    justify-content: stretch;
  }

  .nav-button {
    flex: 1;
  }

  .lesson-content {
    padding: 24px 20px;
    border-radius: var(--rounded-md);
  }
}
