/* The V Lab — site styles. Palette matches the V Lab course pages (navy + teal). */
:root {
  --navy: #17324d;
  --navy-soft: #244b6d;
  --teal: #0b6b66;
  --teal-dark: #07534f;
  --ink: #203040;
  --muted: #526579;
  --paper: #f6f9fb;
  --surface: #ffffff;
  --line: #d7e1e8;
  --teal-pale: #eaf6f4;
  --blue-pale: #edf5fb;
  --amber-pale: #fff5df;
  --amber-ink: #8a5a00;
  --focus: #c2410c;
  --hero-from: #17324d;
  --hero-to: #0b6b66;
  --shadow: 0 10px 28px rgba(23, 50, 77, 0.10);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #cfe0f0;
    --navy-soft: #a9c3dc;
    --teal: #4fc2b8;
    --teal-dark: #7fd8cf;
    --ink: #dde6ee;
    --muted: #9fb0c0;
    --paper: #0f1a24;
    --surface: #16232f;
    --line: #2a3a49;
    --teal-pale: #123230;
    --blue-pale: #142838;
    --amber-pale: #33280f;
    --amber-ink: #f0c36b;
    --hero-from: #142b42;
    --hero-to: #0a4f4b;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { left: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; flex-wrap: wrap;
}

.vlab-brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--navy); font-weight: 800; letter-spacing: 0.085em;
  text-transform: uppercase; text-decoration: none; line-height: 1;
}
.vlab-brand:hover { color: var(--teal-dark); }
.vlab-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 9px;
  color: #fff; background: linear-gradient(135deg, #17324d, #0b6b66);
  box-shadow: 0 5px 14px rgba(23, 50, 77, 0.18);
  font-size: 1rem; letter-spacing: 0;
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 10px;
}
.nav a:hover { color: var(--navy); background: var(--blue-pale); }
.nav a[aria-current="page"] { color: var(--teal-dark); background: var(--teal-pale); }

/* ---------- Hero ---------- */
.hero {
  color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255,255,255,0.12), transparent 60%),
    linear-gradient(135deg, var(--hero-from), var(--hero-to));
  padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 80px);
}
.hero.compact { padding: clamp(40px, 6vw, 64px) 0 clamp(32px, 5vw, 48px); }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 0 18px; max-width: 18ch;
}
.hero.compact h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); max-width: none; }
.hero p.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 62ch; opacity: 0.92; margin: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; font-weight: 700; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-light { background: #fff; color: #17324d; }
.btn-light:hover { color: #0b6b66; }
.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,0.45); }
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.1); }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-top: 44px; max-width: 760px;
}
.stat {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px; padding: 14px 16px;
}
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat span { font-size: 0.85rem; opacity: 0.85; }

/* ---------- Sections ---------- */
main section { padding: clamp(44px, 7vw, 72px) 0; }
main section + section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.01em; color: var(--navy); margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.more { font-weight: 700; text-decoration: none; white-space: nowrap; }

h3 { color: var(--navy); line-height: 1.3; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); }
.card h3 { margin: 0; font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.card .links { margin-top: auto; display: flex; gap: 14px; flex-wrap: wrap; padding-top: 6px; font-weight: 700; font-size: 0.93rem; }
.card .links a { text-decoration: none; }
.card .links a:hover { text-decoration: underline; }

a.card-link { text-decoration: none; color: inherit; }
a.card-link:hover { transform: translateY(-2px); }
a.card-link .go { color: var(--teal); font-weight: 700; font-size: 0.93rem; margin-top: auto; padding-top: 6px; }

.icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; background: var(--teal-pale); color: var(--teal);
}
.icon svg { width: 22px; height: 22px; }

.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 999px; background: var(--blue-pale); color: var(--navy-soft);
}
.tag.amber { background: var(--amber-pale); color: var(--amber-ink); }
.tag.teal { background: var(--teal-pale); color: var(--teal-dark); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.count { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

/* ---------- Feature block ---------- */
.feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 4vw, 40px);
}
.feature h3 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 8px 0 12px; }
.feature p { color: var(--muted); }
.feature img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); display: block; }
.checklist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.35em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--teal-pale) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230b6b66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* ---------- Activity list ---------- */
.activity { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.activity li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; flex-wrap: wrap; }
.activity li + li { border-top: 1px solid var(--line); }
.activity a { font-weight: 700; text-decoration: none; }
.activity time { color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.activity .what { color: var(--muted); font-size: 0.95rem; flex: 1 1 260px; }

/* ---------- Learn catalog ---------- */
.toolbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 28px; position: sticky; top: 65px; z-index: 2;
  background: var(--paper); padding: 12px 0;
}
.search {
  flex: 1 1 260px; min-width: 0;
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { color: #0f1a24; } }

.track { margin-bottom: 44px; }
.track-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.track-head h2 { margin: 0; color: var(--navy); font-size: 1.45rem; }
.track > p { color: var(--muted); margin: 0 0 18px; max-width: 70ch; }
.course-num { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

/* ---------- Code ---------- */
pre {
  background: #0f1d2a; color: #e3edf5; border-radius: 12px; padding: 16px 18px;
  overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; line-height: 1.55; margin: 0;
}
code { font-family: var(--mono); font-size: 0.9em; }
p code, li code, td code { background: var(--blue-pale); padding: 1px 6px; border-radius: 6px; }

/* ---------- Tables ---------- */
.fn-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.fn-table th, .fn-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fn-table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.fn-table td:first-child { white-space: nowrap; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---------- Prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { color: var(--navy); margin-top: 0; }
.prose p, .prose li { color: var(--ink); }
.note {
  background: var(--amber-pale); border-radius: 12px; padding: 14px 18px; color: var(--ink); font-size: 0.95rem;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: 0.93rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--teal); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .site-header .wrap { padding: 10px 0; }
  .nav a { padding: 6px 9px; font-size: 0.9rem; }
  .toolbar { top: 0; position: static; }
  .fn-table td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

.btn-primary { background: #0b6b66; color: #fff; }
.btn-primary:hover { background: #07534f; color: #fff; }
.btn-outline { border: 1px solid var(--line); color: var(--navy); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal-dark); }
