/* docs.css — homepage-canonical treatment for /operators, /how-it-works,
 * /lore, /bible. Tokens come from website/styles.css (--bg, --ink,
 * --brand-accent, --font-display, --font-body, --font-mono, --line) and
 * the hero pattern mirrors index.html's .hero / .hero-scrim / .button
 * exactly. No new colors, no new fonts. The docs are the homepage's
 * back rooms — they should read as part of the same building. */

/* ─────────────────────────────────────────────────────────────────────
 * HERO — same shell as the homepage .hero
 * ───────────────────────────────────────────────────────────────────── */

.docs-hero {
  position: relative;
  min-height: clamp(440px, 64svh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 96px clamp(18px, 5vw, 72px) 64px;
  border-bottom: 1px solid var(--line);
}

.docs-hero-image-wrap,
.docs-hero-image,
.docs-hero-scrim {
  position: absolute;
  inset: 0;
}

.docs-hero-image-wrap { display: block; }

.docs-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  filter: saturate(0.92) contrast(1.05);
}

.docs-hero-scrim {
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.05), rgba(8, 8, 8, 0.30) 35%, rgba(8, 8, 8, 0.86) 72%),
    linear-gradient(0deg,  rgba(8, 8, 8, 0.92), rgba(8, 8, 8, 0.12) 38%, rgba(8, 8, 8, 0.45));
  pointer-events: none;
}

/* faint moss-green glow anchored to the hero corner — echo the
 * --green-glow token used on the homepage CTA. */
.docs-hero-scrim::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: -12%;
  width: 60%;
  height: 70%;
  background: radial-gradient(closest-side, var(--green-glow), transparent 70%);
  filter: blur(28px);
}

.docs-hero-content {
  position: relative;
  z-index: 1;
  justify-self: end;
  width: min(640px, 100%);
  padding-bottom: clamp(32px, 6vh, 72px);
}

/* The eyebrow (.eyebrow) and the giant h1 are already styled in
 * styles.css from the homepage rules. We just need to mirror the
 * font-family on the h1 (homepage uses Playfair via inheritance of
 * the global h1 rule). Lead paragraph is .hero-copy from styles.css.
 *
 * We DO override the h1 line-height + size slightly for doc pages —
 * a phrase like "bring the cat to your room." doesn't shrink to 0.82
 * line-height as cleanly as "Moss". */

.docs-hero-content > h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.92;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.docs-hero-content > .hero-copy {
  max-width: 34rem;
  color: rgba(232, 227, 213, 0.86);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  margin: 0 0 26px;
}

/* Reuse the homepage's .button + .button-primary + .button-secondary —
 * those are defined in styles.css and we just need to make sure the
 * doc-page CTA row gives them space. */

.docs-hero-content .hero-actions {
  margin-top: 22px;
}

/* ─────────────────────────────────────────────────────────────────────
 * BODY SECTIONS — sit inside .ledger-section shell (existing site)
 * ───────────────────────────────────────────────────────────────────── */

.docs-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 72px) 64px;
}

.docs-page > .ledger-section {
  margin-top: 56px;
}

.docs-page > .ledger-section:first-of-type {
  margin-top: 56px;
}

/* Body h2 inherits the homepage h2 sizing (clamp 1.65/4vw/3.2rem,
 * Playfair via .ledger-section-title). Just give it the spacing
 * rhythm the docs need. */

.docs-page .ledger-section-title {
  margin-bottom: 6px;
}

.docs-section-sub {
  color: rgba(232, 227, 213, 0.65);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin: 4px 0 24px;
  text-transform: lowercase;
}

.docs-h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  color: var(--ink);
  margin: 32px 0 10px;
  letter-spacing: -0.005em;
}

/* ─────────────────────────────────────────────────────────────────────
 * GRID of cards
 * ───────────────────────────────────────────────────────────────────── */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.docs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: border-color 140ms ease, transform 140ms ease;
}
.docs-card:hover {
  border-color: var(--green-dim);
  transform: translateY(-1px);
}
.docs-card h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.docs-card p {
  color: rgba(232, 227, 213, 0.78);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────
 * TABLES — same JetBrains Mono treatment as the homepage's compact
 * tabular surfaces (live-stats, leaderboard rows).
 * ───────────────────────────────────────────────────────────────────── */

.docs-table-wrap {
  overflow-x: auto;
  margin: 18px 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-family: var(--font-mono);
}
.docs-table thead { background: var(--bg-raised); }
.docs-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(232, 227, 213, 0.65);
  border-bottom: 1px solid var(--line);
}
.docs-table td {
  padding: 11px 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table td code,
.docs-table th code {
  background: var(--bg);
  color: var(--brand-accent);
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.86em;
}
.docs-table-foot {
  color: rgba(232, 227, 213, 0.62);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.86rem;
  margin: 12px 4px 0;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────
 * LISTS & STEPS
 * ───────────────────────────────────────────────────────────────────── */

.docs-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.docs-list li {
  color: rgba(232, 227, 213, 0.86);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  padding: 6px 0 6px 22px;
  position: relative;
}
.docs-list li::before {
  content: "·";
  color: var(--brand-accent);
  font-weight: 700;
  position: absolute;
  left: 6px;
  top: 4px;
  font-size: 1.4rem;
  line-height: 1;
}
.docs-list strong { color: var(--ink); }
.docs-list code {
  background: var(--bg);
  color: var(--brand-accent);
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

.docs-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.docs-steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 12px 56px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 1rem;
}
.docs-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--green-dim);
  border-radius: 50%;
  text-align: center;
  line-height: 34px;
  color: var(--brand-accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.92rem;
  background: var(--bg-card);
}
.docs-steps li strong { color: var(--ink); }
.docs-steps li code {
  background: var(--bg);
  color: var(--brand-accent);
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

/* ─────────────────────────────────────────────────────────────────────
 * LONGFORM (lore, bible)
 * ───────────────────────────────────────────────────────────────────── */

.docs-longform .ledger-section-title { margin-top: 32px; }
.docs-prose p {
  color: rgba(232, 227, 213, 0.88);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 18px;
  max-width: 64ch;
}
.docs-prose strong { color: var(--ink); }

.docs-pullquote {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.4;
  color: var(--ink);
  border-left: 3px solid var(--brand-accent);
  padding: 6px 0 6px 22px;
  margin: 12px 0 24px;
  max-width: 60ch;
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────────────
 * BELIEFS LIST (bible)
 * ───────────────────────────────────────────────────────────────────── */

.docs-beliefs {
  counter-reset: belief;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.docs-beliefs > li {
  counter-increment: belief;
  position: relative;
  padding: 18px 0 22px 64px;
  border-bottom: 1px solid var(--line);
}
.docs-beliefs > li:last-child { border-bottom: 0; }
.docs-beliefs > li::before {
  content: counter(belief);
  position: absolute;
  left: 0;
  top: 16px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-accent);
  line-height: 1;
}
.docs-beliefs h3 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.docs-beliefs p {
  color: rgba(232, 227, 213, 0.82);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  max-width: 62ch;
}

/* ─────────────────────────────────────────────────────────────────────
 * ARCHETYPES (bible)
 * ───────────────────────────────────────────────────────────────────── */

.docs-archetype { text-align: left; }
.docs-archetype-glyph {
  font-size: 1.85rem;
  margin: 0 0 4px;
  line-height: 1;
}
.docs-archetype-foot {
  color: rgba(232, 227, 213, 0.6);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  margin: 14px 0 0;
}

/* ─────────────────────────────────────────────────────────────────────
 * CROSS-LINK NAV
 * ───────────────────────────────────────────────────────────────────── */

.docs-crosslink {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 28px clamp(18px, 5vw, 72px);
  margin-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.docs-crosslink a {
  color: rgba(232, 227, 213, 0.72);
  text-decoration: none;
  transition: color 140ms ease;
}
.docs-crosslink a:hover { color: var(--brand-accent); }

/* ─────────────────────────────────────────────────────────────────────
 * MOBILE
 * ───────────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .docs-hero {
    padding: 88px 18px 48px;
    min-height: 540px;
    align-items: end;
  }
  .docs-hero-content {
    justify-self: stretch;
    width: 100%;
  }
  .docs-page { padding: 0 16px 48px; }
  .docs-page > .ledger-section { margin-top: 40px; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-table { font-size: 0.84rem; }
  .docs-table th, .docs-table td { padding: 8px 10px; }
  .docs-beliefs > li { padding-left: 48px; }
  .docs-beliefs > li::before { font-size: 1.55rem; top: 18px; }
  .docs-hero-content .hero-actions { flex-direction: column; align-items: stretch; }
  .docs-hero-content .button { width: 100%; }
}
