/* ============================================================================
   SubVault docs — Sub Surface v9 design system
   ----------------------------------------------------------------------------
   Shared stylesheet for the five static pages under /docs.
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* --- Design tokens -------------------------------------------------------- */
:root {
  /* Paper (light surfaces) */
  --paper:        #F0EFF5;
  --paper-bright: #F8F7FC;

  /* Glass (translucent layers) */
  --glass:        rgba(255, 255, 255, 0.68);
  --glass-border: rgba(0, 0, 0, 0.055);

  /* Ink (text + dark surfaces) — 1 darkest → 3 lightest */
  --ink:   #0D0C12;
  --ink-2: #38354A;
  --ink-3: #8B88A0;

  /* Brand: cobalt */
  --cobalt:     #2060E8;
  --cobalt-dim: rgba(32, 96, 232, 0.07);

  /* Amber for warning callouts. The text color is darker than the
     background tint to stay legible at body size. */
  --amber-bg:   rgba(146, 64, 14, 0.07);
  --amber-fg:   #6B3B0A;
  --amber-rule: rgba(146, 64, 14, 0.22);

  /* Typography */
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a       { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Top nav -------------------------------------------------------------- */
nav.top {
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(240, 239, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo img         { width: 20px; height: 20px; border-radius: 5px; }
.logo .crumb      { color: var(--ink-3); font-weight: 500; }
.nav-links        { display: flex; gap: 24px; align-items: center; }
.nav-links a      { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.nav-links a:hover{ text-decoration: none; color: var(--ink); }

/* --- Page layout: sidebar + main ----------------------------------------- */
.layout {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 24px 48px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}

aside {
  position: sticky;
  top: 80px;
  align-self: start;
  height: fit-content;
}
aside h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
aside ul { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
aside ul li a {
  display: block;
  padding: 7px 12px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 6px;
  font-weight: 500;
}
aside ul li a:hover    { background: var(--glass); color: var(--ink); text-decoration: none; }
aside ul li a.current  { background: var(--cobalt-dim); color: var(--cobalt); }

main { min-width: 0; }

/* --- Typography ---------------------------------------------------------- */
h1 {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}
.lede { color: var(--ink-2); font-size: 16px; margin-bottom: 32px; }
h2 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 36px 0 12px;
  padding-top: 8px;
}
h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
p  { margin-bottom: 14px; }

ul.body, ol.body            { padding-left: 22px; margin-bottom: 14px; }
ul.body li, ol.body li      { margin-bottom: 6px; }

/* --- Card grid (used on /docs landing) ----------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  display: block;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}
.card:hover    { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(13, 12, 18, 0.06); text-decoration: none; }
.card h3       { font-family: var(--mono); font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.card p        { font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* --- Code -------------------------------------------------------------- */
code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper-bright);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--glass-border);
}
pre {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--ink);
  color: #E8E6F0;
  padding: 14px 16px;
  border-radius: 8px;
  margin: 14px 0;
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }

/* --- Tabs (used on /docs/setup) ----------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 0;
  background: var(--paper-bright);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover         { color: var(--ink-2); }
.tab.active        { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.tab-panel         { display: none; margin-top: 18px; }
.tab-panel.active  { display: block; }

/* --- Tables ------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
table th, table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: top;
}
table th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table tr:last-child td { border-bottom: none; }
table code { background: transparent; padding: 0; border: none; font-size: 13px; color: var(--cobalt); }

/* --- Callouts: note (cobalt) + warn (amber) ----------------------------- */
.note {
  background: var(--paper-bright);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--cobalt);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}
.warn {
  background: var(--amber-bg);
  border: 1px solid var(--amber-rule);
  border-left: 3px solid var(--amber-fg);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--amber-fg);
  line-height: 1.6;
}

/* --- Tool reference rows (used on /docs/tools) -------------------------- */
.tool-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-border);
}
.tool-row:last-child       { border-bottom: none; }
.tool-name                 { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--cobalt); padding-top: 2px; }
.tool-desc                 { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.tool-desc strong          { color: var(--ink); font-weight: 600; }
.tool-desc em.example      { display: block; margin-top: 6px; color: var(--ink-3); font-style: italic; font-size: 13px; }

/* --- Collapsible details (used on /docs/troubleshooting + /docs/faq) ---- */
details {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 8px;
  overflow: hidden;
}
details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  float: right;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 300;
  transition: transform 0.15s;
}
details[open] summary::after { transform: rotate(45deg); }
details[open] summary        { border-bottom: 1px solid var(--glass-border); }
details .body                { padding: 14px 16px; }
details .body p:last-child   { margin-bottom: 0; }

/* --- Footer ------------------------------------------------------------- */
footer {
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--glass-border);
}
footer a       { color: var(--ink-3); }
footer a:hover { color: var(--ink); }

/* --- Mobile breakpoint -------------------------------------------------- */
@media (max-width: 760px) {
  nav.top                  { padding: 14px 20px; }
  .nav-links               { gap: 14px; }
  .layout                  { grid-template-columns: 1fr; padding: 20px 16px; gap: 24px; }
  aside                    { position: static; border-bottom: 1px solid var(--glass-border); padding-bottom: 18px; }
  aside ul                 { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .card-grid               { grid-template-columns: 1fr; }
  h1                       { font-size: 24px; }
  table                    { font-size: 13px; }
  table th, table td       { padding: 8px 6px; }
  .tool-row                { grid-template-columns: 1fr; gap: 6px; }
}
