/* eggrd docs — the landing page's blueprint world, adjusted for reading.
 *
 * The site itself is a drafting sheet: full-bleed section drawing, hairline grid, callouts.
 * That is right for something you scroll once and wrong for something you scan for a key
 * name at 2am. These pages keep the palette, the type and the hairline rules, and drop the
 * drawing: one measured column, a sticky index, and tables that stay legible when a
 * description runs long.
 *
 * Tokens are copied from site/index.html rather than imported, so the docs render correctly
 * even if the landing page is being rewritten. */

:root {
  --ink: #0b2038;
  --ground: #12304f;
  --ground-hi: #17436f;
  --line: #8fb5d8;
  --line-soft: #4d7ba6;
  --hair: rgba(143, 181, 216, 0.22);
  --paper: #eaf2fa;
  --paper-dim: #a9c6e0;
  --red: #f0796a;
  --green: #5fbf7f;
  --sans: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tech: "Saira Condensed", "Saira", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1240px;
  --side: 232px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.4rem; }

.skip {
  position: absolute; left: -9999px;
  background: var(--paper); color: var(--ink);
  padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ── header ─────────────────────────────────────────────────────────────── */
.top {
  border-bottom: 1px solid var(--hair);
  background: var(--ink);
  position: sticky; top: 0; z-index: 20;
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 1rem; }
.brand {
  font-family: var(--tech);
  font-size: 1.24rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--paper); text-decoration: none; white-space: nowrap;
}
.brand b { font-weight: 700; }
.crumb { color: var(--line-soft); margin-left: .5rem; font-weight: 400; }
.topnav { display: flex; gap: 1.3rem; font-family: var(--tech); text-transform: uppercase;
          letter-spacing: .06em; font-size: .86rem; }
.topnav a { color: var(--paper-dim); text-decoration: none; }
.topnav a:hover, .topnav a:focus-visible { color: var(--paper); }

/* ── shell ──────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 2.6rem; padding-top: 2rem; padding-bottom: 4rem; }

.side { position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; }
.side-h {
  font-family: var(--tech); text-transform: uppercase; letter-spacing: .12em;
  font-size: .74rem; color: var(--line-soft);
  margin: 1.3rem 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--hair);
}
.side-h:first-child { margin-top: 0; }
.side a {
  display: block; color: var(--paper-dim); text-decoration: none;
  padding: .26rem 0 .26rem .6rem; border-left: 2px solid transparent; font-size: .93rem;
}
.side a:hover { color: var(--paper); border-left-color: var(--line-soft); }
.side a[aria-current="page"] { color: var(--paper); border-left-color: var(--red); }
.side-tables a { font-size: .86rem; }
.side-tables code { font-family: var(--mono); font-size: .82rem; background: none; padding: 0; color: inherit; }

/* ── content ────────────────────────────────────────────────────────────── */
main { min-width: 0; }

h1 {
  font-family: var(--tech); font-weight: 700; text-transform: uppercase;
  letter-spacing: .02em; font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 .7rem; line-height: 1.08;
}
h2 {
  font-family: var(--tech); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; font-size: 1.28rem;
  margin: 2.6rem 0 .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--hair);
}
h3 { font-family: var(--tech); font-weight: 600; font-size: 1.06rem; letter-spacing: .03em; margin: 1.8rem 0 .4rem; }

p { margin: .7rem 0; }
.lede { font-size: 1.06rem; color: var(--paper); max-width: 68ch; }
.blurb { color: var(--paper-dim); margin: .2rem 0 .8rem; max-width: 74ch; }
.note, .warn, .foot-note {
  border-left: 2px solid var(--line-soft); padding: .5rem 0 .5rem .9rem;
  color: var(--paper-dim); max-width: 74ch; margin: 1.1rem 0;
}
.warn { border-left-color: var(--red); }
.foot-note { margin-top: 3rem; font-size: .9rem; }

a { color: var(--line); }
a:hover { color: var(--paper); }

code {
  font-family: var(--mono); font-size: .875em;
  background: var(--ground); padding: .08em .34em; border-radius: 2px;
  color: var(--paper); overflow-wrap: anywhere;
}
pre {
  background: var(--ground); border: 1px solid var(--hair); border-radius: 3px;
  padding: 1rem 1.1rem; overflow-x: auto; font-family: var(--mono);
  font-size: .875rem; line-height: 1.55; margin: 1rem 0;
}
pre code { background: none; padding: 0; }
pre .c { color: var(--line-soft); }
pre .p { color: var(--red); }
pre .ok { color: var(--green); }

ul, ol { padding-left: 1.2rem; max-width: 74ch; }
li { margin: .3rem 0; }

/* ── tables ─────────────────────────────────────────────────────────────── */
.tbl { scroll-margin-top: 78px; }
.scroll { overflow-x: auto; border: 1px solid var(--hair); border-radius: 3px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 720px; }
thead th {
  font-family: var(--tech); text-transform: uppercase; letter-spacing: .08em;
  font-size: .76rem; color: var(--line-soft); text-align: left;
  padding: .6rem .8rem; border-bottom: 1px solid var(--hair); background: var(--ground);
  position: sticky; top: 0;
}
tbody td { padding: .58rem .8rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(143, 181, 216, 0.05); }
td.k { white-space: nowrap; }
td.t { color: var(--paper-dim); white-space: nowrap; font-size: .86rem; }
td.d { white-space: nowrap; }
td.n { min-width: 30ch; }
.none { color: var(--line-soft); }

/* ── cards on the docs index ────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.card {
  border: 1px solid var(--hair); border-radius: 3px; padding: 1.1rem 1.2rem;
  text-decoration: none; color: inherit; display: block; background: rgba(18, 48, 79, .4);
}
.card:hover { border-color: var(--line-soft); background: var(--ground); }
.card h3 { margin: 0 0 .3rem; color: var(--paper); }
.card p { margin: 0; color: var(--paper-dim); font-size: .93rem; }

/* ── footer ─────────────────────────────────────────────────────────────── */
.bot { border-top: 1px solid var(--hair); padding: 1.4rem 0; font-size: .88rem; color: var(--paper-dim); }
.bot-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bot a { color: var(--line); text-decoration: none; }

/* ── narrow ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 1.4rem; }
  .side {
    position: static; max-height: none; overflow: visible;
    border-bottom: 1px solid var(--hair); padding-bottom: 1rem;
  }
  .side-tables { display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
  .side-tables a { padding-left: 0; border-left: none; }
  .side-tables a:hover { border-left: none; }
}
