/* Loroco docs — shared styles */
:root {
  --ink: #0b0b0c;
  --ink-soft: #1c1c1f;
  --paper: #fbfaf7;
  --paper-2: #f4f2ec;
  --line: #e7e3d9;
  --muted: #6b6b6f;
  --orange: #e8590c;
  --orange-bright: #f76707;
  --green: #5c940d;
  --green-bright: #74b816;
  --blue: #1c7ed6;
  --red: #e03131;
  --code-bg: #15151a;
  --code-fg: #e9e6df;

  /* Solid brand buttons keep the same orange in both themes (white text stays legible). */
  --btn: #e8590c;
  --btn-hover: #f76707;

  /* Semantic surfaces — overridden wholesale by [data-theme="dark"] below. */
  --surface: #ffffff;
  --nav-bg: rgba(251, 250, 247, 0.86);
  --active-bg: #fde8d8;
  --active-fg: var(--orange);
  --hero-1: #fde8d8;
  --hero-2: #eef7e0;
  --badge-bg: var(--ink);
  --badge-fg: #ffffff;
  --shadow-card: rgba(0, 0, 0, 0.07);
  --shadow-icon: rgba(0, 0, 0, 0.22);
  --tag-read-bg: #e6f4d9;    --tag-read-fg: #3d6307;
  --tag-write-bg: #fde2cf;   --tag-write-fg: #9c3a06;
  --tag-stub-bg: #ececf0;    --tag-stub-fg: #62626a;
  --note-warn-bg: #fff7ed;   --note-warn-line: #f7c99a;
  --note-danger-bg: #fff0f0; --note-danger-line: #f3b3b3;
  --note-info-bg: #eef6fd;   --note-info-line: #b6d8f3;

  color-scheme: light;

  --radius: 14px;
  --maxw: 1080px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

/* ── Dark theme ────────────────────────────────────────────────
   theme.js sets data-theme to the saved choice or the OS preference
   before first paint, so there is no flash. Only the variables
   change here; every rule below reads them, so this block is the
   single source of truth for the dark palette. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3f1ec;
  --ink-soft: #cac7c1;
  --paper: #0d0d10;
  --paper-2: #17171c;
  --line: #2b2b33;
  --muted: #9a9aa4;
  --orange: #ff8a4c;
  --orange-bright: #ffa472;
  --green: #93d13c;
  --green-bright: #aee05a;
  --blue: #4dabf7;
  --red: #ff6b6b;
  --code-bg: #08080b;
  --code-fg: #e9e6df;

  --surface: #16161b;
  --nav-bg: rgba(13, 13, 16, 0.82);
  --active-bg: rgba(247, 103, 7, 0.18);
  --active-fg: var(--orange);
  --hero-1: rgba(247, 103, 7, 0.16);
  --hero-2: rgba(116, 184, 22, 0.12);
  --badge-bg: var(--orange);
  --badge-fg: #1b0f06;
  --shadow-card: rgba(0, 0, 0, 0.5);
  --shadow-icon: rgba(0, 0, 0, 0.6);
  --tag-read-bg: rgba(116, 184, 22, 0.16);   --tag-read-fg: #aee05a;
  --tag-write-bg: rgba(247, 103, 7, 0.2);    --tag-write-fg: #ffb088;
  --tag-stub-bg: rgba(255, 255, 255, 0.08);  --tag-stub-fg: #b6b6c0;
  --note-warn-bg: rgba(247, 103, 7, 0.1);    --note-warn-line: rgba(247, 103, 7, 0.42);
  --note-danger-bg: rgba(224, 49, 49, 0.12); --note-danger-line: rgba(224, 49, 49, 0.45);
  --note-info-bg: rgba(28, 126, 214, 0.12);  --note-info-line: rgba(77, 171, 247, 0.45);
}

* { box-sizing: border-box; }

/* Smooth the swap between themes (skips elements with their own transition). */
body, .nav, .rung, .note, .shot, .pill, .btn, table, th,
code, .tag, .nav-links a, .nav-theme {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
@media (prefers-reduced-motion: reduce) {
  body, .nav, .rung, .note, .shot, .pill, .btn, table, th,
  code, .tag, .nav-links a, .nav-theme { transition: none; }
}
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-bright); text-decoration: underline; }
img { max-width: 100%; }

/* ── Top nav ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand .word { color: var(--orange); letter-spacing: -0.02em; font-size: 18px; }
.nav-links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px;
}
.nav-links a:hover { background: var(--paper-2); text-decoration: none; }
.nav-links a.active { color: var(--active-fg); background: var(--active-bg); }
.nav-gh {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px !important; font-weight: 600 !important;
}
.nav-install {
  background: var(--btn); color: #fff !important; border-radius: 8px;
  padding: 6px 12px !important; font-weight: 600 !important;
}
.nav-install:hover { background: var(--btn-hover); color: #fff !important; }
.nav-theme {
  display: inline-grid; place-items: center;
  width: 34px; height: 32px; padding: 0; flex: none;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; font-size: 15px; line-height: 1;
}
.nav-theme:hover { background: var(--paper-2); color: var(--ink); }
.nav-theme .theme-sun { display: none; }
:root[data-theme="dark"] .nav-theme .theme-sun { display: inline; }
:root[data-theme="dark"] .nav-theme .theme-moon { display: none; }

/* ── Layout ────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: none; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 64ch; }
.muted { color: var(--muted); }
.center { text-align: center; }

h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 16px; }
h2 { font-size: 1.7rem; letter-spacing: -0.02em; margin: 0 0 8px; }
h3 { font-size: 1.18rem; margin: 28px 0 8px; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--orange);
  font-weight: 600; margin-bottom: 12px;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(900px 360px at 78% -8%, var(--hero-1) 0%, transparent 60%),
    radial-gradient(700px 320px at 8% 8%, var(--hero-2) 0%, transparent 55%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero-icon { width: 132px; height: 132px; border-radius: 28px; box-shadow: 0 18px 50px var(--shadow-icon); }
.hero-art { display: flex; justify-content: center; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { background: var(--btn-hover); text-decoration: none; color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); text-decoration: none; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; margin-bottom: 22px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); }

/* ── Cards / grids ─────────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, border-color .2s ease;
}
.card.hover:hover { transform: translateY(-3px); box-shadow: 0 14px 34px var(--shadow-card); }
.card h3 { margin-top: 0; }
.card .ic { font-size: 22px; line-height: 1; margin-bottom: 12px; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* ── Trust ladder ──────────────────────────────────────────── */
.ladder { display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.rung {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--orange);
  border-radius: 12px; padding: 16px 18px;
}
.rung .n {
  width: 36px; height: 36px; border-radius: 9px; background: var(--badge-bg); color: var(--badge-fg);
  display: grid; place-items: center; font-weight: 700; font-family: var(--mono);
}
.rung h4 { margin: 0 0 2px; font-size: 15px; }
.rung p { margin: 0; color: var(--muted); font-size: 14px; }
.rung code { font-size: 12.5px; }
.rung:nth-child(1){ border-left-color: var(--red); }
.rung:nth-child(2){ border-left-color: var(--orange); }
.rung:nth-child(3){ border-left-color: var(--blue); }
.rung:nth-child(4){ border-left-color: var(--green); }

/* ── Code ──────────────────────────────────────────────────── */
code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}
pre {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: 12px; padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  border: 1px solid #2a2a31;
}
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.tok-c { color: #8b94a3; }    /* comment */
.tok-k { color: #f9a36b; }    /* keyword */
.tok-s { color: #a6d676; }    /* string */
.tok-f { color: #7cc7ff; }    /* fn/method */

/* ── Tables ────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper-2); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
td code { white-space: nowrap; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em;
}
.tag-read { background: var(--tag-read-bg); color: var(--tag-read-fg); }
.tag-write { background: var(--tag-write-bg); color: var(--tag-write-fg); }
.tag-stub { background: var(--tag-stub-bg); color: var(--tag-stub-fg); }

/* ── Callouts ──────────────────────────────────────────────── */
.note {
  border-radius: 12px; padding: 16px 18px; font-size: 14.5px;
  border: 1px solid var(--line); background: var(--surface); margin: 18px 0;
}
.note.warn { background: var(--note-warn-bg); border-color: var(--note-warn-line); }
.note.danger { background: var(--note-danger-bg); border-color: var(--note-danger-line); }
.note.info { background: var(--note-info-bg); border-color: var(--note-info-line); }
.note strong { color: var(--ink); }
.note .label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

/* ── Shots ─────────────────────────────────────────────────── */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.shot {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface);
}
.shot img { display: block; width: 100%; }
.shot span { display: block; padding: 9px 12px; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* ── Misc ──────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14.5px; }
.kv dt { font-family: var(--mono); color: var(--orange); }
.kv dd { margin: 0; color: var(--ink-soft); }
ul.checks { list-style: none; padding: 0; margin: 14px 0; }
ul.checks li { padding: 7px 0 7px 30px; position: relative; color: var(--ink-soft); }
ul.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.footer { padding: 40px 0 60px; color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-soft); }

@media (max-width: 820px) {
  .hero-grid, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .nav-theme { margin-left: auto; }
}
