:root {
  --accent: #4c9df5;
  --bg: #16191c;
  --bg-grad: #1b1f23;
  --surface: #1f2327;
  --border: #2c3136;
  --border-2: #383e44;
  --text: #f1f3f5;
  --text-dim: #b8bfc6;
  --text-faint: #82898f;
  --radius: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Geist", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(140% 120% at 50% -20%, var(--bg-grad), var(--bg) 60%);
  color: var(--text);
  line-height: 1.6;
}

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

.lp-nav {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(22, 25, 28, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.lp-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.lp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}
.lp-brand-dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--accent);
}
.lp-nav-cta {
  background: var(--accent);
  color: #0b0d0e;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}
.lp-nav-cta:hover { text-decoration: none; opacity: .9; }

.lp-main { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }

.lp-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 18px;
}

.lp-main h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.lp-main h2 {
  font-size: 23px;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}
.lp-main h3 {
  font-size: 18px;
  margin: 28px 0 10px;
}
.lp-main p { color: var(--text-dim); margin: 0 0 16px; }
.lp-main p.lp-lede { font-size: 18px; color: var(--text); }
.lp-main ul, .lp-main ol { color: var(--text-dim); padding-left: 22px; }
.lp-main li { margin-bottom: 8px; }
.lp-main code {
  font-family: "Geist Mono", ui-monospace, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 13.5px;
  color: var(--text);
}

.lp-table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table.lp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lp-table th, table.lp-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.lp-table th {
  background: var(--surface);
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.lp-table tr:last-child td { border-bottom: none; }
table.lp-table td.mono { font-family: "Geist Mono", ui-monospace, monospace; color: var(--accent); }

.lp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 20px 0;
}

details.lp-q {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
details.lp-q summary { cursor: pointer; font-weight: 500; color: var(--text); }
details.lp-q[open] summary { color: var(--accent); }
details.lp-q .lp-answer { margin-top: 10px; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; }

.lp-cta {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 36px 28px;
  margin: 44px 0;
}
.lp-cta h2 { margin-top: 0; }
.lp-cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #0b0d0e;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.lp-cta-btn:hover { text-decoration: none; opacity: .9; }

.lp-related {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding-top: 28px;
}
.lp-related h2 { margin-top: 0; }
.lp-related ul { list-style: none; padding: 0; }
.lp-related li { margin-bottom: 10px; }

.lp-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  color: var(--text-faint);
  font-size: 13px;
}
.lp-footer a { color: var(--text-faint); }

@media (max-width: 600px) {
  .lp-main h1 { font-size: 27px; }
  table.lp-table { font-size: 13px; }
}

/* ============================================================================
   Interactive study tools (ports drill, objectives checklist)
   ========================================================================= */

/* The base table sets `white-space: nowrap`, which is right for short
   reference cells but turns a prose column into a single very wide line.
   These tables carry explanatory text, so their last column wraps and is
   given room to breathe. */
table.lp-table td:last-child { white-space: normal; }
table.lp-table.lp-objectives td:last-child { min-width: 340px; line-height: 1.5; }
table.lp-table td:last-child a { color: var(--accent); white-space: nowrap; }

/* ── Filter box ─────────────────────────────────────────────────────────── */
.lp-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  flex-wrap: wrap;
}

.lp-input {
  flex: 1 1 260px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.lp-input:focus {
  outline: none;
  border-color: var(--accent);
}

.lp-tool-count {
  font-size: 13px;
  color: var(--text-faint);
  font-family: "Geist Mono", ui-monospace, monospace;
}

.lp-empty {
  color: var(--text-faint);
  font-size: 14px;
  font-style: italic;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.lp-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.lp-btn:hover { border-color: var(--accent); color: var(--accent); }
.lp-btn-ok:hover { border-color: #34d399; color: #34d399; }
.lp-btn-no:hover { border-color: #f87171; color: #f87171; }
.lp-btn-quiet { color: var(--text-faint); font-size: 13px; padding: 6px 12px; }

/* ── Flashcard drill ────────────────────────────────────────────────────── */
.lp-drill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 20px 0;
}

.lp-drill-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.lp-drill-score { font-family: "Geist Mono", ui-monospace, monospace; }

.lp-drill-prompt {
  font-size: 17px;
  color: var(--text);
  margin: 0 0 12px;
  min-height: 2.6em;
  line-height: 1.45;
}

.lp-drill-answer {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 16px;
  color: var(--accent);
  margin: 0 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.lp-drill-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-drill-grade { display: flex; gap: 10px; }

/* ── Objectives checklist ───────────────────────────────────────────────── */
.lp-checklist-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}

.lp-cl-overall {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  min-width: 0;
  font-size: 14px;
  color: var(--text-dim);
}

.lp-cl-track {
  flex: 1 1 80px;
  height: 8px;
  border-radius: 5px;
  background: var(--bg);
  overflow: hidden;
  min-width: 60px;
}

.lp-cl-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
  transition: width .25s ease;
}

.lp-cl-pct { color: var(--accent); font-size: 13px; }

.lp-th-check { width: 34px; }

.lp-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lp-check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

table.lp-objectives tr.done td { opacity: .55; }
table.lp-objectives tr.done td:first-child { opacity: 1; }

.lp-weight { color: var(--text-faint); font-weight: 400; font-size: .78em; }

.lp-domain-progress {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: .62em;
  font-weight: 400;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  margin-left: 10px;
  vertical-align: middle;
}

.lp-domain-progress.complete { color: var(--accent); border-color: var(--accent); }

@media (max-width: 640px) {
  .lp-checklist-summary { flex-direction: column; align-items: stretch; }
  table.lp-table.lp-objectives td:last-child { min-width: 240px; }
}
