/* TLDlive learn/vi article pages. Tokens follow docs/DESIGN.md; every colour has a fallback because style.css is being rewritten.
   Self-contained: all classes are prefixed lx- so nothing depends on app markup. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"); }

:root {
  --lx-bg: var(--bg, #f6f5f3); --lx-surface: var(--surface, #ffffff); --lx-subtle: var(--surface-subtle, #efefed);
  --lx-text: var(--text, #111111); --lx-muted: var(--text-muted, #666666); --lx-border: var(--border, rgba(17,17,17,.08));
  --lx-accent: var(--accent, #2563eb); --lx-green: var(--green, #10b981); --lx-red: var(--red, #dc2626);
  --lx-note: rgba(37,99,235,.08); --lx-warn: rgba(220,38,38,.07); --lx-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.02);
  --lx-font: var(--font, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  --lx-mono: var(--mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  --lx-brand: #111111;
}
:root[data-theme="dark"] {
  --lx-bg: var(--bg, #111111); --lx-surface: var(--surface, #1a1a19); --lx-subtle: var(--surface-subtle, #232322);
  --lx-text: var(--text, #f6f5f3); --lx-muted: var(--text-muted, #a3a3a0); --lx-border: var(--border, rgba(246,245,243,.10));
  --lx-accent: var(--accent, #3b82f6); --lx-green: var(--green, #34d399); --lx-red: var(--red, #f87171);
  --lx-note: rgba(59,130,246,.14); --lx-warn: rgba(248,113,113,.12); --lx-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2); --lx-brand: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --lx-bg: var(--bg, #111111); --lx-surface: var(--surface, #1a1a19); --lx-subtle: var(--surface-subtle, #232322);
    --lx-text: var(--text, #f6f5f3); --lx-muted: var(--text-muted, #a3a3a0); --lx-border: var(--border, rgba(246,245,243,.10));
    --lx-accent: var(--accent, #3b82f6); --lx-green: var(--green, #34d399); --lx-red: var(--red, #f87171);
    --lx-note: rgba(59,130,246,.14); --lx-warn: rgba(248,113,113,.12); --lx-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2); --lx-brand: #ffffff;
  }
}

body.lx { margin: 0; display: flex; flex-direction: column; min-height: 100vh; background: var(--lx-bg); color: var(--lx-text);
  font-family: var(--lx-font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.lx *, body.lx *::before, body.lx *::after { box-sizing: border-box; }
.lx-wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.lx-main a { color: var(--lx-accent); text-decoration: none; }
.lx-main a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lx a:focus-visible { outline: 2px solid var(--lx-accent); outline-offset: 2px; border-radius: 4px; }
.lx-skip { position: absolute; left: -999px; top: 8px; background: var(--lx-text); color: var(--lx-bg) !important; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.lx-skip:focus { left: 8px; }

/* header / footer */
.lx-top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--lx-bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--lx-border); }
.lx-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.lx-brand { display: inline-flex; align-items: baseline; color: var(--lx-brand) !important; font-size: 20px; letter-spacing: -.02em; }
.lx-brand:hover { text-decoration: none !important; }
.lx-brand b { font-weight: 700; } .lx-brand span { font-weight: 500; }
.lx-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--lx-green); margin-left: 3px; align-self: center; box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: lx-pulse 2.4s infinite; }
@keyframes lx-pulse { 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
@media (prefers-reduced-motion: reduce) { .lx-pulse { animation: none; } }
.lx-bar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.lx-bar nav a { color: var(--lx-muted); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 9999px; white-space: nowrap; }
.lx-bar nav a:hover { background: var(--lx-subtle); color: var(--lx-text); text-decoration: none; }
.lx-bar nav a[aria-current] { color: var(--lx-text); background: var(--lx-subtle); }
.lx-main { flex: 1; padding-block: 24px 80px; }
.lx-foot { border-top: 1px solid var(--lx-border); padding-block: 32px; color: var(--lx-muted); font-size: 14px; }
.lx-foot-in { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.lx-foot p { margin: 8px 0 0; }
.lx-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; }
.lx-foot nav a { color: var(--lx-muted); }

/* breadcrumbs */
.lx-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0; margin: 0 0 24px; font-size: 13px; font-weight: 500; color: var(--lx-muted); }
.lx-crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.lx-crumbs a { color: var(--lx-muted); }

/* article */
.lx-article { max-width: 780px; margin-inline: auto; }
.lx-head h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.12; letter-spacing: -.02em; font-weight: 650; margin: 0 0 16px; text-wrap: balance; }
.lx-lead { font-size: 19px; line-height: 1.55; color: var(--lx-muted); margin: 0 0 14px; max-width: 70ch; }
.lx-meta { font-size: 13px; font-weight: 500; color: var(--lx-muted); margin: 0 0 28px; }
.lx-body { max-width: 70ch; font-size: 17px; line-height: 1.7; }
.lx-body > :first-child { margin-top: 0; }
.lx-body h2 { font-size: clamp(24px, 3.4vw, 31px); line-height: 1.2; letter-spacing: -.015em; font-weight: 620; margin: 2.4em 0 .6em; scroll-margin-top: 80px; }
.lx-body h3 { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 1.8em 0 .4em; }
.lx-body p { margin: 0 0 1.1em; }
.lx-body ul, .lx-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.lx-body li { margin: .35em 0; }
.lx-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--lx-accent) 40%, transparent); text-underline-offset: 3px; }
.lx-body strong { font-weight: 620; }
.lx-body code { font-family: var(--lx-mono); font-size: .88em; background: var(--lx-subtle); padding: .12em .4em; border-radius: 6px; overflow-wrap: anywhere; }
.lx-body pre { font-family: var(--lx-mono); font-size: 14px; line-height: 1.55; background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 0 0 1.3em; }
.lx-body pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.lx-body blockquote { margin: 0 0 1.2em; padding: 14px 18px; background: var(--lx-note); border: 1px solid var(--lx-border); border-radius: 12px; color: var(--lx-muted); font-style: italic; }
.lx-body hr { border: 0; border-top: 1px solid var(--lx-border); margin: 2em 0; }

/* tables fill the column and wrap; only on narrow screens do they scroll sideways */
.lx-body table { display: table; width: 100%; max-width: 100%; border-collapse: collapse; background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 12px; box-shadow: var(--lx-shadow); margin: 0 0 1.5em; font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.lx-body th, .lx-body td { white-space: normal; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--lx-border); vertical-align: top; min-width: 90px; }
.lx-body th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--lx-muted); font-weight: 600; white-space: nowrap; }
.lx-body tbody tr:last-child td { border-bottom: 0; }
.lx-body tbody tr:hover { background: var(--lx-subtle); }

/* callouts: <div class="note|tip|warn">; key facts: <ul class="fact">; pros/cons: <div class="pc"> */
.lx-body .note, .lx-body .tip, .lx-body .warn { border: 1px solid var(--lx-border); border-radius: 12px; padding: 14px 18px; margin: 0 0 1.4em; background: var(--lx-note); font-size: 16px; line-height: 1.6; }
.lx-body .tip { border-color: color-mix(in srgb, var(--lx-green) 30%, transparent); background: color-mix(in srgb, var(--lx-green) 8%, transparent); }
.lx-body .note { border-color: color-mix(in srgb, var(--lx-accent) 28%, transparent); background: color-mix(in srgb, var(--lx-accent) 7%, transparent); }
.lx-body .warn { border-color: color-mix(in srgb, var(--lx-red) 30%, transparent); background: var(--lx-warn); }
.lx-body .note > :last-child, .lx-body .tip > :last-child, .lx-body .warn > :last-child { margin-bottom: 0; }
.lx-body .fact { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 1.6em; padding: 0; list-style: none; }
.lx-body .fact li { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 12px; padding: 12px 14px; margin: 0; font-size: 14px; line-height: 1.4; }
.lx-body .fact b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--lx-muted); font-weight: 600; margin-bottom: 4px; }
.lx-body .pc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 1.5em; }
.lx-body .pc > div { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 12px; padding: 4px 18px 8px; }
.lx-body .pc h3 { margin: .9em 0 .4em; font-size: 16px; }
.lx-body .pc ul { padding-left: 1.2em; font-size: 15.5px; line-height: 1.55; }
.lx-body .domain { font-family: var(--lx-mono); }
@media (max-width: 640px) { .lx-body .pc { grid-template-columns: 1fr; } }

/* table of contents */
.lx-toc { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 14px; padding: 16px 20px; margin: 0 0 32px; box-shadow: var(--lx-shadow); max-width: 70ch; }
.lx-toc-h { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--lx-muted); }
.lx-toc ol { margin: 0; padding-left: 1.3em; columns: 2 260px; column-gap: 32px; font-size: 15px; line-height: 1.5; }
.lx-toc li { margin: 4px 0; break-inside: avoid; }

/* FAQ */
.lx-faq { margin-top: 2.6em; }
.lx-faq h2 { margin-top: 0; }
.lx-q { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 12px; padding: 4px 20px 6px; margin: 0 0 12px; }
.lx-body .lx-q h3 { font-size: 17px; margin: 14px 0 6px; }
.lx-q p { margin: 0 0 14px; font-size: 16px; line-height: 1.65; }

/* CTA and related */
.lx-cta { max-width: 70ch; margin: 48px 0 0; background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 16px; padding: 22px 24px; box-shadow: var(--lx-shadow); }
.lx-cta p { margin: 0 0 12px; color: var(--lx-muted); }
.lx-cta .lx-cta-h { color: var(--lx-text); font-size: 20px; font-weight: 620; margin-bottom: 6px; }
.lx-cta p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lx-btn { display: inline-block; padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; background: var(--lx-text); color: var(--lx-bg) !important; border: 1px solid var(--lx-text); }
.lx-btn:hover { text-decoration: none !important; opacity: .88; }
.lx-btn-ghost { background: var(--lx-subtle); color: var(--lx-text) !important; border-color: var(--lx-border); }
.lx-related { max-width: 70ch; margin-top: 40px; }
.lx-related h2 { font-size: 20px; margin: 0 0 10px; }
.lx-related ul { margin: 0; padding-left: 1.2em; line-height: 1.8; }

/* hub index */
.lx-index { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lx-index li { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: 12px; padding: 14px 16px; margin: 0; line-height: 1.4; }
.lx-index a { font-weight: 600; display: block; margin-bottom: 4px; text-decoration: none; }
.lx-index span { font-size: 13.5px; color: var(--lx-muted); display: block; }

@media (max-width: 640px) {
  .lx-wrap { padding-inline: 16px; }
  .lx-body { font-size: 16.5px; }
  .lx-brand { font-size: 18px; }
  .lx-main { padding-block: 16px 56px; }
}

@media (max-width: 640px) {
  .lx-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lx-body td { min-width: 140px; }
}

/* tables: centred on the article column, up to 900px wide on desktop */
@media (min-width: 641px) {
  .lx-body table { width: min(900px, calc(100vw - 48px)); max-width: none; position: relative; left: 50%; transform: translateX(-50%); }
}
