/* ───────────────────────────────────────────────────────────────
   Hundy — document pages (privacy, terms, FAQ)
   Tokens mirror hundy/index.html, which mirrors src/theme/tokens.ts.
   Dark-only, like the app and the landing page.

   Used automatically by tools/build_docs.py because this file exists
   at hundy/assets/docs.css. See tools/README.md.
   ─────────────────────────────────────────────────────────────── */

:root {
  --ink-900: #07090B; --ink-800: #0B0E12; --ink-700: #12161C;
  --ink-600: #191F26; --ink-500: #232B34; --ink-400: #323C48;
  --text: #F4F7FA; --text-muted: #A6B1BD; --text-faint: #6C7885;
  --energy: #C9FF3C; --energy-dim: #8FB82A;
  --energy-soft: rgba(201, 255, 60, .14);
  --energy-muted: rgba(201, 255, 60, .34);
  --danger: #FF6B6B;
  --hairline: rgba(244, 247, 250, .08);
  --hairline-strong: rgba(244, 247, 250, .14);
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --shell: min(1180px, 100% - 3rem);
  --reading: min(46rem, 100% - 3rem);
  --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.shell { width: var(--shell); margin-inline: auto; }

::selection { background: var(--energy); color: var(--ink-900); }

:focus-visible {
  outline: 2px solid var(--energy);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Nav ─────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 9, 11, .72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -.02em;
  margin-right: auto;
}

.brand svg { width: 34px; height: auto; flex: none; }

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: .95rem;
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-links a[aria-current="page"] { color: var(--energy); }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 1.05rem 1.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: -.01em;
  transition: transform .18s, background .2s, border-color .2s, color .2s;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--energy); color: var(--ink-900); }
.btn-primary:hover { background: var(--energy-dim); }

.btn-ghost,
.btn-secondary {
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover,
.btn-secondary:hover { border-color: var(--energy-muted); color: var(--energy); }
.btn-sm { padding: .72rem 1.35rem; font-size: .9rem; }

/* ── Document page ───────────────────────────────────────────── */

.doc-main { padding: 4rem 0 5rem; }
.doc { width: var(--reading); margin-inline: auto; }

.doc-breadcrumb {
  margin: 0 0 1.5rem;
  font-size: .84rem;
  color: var(--text-faint);
}

.doc-breadcrumb a { color: var(--text-faint); text-decoration: none; transition: color .2s; }
.doc-breadcrumb a:hover { color: var(--energy); }
.doc-breadcrumb span { opacity: .45; margin: 0 .4rem; }

.eyebrow {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--energy);
  padding: .34rem .7rem;
  border-radius: 999px;
  background: var(--energy-soft);
  border: 1px solid var(--energy-muted);
}

.doc h1 {
  margin: 1.1rem 0 .6rem;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 800;
}

.doc-dates { margin: 0; font-size: .9rem; color: var(--text-faint); }

.doc-rule {
  margin: 2.2rem 0 2.6rem;
  border: 0;
  border-top: 1px solid var(--hairline);
}

/* ── Rendered markdown ───────────────────────────────────────── */

.doc-body { font-size: 1.02rem; line-height: 1.75; }

.doc-body h2 {
  margin: 3rem 0 .9rem;
  font-size: 1.5rem;
  line-height: 1.24;
  letter-spacing: -.02em;
  font-weight: 700;
  scroll-margin-top: 90px;
}

.doc-body h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--energy);
  margin-bottom: .95rem;
}

.doc-body h3 {
  margin: 2.2rem 0 .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}

.doc-body h4 { margin: 1.6rem 0 .5rem; font-size: 1rem; font-weight: 700; }

.doc-body p { margin: 0 0 1.1rem; color: var(--text-muted); }
.doc-body strong { color: var(--text); font-weight: 700; }
.doc-body em { color: var(--text-muted); }

.doc-body ul,
.doc-body ol {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
  color: var(--text-muted);
}

.doc-body li { margin-bottom: .55rem; }
.doc-body li::marker { color: var(--energy); }

.doc-body a {
  color: var(--energy);
  text-decoration: none;
  border-bottom: 1px solid var(--energy-muted);
  transition: border-color .2s, color .2s;
  overflow-wrap: anywhere;
}

.doc-body a:hover { border-bottom-color: var(--energy); }

.doc-body code {
  font-family: var(--mono);
  font-size: .88em;
  padding: .14em .4em;
  border-radius: 6px;
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  color: var(--text);
}

.doc-body blockquote {
  margin: 0 0 1.2rem;
  padding: .3rem 0 .3rem 1.15rem;
  border-left: 3px solid var(--energy);
  color: var(--text-muted);
}

.doc-body hr { margin: 2.6rem 0; border: 0; border-top: 1px solid var(--hairline); }

/* ── Tables ──────────────────────────────────────────────────── */

.doc-table-wrap {
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--ink-800);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  min-width: 520px;
}

.doc-table th,
.doc-table td {
  padding: .78rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}

.doc-table th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.doc-table td { color: var(--text-muted); }
.doc-table tbody tr:last-child td { border-bottom: 0; }

/* ── Contact panel and sibling nav ───────────────────────────── */

.doc-contact {
  margin-top: 3.2rem;
  padding: 1.6rem 1.7rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
}

.doc-contact h2 {
  margin: 0 0 .55rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.doc-contact p { margin: 0; color: var(--text-muted); font-size: .95rem; }

.doc-contact a {
  color: var(--energy);
  text-decoration: none;
  border-bottom: 1px solid var(--energy-muted);
  overflow-wrap: anywhere;
}

.doc-siblings {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

/* ── Document index cards ────────────────────────────────────── */

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.doc-card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 1.4rem;
  background: var(--ink-800);
  transition: border-color .2s;
}

.doc-card:hover { border-color: var(--energy-muted); }
.doc-card h3 { margin: .4rem 0 .5rem; font-size: 1.1rem; font-weight: 700; }
.doc-card h3 a { color: var(--text); text-decoration: none; }
.doc-card h3 a:hover { color: var(--energy); }
.doc-card p { margin: 0 0 .6rem; color: var(--text-muted); font-size: .92rem; }
.doc-card .card-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint); margin: 0;
}

.doc-card-raw a {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline-strong);
}

.doc-card-raw a:hover { color: var(--energy); }
.doc-card-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.lead { color: var(--text-muted); font-size: 1.05rem; max-width: 52ch; }

/* ── Footer ──────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--hairline);
  background: var(--ink-800);
  padding: 3.5rem 0 2.5rem;
}

.foot-in {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
}

.foot h4 {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1rem;
}

.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.foot a { text-decoration: none; color: var(--text-muted); font-size: .92rem; transition: color .2s; }
.foot a:hover { color: var(--energy); }
.foot .blurb { color: var(--text-faint); font-size: .88rem; max-width: 34ch; margin-top: 1rem; }

.foot-btm {
  border-top: 1px solid var(--hairline);
  margin-top: 3rem;
  padding-top: 1.75rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .83rem;
  color: var(--text-faint);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 860px) {
  :root { --shell: min(1180px, 100% - 2rem); --reading: min(46rem, 100% - 2rem); }
  .nav-links { display: none; }
  .doc-main { padding: 2.6rem 0 3.4rem; }
  .doc-body h2 { margin-top: 2.4rem; font-size: 1.34rem; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .doc-table { min-width: 440px; }
}

@media (max-width: 520px) {
  .foot-in { grid-template-columns: 1fr; }
  .foot-btm { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
