/* learnctl.dev — Slice 3 stylesheet.
 *
 * Design language: clean, technical, monospace-flavored.
 * Two-color accent (greenish for "fresh", amber for "warm"),
 * generous whitespace. No CSS framework, no preprocessor —
 * variables for theming, container queries deferred until we
 * actually need them.
 */

:root {
  --bg: #fdfdfb;
  --bg-card: #ffffff;
  --fg: #15171a;
  --fg-muted: #5a6068;
  --fg-faint: #8a8f96;
  --border: #e5e7eb;
  --border-strong: #cdd1d6;
  --accent: #1f7a4d;       /* fresh */
  --accent-warm: #b78c00;  /* warm */
  --accent-stale: #b14444; /* stale */
  --accent-soft: #f1faf5;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --radius: 8px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, pre, .cli { font-family: var(--mono); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(140%) blur(4px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .container {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand {
  font-family: var(--mono); font-weight: 600;
  color: var(--fg); text-decoration: none;
  font-size: 1.05rem;
}
.brand-mark { color: var(--fg); }
.brand-dot { color: var(--accent); }
.site-nav a {
  margin-left: 1.4rem; color: var(--fg-muted);
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--fg); }

/* ---- hero (catalog index) ---- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.4rem; line-height: 1.15;
  margin: 0 0 1rem; max-width: 32ch;
  letter-spacing: -0.01em;
}
.hero-sub {
  font-size: 1.1rem; color: var(--fg-muted);
  max-width: 65ch; margin: 0 0 2rem;
}
.hero-install {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
}
.cli {
  background: var(--fg); color: #f5f6f8;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: inline-block;
}
.cli-block {
  display: block; padding: 0.85rem 1rem;
  font-size: 0.95rem; line-height: 1.4;
}

/* ---- catalog grid ---- */
.catalog { padding: 3rem 0 4rem; }
.catalog h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted); font-weight: 500;
  margin: 0 0 1rem;
}
.card-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform 120ms ease, box-shadow 120ms ease,
               border-color 120ms ease;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05),
                0 1px 3px rgba(0,0,0,0.04);
  border-color: var(--border-strong);
}
.card-link {
  display: block; padding: 1.2rem 1.3rem;
  color: inherit; text-decoration: none;
}
.card-link:hover { text-decoration: none; }
.card-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.card-title {
  font-size: 1.05rem; line-height: 1.3;
  margin: 0; color: var(--fg);
  font-weight: 600;
}
.card-goal {
  color: var(--fg-muted); font-size: 0.92rem;
  margin: 0 0 1rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-stats {
  display: flex; gap: 1.5rem; margin: 0 0 1rem;
  font-family: var(--mono);
}
.card-stats > div { line-height: 1.2; }
.card-stats dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  margin: 0;
}
.card-stats dd {
  font-size: 0.95rem; color: var(--fg);
  margin: 0;
}
.card-foot {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}

/* ---- badges ---- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: #f6f7f9;
  color: var(--fg-muted);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-tech {
  background: #eef4ff; color: #1d4ed8;
  border-color: #c7d8fc;
}
.badge-level { background: #f3f0ff; color: #6d28d9;
                 border-color: #d7cdf7; }
.badge-tier  { background: #f6f7f9; }
.badge-license { background: #fff; }
.badge-current { background: var(--accent); color: white;
                  border-color: var(--accent); }
.badge-fresh { background: #e9f5ee; color: var(--accent);
                border-color: #b9dcc5; }
.badge-warm  { background: #fdf4dc; color: var(--accent-warm);
                border-color: #efdca3; }
.badge-stale { background: #fbecec; color: var(--accent-stale);
                border-color: #efc7c7; }

/* ---- detail page ---- */
.crumbs {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--fg-faint); margin: 0 0 0.5rem;
}
.detail-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.detail-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 2rem;
  flex-wrap: wrap;
}
.detail-head h1 {
  font-size: 2rem; margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.detail-goal {
  font-size: 1.1rem; color: var(--fg-muted);
  margin: 0; max-width: 60ch;
}
.detail-badges {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-self: flex-start;
}
.install-block {
  margin-top: 2rem;
  background: var(--accent-soft);
  border: 1px solid #cfe8d9;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.install-block h3 {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.08em; margin: 0 0 0.6rem;
  color: var(--accent);
}
.install-note {
  font-size: 0.85rem; color: var(--fg-muted);
  margin: 0.6rem 0 0;
}
.install-note code { background: #fff; padding: 0 0.3rem;
                       border-radius: 3px;
                       border: 1px solid var(--border); }

.detail-body { padding: 2.5rem 0 4rem; }
.detail-body > section { margin-bottom: 3rem; }
.detail-body h2 {
  font-size: 1.3rem; margin: 0 0 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

/* ---- summary stats ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1rem; margin: 0 0 1.5rem;
}
.stat-grid > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.stat-grid dt {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg-faint);
  margin: 0 0 0.25rem;
}
.stat-grid dd {
  margin: 0; font-family: var(--mono);
  font-size: 1.05rem; color: var(--fg);
}

/* ---- difficulty bars ---- */
.difficulty h3 {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg-muted);
  margin: 0 0 0.5rem;
}
.diff-bars {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0.4rem;
}
.diff-bars li {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: center; gap: 0.75rem;
}
.diff-label {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--fg-muted);
}
.diff-bar {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--w, 0%),
                                          #e5e7eb var(--w, 0%));
}
.diff-count {
  font-family: var(--mono); font-size: 0.85rem;
  text-align: right; color: var(--fg);
}

/* ---- TOC ---- */
.stages { list-style: none; padding: 0; counter-reset: stage; }
.stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.stage-head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.stage-title {
  font-size: 1rem; margin: 0;
  font-weight: 600;
}
.stage-meta {
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--fg-muted);
}
.outcomes {
  margin: 0.6rem 0 0; padding-left: 1.2rem;
  color: var(--fg-muted); font-size: 0.92rem;
}
.outcomes li { margin: 0.15rem 0; }
.concepts {
  margin: 0.6rem 0 0;
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.concepts code {
  background: #f1f3f6;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ---- versions table ---- */
.ver-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 0.92rem;
}
.ver-table th, .ver-table td {
  text-align: left; padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.ver-table th {
  font-weight: 500; color: var(--fg-muted);
  text-transform: uppercase; font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.sha { color: var(--fg-faint); font-size: 0.82rem; }

/* ---- author + freshness ---- */
.tools code {
  background: #f1f3f6; padding: 0.15rem 0.4rem;
  border-radius: 4px; font-size: 0.82rem;
  margin-right: 0.4rem;
}

/* ---- author page hero ---- */
.author-hero { padding: 2.5rem 0 1.5rem; }
.author-hero h1 { margin: 0 0 0.4rem; font-size: 2rem; }
.author-count {
  font-family: var(--mono); font-size: 0.9rem;
  color: var(--fg-muted); margin-top: 0.6rem;
}

/* ---- empty / 404 ---- */
.empty {
  padding: 5rem 0; text-align: center;
  color: var(--fg-muted);
}
.empty h1, .empty h2 {
  font-size: 3rem; color: var(--fg);
  margin: 0 0 0.5rem;
}

/* ---- footer ---- */
.site-footer {
  padding: 2.5rem 0 4rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0.3rem 0; }

/* ---- small screens ---- */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-sub { font-size: 1rem; }
  .detail-head h1 { font-size: 1.4rem; }
  .detail-badges { width: 100%; }
}

/* ---- mastery paths (Phase B) ---- */
.paths-strip {
  padding: 2.5rem 0;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.strip-head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.strip-head h2 {
  font-size: 1.05rem; margin: 0;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); font-weight: 600;
}
.strip-more {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--accent);
}
.path-card-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.path-card-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}
.path-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--accent);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.path-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05),
                0 1px 3px rgba(0,0,0,0.04);
}
.path-card .card-link {
  display: block; padding: 1.1rem 1.3rem;
  color: inherit; text-decoration: none;
}
.path-card-title {
  font-size: 1.1rem; font-weight: 600;
  margin: 0 0 0.5rem;
}
.path-card-desc {
  font-size: 0.92rem; color: var(--fg-muted);
  margin: 0 0 0.85rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.path-card-foot {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}

/* ---- path detail page ---- */
.prereqs {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1.2rem;
}
.prereqs h3 {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--fg-muted);
  margin: 0 0 0.4rem;
}
.prereqs ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.prereqs li code {
  background: #f1f3f6; padding: 0.15rem 0.5rem;
  border-radius: 4px; font-size: 0.85rem;
}

.outcomes-block {
  background: var(--accent-soft);
  border: 1px solid #cfe8d9;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
}
.outcomes-block h2 {
  border-bottom: none; padding-bottom: 0; margin-bottom: 0.6rem;
  font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent);
}
.outcomes-block ul {
  margin: 0; padding-left: 1.2rem;
  color: var(--fg);
}
.outcomes-block li { margin: 0.25rem 0; }

.courses .advisory {
  font-size: 0.85rem; color: var(--fg-muted);
  font-style: italic; margin: -0.5rem 0 1rem;
}

.course-list {
  list-style: none; padding: 0; counter-reset: course;
}
.course-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.course-row-unavailable {
  background: #faf9f6;
  border-style: dashed;
  opacity: 0.7;
}
.course-num {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 600;
  line-height: 1;
  padding-top: 2px;
}
.course-head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 0.35rem;
}
.course-title {
  font-size: 1rem; font-weight: 600;
  margin: 0;
}
.course-title a {
  color: var(--fg);
}
.course-title a:hover { color: var(--accent); }
.course-meta-badges {
  display: flex; gap: 0.3rem;
}
.course-goal {
  font-size: 0.9rem; color: var(--fg-muted);
  margin: 0.3rem 0;
}
.course-rationale {
  font-size: 0.85rem; color: var(--fg-faint);
  margin: 0.2rem 0;
  font-style: italic;
}
.course-stats {
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--fg-muted); margin: 0.35rem 0 0;
}
.course-stats .muted { color: var(--fg-faint); }
.course-stats code {
  background: #f1f3f6; padding: 0.1rem 0.35rem;
  border-radius: 3px; font-size: 0.78rem;
}
.muted { color: var(--fg-faint); }

/* ---- auth pages (login, device) ---- */
.auth-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 5rem 0 4rem;
  text-align: center;
}
.auth-page h1 {
  font-size: 2rem; margin: 0 0 0.6rem;
}
.auth-subtitle {
  color: var(--fg-muted); font-size: 1rem;
  margin: 0 0 2.5rem;
}
.auth-buttons {
  display: flex; flex-direction: column;
  gap: 0.75rem;
}
.auth-btn {
  display: flex; align-items: center;
  justify-content: center; gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--fg);
  cursor: pointer;
  font-family: var(--sans);
  transition: background 100ms ease, border-color 100ms ease;
}
.auth-btn:hover {
  background: #f3f4f6;
  border-color: var(--fg-muted);
  text-decoration: none;
}
.auth-btn-github { background: #24292f; color: #fff; border-color: #24292f; }
.auth-btn-github:hover { background: #32383f; text-decoration: none; }
.auth-btn-google { background: #fff; }
.auth-icon { flex-shrink: 0; }
.auth-cli-hint {
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.auth-cli-hint h3 {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--fg-muted);
  margin: 0 0 0.6rem;
}

/* ---- device page ---- */
.device-label {
  display: block; text-align: left;
  font-size: 0.85rem; font-weight: 500;
  color: var(--fg-muted); margin-bottom: 0.4rem;
}
.device-input {
  width: 100%; padding: 0.75rem 1rem;
  font-family: var(--mono); font-size: 1.3rem;
  text-align: center; letter-spacing: 0.15em;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg);
}
.device-input:focus {
  outline: none;
  border-color: var(--accent);
}
.device-error {
  color: var(--accent-stale);
  font-size: 0.9rem; margin-top: 0.75rem;
}
.device-success {
  padding: 2rem;
  background: var(--accent-soft);
  border: 1px solid #cfe8d9;
  border-radius: var(--radius);
}
.device-success h2 {
  color: var(--accent); margin: 0 0 0.5rem;
  font-size: 1.3rem;
}
.device-success p { margin: 0; }

/* ---- dashboard ---- */
.dash-loading {
  padding: 5rem 0; text-align: center;
  color: var(--fg-muted); font-size: 1rem;
}
.dash-header {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.dash-user {
  display: flex; align-items: center; gap: 1rem;
}
.dash-avatar {
  border-radius: 50%;
  border: 2px solid var(--border);
}
.dash-name {
  font-size: 1.4rem; margin: 0;
}
.dash-email {
  font-size: 0.9rem; color: var(--fg-muted); margin: 0;
}
.dash-meta {
  display: flex; align-items: center; gap: 0.75rem;
}
.dash-logout-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg-muted);
  cursor: pointer;
}
.dash-logout-btn:hover {
  background: #f3f4f6;
  color: var(--fg);
}
.dash-section {
  padding: 2rem 0 3rem;
}
.dash-section h2 {
  font-size: 1.3rem; margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.dash-empty {
  text-align: center; padding: 2rem 0;
  color: var(--fg-muted);
}
.dash-empty p { margin: 0 0 1rem; }
.dash-courses {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 1rem;
}
.dash-course {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-card);
}
.dash-course-head {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.dash-course-title {
  font-size: 1.05rem; font-weight: 600;
  color: var(--fg);
}
.dash-course-pct {
  font-family: var(--mono); font-size: 1.1rem;
  font-weight: 600; color: var(--accent);
}
.dash-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.dash-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 300ms ease;
}
.dash-course-meta {
  display: flex; flex-wrap: wrap; gap: 1.2rem;
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--fg-muted);
}
.dash-course-meta code {
  background: #f1f3f6; padding: 0.1rem 0.35rem;
  border-radius: 3px; font-size: 0.78rem;
}
.dash-due {
  color: var(--accent-warm);
}
