/* ============================================================================
   vault-db-template — docs site
   "Ember" theme: warm dark palette derived from the project's Ghostty terminal
   (bg #1a0808, fg #cdd6f4, amber cursor #aa8844, rust #c16358 / #ea4f3e).
   Hand-written, no build step — serves identically on GitHub & GitLab Pages.
   ============================================================================ */

:root {
  /* surfaces */
  --bg:          #140606;
  --bg-2:        #1a0808;
  --surface:     #241011;
  --surface-2:   #2e1416;
  --panel:       #341a1c;
  --border:      #3d2023;
  --border-2:    #5a2f34;

  /* ink */
  --fg:          #ece6e6;
  --fg-soft:     #cdd6f4;
  --muted:       #a9989a;
  --faint:       #7c6c6e;

  /* accents */
  --gold:        #d8a657;
  --gold-bright: #f0c074;
  --amber:       #ffaa00;
  --rust:        #c16358;
  --red:         #ea4f3e;
  --green:       #9fb87a;

  --link:        var(--gold);
  --link-hover:  var(--gold-bright);

  /* type */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Fira Code", "SF Mono", Menlo, monospace;

  /* metrics */
  --maxw: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.7);
  --glow: 0 0 0 1px rgba(216,166,87,.18), 0 8px 30px -10px rgba(216,166,87,.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(193,99,88,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(216,166,87,.07), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.7rem; margin: 0 0 .6rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
h2 .lede, .eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.eyebrow { display: block; margin-bottom: .75rem; }

code, kbd, pre, .mono { font-family: var(--mono); }
:not(pre) > code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .12em .4em;
  font-size: .86em;
  color: var(--gold-bright);
}
kbd {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .1em .5em;
  font-size: .8em;
  color: var(--fg);
  white-space: nowrap;
}

/* ── layout shell ─────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 3.5rem 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ── top nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20,6,6,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: .7rem 1.5rem;
  display: flex; align-items: center; gap: 1.4rem;
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-weight: 700; color: var(--fg);
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; color: var(--gold); }
.brand .dot { width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px 2px rgba(216,166,87,.5); }
.nav-links { display: flex; gap: .3rem; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--muted); padding: .4rem .7rem; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 500;
}
.nav-links a:hover { color: var(--fg); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--gold); }
.nav-links a.gh { border: 1px solid var(--border-2); color: var(--fg); }
.nav-links a.gh:hover { border-color: var(--gold); }
.nav-toggle { display: none; background: none; border: 0; color: var(--fg);
  font-size: 1.5rem; cursor: pointer; margin-left: auto; }

/* ── hero ─────────────────────────────────────────────────────────────────── */
.hero { padding: 5rem 0 3.5rem; text-align: center; position: relative; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem); margin: .4rem 0 .3rem;
  background: linear-gradient(120deg, var(--gold-bright), var(--rust) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tagline { font-family: var(--mono); color: var(--amber); font-size: 1.05rem; letter-spacing: .02em; }
.hero p.sub { font-size: 1.18rem; color: var(--muted); max-width: 680px; margin: 1.2rem auto 0; }
.hero .cta { margin-top: 2rem; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(120deg, var(--gold), #c08a3a); color: #1a0808; }
.btn-primary:hover { text-decoration: none; box-shadow: var(--glow); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border-2); color: var(--fg); background: var(--surface); }
.btn-ghost:hover { text-decoration: none; border-color: var(--gold); color: var(--gold); }

.badges { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.badge {
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: .3rem .7rem; border-radius: 100px;
}
.badge b { color: var(--gold); font-weight: 600; }

/* ── cards / grids ────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
}
.card:hover { border-color: var(--border-2); }
.card h3 { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--fg); }
.card h3 .ico { color: var(--gold); margin-right: .4rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.card.link-card { transition: transform .12s, border-color .12s; }
.card.link-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow); }
.card .kicker { font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .15em; color: var(--rust); }

/* ── code blocks ──────────────────────────────────────────────────────────── */
.code {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 1.1rem 0; overflow: hidden;
}
.code .code-head {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem; border-bottom: 1px solid var(--border);
  background: var(--surface); font-family: var(--mono); font-size: .76rem; color: var(--muted);
}
.code .code-head .lights { display: flex; gap: 6px; }
.code .code-head .lights i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code .code-head .lights .r { background: #ff5f57; }
.code .code-head .lights .y { background: #febc2e; }
.code .code-head .lights .g { background: #28c840; }
.code .code-head .label { margin-left: .3rem; }
.code pre {
  margin: 0; padding: 1rem 1.1rem; overflow-x: auto;
  font-size: .85rem; line-height: 1.6; color: var(--fg-soft);
}
.code pre .c { color: var(--faint); }        /* comment */
.code pre .p { color: var(--gold); }          /* prompt / command */
.code pre .s { color: var(--green); }         /* string */
.code pre .k { color: var(--rust); }          /* keyword */
.copy-btn {
  position: absolute; top: .42rem; right: .5rem;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted);
  font-family: var(--mono); font-size: .7rem; padding: .25rem .55rem; border-radius: 5px; cursor: pointer;
}
.copy-btn:hover { color: var(--gold); border-color: var(--gold); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ── tables ───────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface); color: var(--gold); font-family: var(--mono);
  font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(216,166,87,.04); }
td code { white-space: nowrap; }

/* ── steps ────────────────────────────────────────────────────────────────── */
.steps { counter-reset: step; display: grid; gap: 1.5rem; }
.step { position: relative; padding-left: 3.2rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--mono); font-weight: 700;
}
.step h3 { margin: 0 0 .3rem; }

/* ── callouts ─────────────────────────────────────────────────────────────── */
.note {
  border-left: 3px solid var(--gold); background: var(--surface);
  padding: .9rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.2rem 0;
}
.note.warn { border-left-color: var(--red); }
.note.tip  { border-left-color: var(--green); }
.note strong { color: var(--gold); }
.note.warn strong { color: var(--red); }
.note p { margin: .3rem 0 0; color: var(--muted); }

/* ── screenshots gallery ──────────────────────────────────────────────────── */
.shot {
  border: 1px solid var(--border-2); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); margin: 1rem 0;
}
.shot img { display: block; width: 100%; }
.shot figcaption { padding: .7rem 1rem; font-size: .88rem; color: var(--muted);
  border-top: 1px solid var(--border); background: var(--surface); }
.shot figcaption b { color: var(--gold); font-family: var(--mono); font-size: .8rem; }
.gallery { display: grid; gap: 1.8rem; }

/* in-page tabs for the menu shots */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button {
  font-family: var(--mono); font-size: .82rem; padding: .4rem .9rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 100px; cursor: pointer;
}
.tabs button.active { color: #1a0808; background: var(--gold); border-color: var(--gold); font-weight: 600; }

/* ── two-column doc layout (guides) ───────────────────────────────────────── */
.doc { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; }
.toc { position: sticky; top: 84px; font-size: .9rem; }
.toc .eyebrow { margin-bottom: .6rem; }
.toc a { display: block; color: var(--muted); padding: .25rem 0; border-left: 2px solid var(--border); padding-left: .8rem; }
.toc a:hover { color: var(--fg); text-decoration: none; border-left-color: var(--border-2); }
.toc a.active { color: var(--gold); border-left-color: var(--gold); }

/* ── footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 0; color: var(--muted); font-size: .9rem; }
.footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--gold); }
.footer .mono { font-family: var(--mono); font-size: .78rem; color: var(--faint); }

/* ── misc ─────────────────────────────────────────────────────────────────── */
.hub-figure { text-align: center; margin: 2rem 0; }
.hub-figure img { max-width: 640px; width: 100%; }
.lead { font-size: 1.12rem; color: var(--fg-soft); max-width: 760px; }
.pill-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill { font-family: var(--mono); font-size: .78rem; padding: .28rem .7rem; border-radius: 100px;
  border: 1px solid var(--border-2); color: var(--gold); background: var(--surface); }
.mermaid { margin: 1.4rem 0; text-align: center; }

/* ── read/write operation badges ──────────────────────────────────────────── */
.op {
  font-family: var(--mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .08em; padding: .08rem .34rem; border-radius: 4px;
  vertical-align: middle; margin-right: .35rem; border: 1px solid transparent;
}
.op.r { color: var(--green); background: rgba(159,184,122,.12); border-color: rgba(159,184,122,.3); }
.op.w { color: var(--rust);  background: rgba(193,99,88,.14);  border-color: rgba(193,99,88,.4); }
.op-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .2rem 0 1.4rem; }

/* ── skill vs MCP-tool inline cues (prose in guides/reference) ─────────────── */
/* skills are agent-INVOKED (write a /slash, like a command); MCP tools are
   CALLED automatically (bare name()). Color reinforces the slash/parens cue. */
:not(pre) > code.skill { color: var(--gold-bright); background: rgba(216,166,87,.13); border-color: rgba(216,166,87,.34); }
:not(pre) > code.tool  { color: var(--green);       background: rgba(159,184,122,.11); border-color: rgba(159,184,122,.32); }
.st-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .2rem 0 1.2rem; }
.st-legend code { font-size: .8rem; }

/* ── vibe-coded testimonial strip (guides) ────────────────────────────────── */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: .6rem 0; }
.quotes figure { margin: 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); }
.quotes blockquote { margin: 0; font-size: .92rem; color: var(--fg-soft); line-height: 1.5; }
.quotes figcaption { margin-top: .6rem; font-family: var(--mono); font-size: .74rem; color: var(--muted); }

/* ── per-category Skills | MCP two-column split ───────────────────────────── */
.cat { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; align-items: start; margin: 1rem 0 .5rem; }
.cat .col > h3 { margin-top: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .12em;
  font-family: var(--mono); color: var(--gold); border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.skill-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .55rem; }
.skill-list li { font-size: .88rem; color: var(--muted); line-height: 1.45; }
.skill-list code { white-space: nowrap; }
.cat .tbl-wrap { margin: .6rem 0 0; }
.cat table { font-size: .82rem; }
.cat th, .cat td { padding: .45rem .6rem; }

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .cat { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; display: none; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: .6rem 1rem; gap: .1rem; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem .5rem; }
  .nav-toggle { display: block; }
}
