/* docs.css — styling for the DumpDraft documentation pages.
   Brand-consistent with the app (same colors, fonts, teal accent, dark mode),
   but a normal scrolling document layout instead of the app shell.
   Designed to be calm and readable: generous spacing, strong contrast,
   large tap targets, reduced-motion friendly — the same accessibility ethos
   the app itself is built around. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #1a1c1e;
  --text-dim: #5f6368;
  --accent: #0f766e;
  --accent-2: #115e59;
  --bubble: #d7f2ee;
  --bubble-text: #0b3b37;
  --border: #e2e5e9;
  --danger: #b42318;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 6px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --surface: #1f2226;
    --surface-2: #23262b;
    --text: #e6e8ea;
    --text-dim: #9aa0a6;
    --accent: #2dd4bf;
    --accent-2: #14b8a6;
    --bubble: #0f3d38;
    --bubble-text: #d7f2ee;
    --border: #2c3036;
    --danger: #f97066;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-lg: 0 6px 24px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

/* Honor reduced motion (OS-level) — the docs mirror the app's sensory-calm stance. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Skip link for keyboard/AT users */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 20;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* ---------- Top bar ---------- */
.doc-topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 14px;
}
.doc-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.05rem;
  white-space: nowrap;
}
.doc-brand .logo { font-size: 1.3rem; }
.doc-topbar .spacer { flex: 1; }
.doc-applink {
  text-decoration: none; font-weight: 600; color: #fff; background: var(--accent);
  padding: 8px 14px; border-radius: 999px; white-space: nowrap; min-height: 40px;
  display: inline-flex; align-items: center;
}
.doc-applink:hover { background: var(--accent-2); }

/* ---------- Section nav (horizontal, scrollable on mobile) ---------- */
.doc-nav {
  border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 57px; z-index: 9;
}
.doc-nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; gap: 4px; overflow-x: auto; padding: 6px max(16px, env(safe-area-inset-left));
  scrollbar-width: none;
}
.doc-nav-inner::-webkit-scrollbar { display: none; }
.doc-nav a {
  text-decoration: none; color: var(--text-dim); font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.doc-nav a:hover { background: var(--surface-2); color: var(--text); }
.doc-nav a[aria-current="page"] { color: var(--accent); background: var(--bubble); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)) 80px; }

.hero { padding: 20px 0 8px; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; margin: 0 0 8px; }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.6rem); margin: 40px 0 12px; line-height: 1.25; scroll-margin-top: 120px; }
h3 { font-size: 1.15rem; margin: 26px 0 8px; }
p { margin: 0 0 16px; }
.lead { font-size: 1.15rem; color: var(--text-dim); }
ul, ol { margin: 0 0 16px; padding-left: 1.3em; }
li { margin: 6px 0; }
strong { font-weight: 700; }
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  background: var(--surface-2); padding: .12em .4em; border-radius: 5px; font-size: .9em;
}

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow); margin: 0 0 16px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 8px 0 20px; }
.card h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.card .emoji { font-size: 1.4rem; }
.card p:last-child { margin-bottom: 0; }

/* Big link cards (docs hub) */
a.linkcard {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
a.linkcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
a.linkcard h3 { margin: 0 0 6px; color: var(--text); }
a.linkcard p { margin: 0; color: var(--text-dim); }
a.linkcard .arrow { color: var(--accent); font-weight: 700; }

/* ---------- Callouts ---------- */
.callout {
  border-left: 4px solid var(--accent); background: var(--bubble); color: var(--bubble-text);
  padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 18px 0;
}
.callout.note { border-color: var(--accent); }
.callout.important { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout strong { display: inline; }

/* ---------- Pills / tags ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: .9rem; font-weight: 600; color: var(--text-dim); }

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 20px; }
.steps > li {
  counter-increment: step; position: relative; padding: 4px 0 18px 52px; margin: 0;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: var(--shadow);
}
.steps > li strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }

/* ---------- TOC ---------- */
.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 8px 0 28px; }
.toc strong { display: block; margin-bottom: 6px; font-size: .9rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.toc ul { margin: 0; padding-left: 1.1em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 460px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* ---------- Footer ---------- */
.doc-footer { border-top: 1px solid var(--border); background: var(--surface); }
.doc-footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)); color: var(--text-dim); font-size: .92rem; }
.doc-footer a { font-weight: 600; }
.doc-footer .cta {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; color: #fff;
  background: var(--accent); padding: 12px 20px; border-radius: 999px; margin: 6px 0 18px;
}
.doc-footer .cta:hover { background: var(--accent-2); }
.doc-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; }

/* Prev/next */
.prevnext { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.prevnext a {
  flex: 1 1 220px; text-decoration: none; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; background: var(--surface); color: inherit; box-shadow: var(--shadow);
}
.prevnext a:hover { border-color: var(--accent); }
.prevnext .dir { color: var(--text-dim); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.prevnext .ttl { color: var(--accent); font-weight: 700; }
.prevnext a.next { text-align: right; }

.muted { color: var(--text-dim); }
.center { text-align: center; }
