/* ==========================================================================
   full-count documentation site
   Baseball / newsprint aesthetic: cream paper, navy ink, red stitching
   ========================================================================== */

:root {
  --bg: #f5efe0;
  --bg-soft: #ebe3cf;
  --bg-card: #fffaf0;
  --ink: #0a2540;
  --ink-soft: #2c3e50;
  --muted: #6b5f4a;
  --line: #d8cdb3;
  --red: #c8102e;
  --red-soft: #e94560;
  --gold: #d4a85a;
  --ok: #2f7d4f;
  --code-bg: #0d1b2a;
  --code-ink: #eadfbf;
  --code-muted: #9aa6b2;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino", "Georgia", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.08), 0 1px 3px rgba(10, 37, 64, 0.06);
  --shadow-md: 0 6px 18px rgba(10, 37, 64, 0.1), 0 2px 4px rgba(10, 37, 64, 0.06);
  --radius: 8px;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(200, 16, 46, 0.04), transparent 60%),
    radial-gradient(1000px 500px at -10% 30%, rgba(212, 168, 90, 0.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

a:hover {
  color: var(--ink);
  border-bottom-color: var(--red);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
  margin: 2rem 0 1rem;
}

h1 { font-size: clamp(2rem, 3.5vw, 2.9rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--muted); }

p { margin: 0 0 1rem; }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

:not(pre) > code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--ink);
  white-space: nowrap;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.6);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  white-space: pre;
}

/* Comment lines inside pre blocks (lines starting with #) — use <span class="c"> */
pre .c { color: var(--code-muted); font-style: italic; }
pre .k { color: #f6c177; }   /* keyword */
pre .s { color: #9ccfd8; }   /* string */
pre .n { color: #c4a7e7; }   /* flag */

kbd {
  display: inline-block;
  background: linear-gradient(180deg, #fffdf5 0%, #efe7cf 100%);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05em 0.45em;
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(10, 37, 64, 0.08);
  white-space: nowrap;
}

blockquote {
  margin: 1.25rem 0;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.5rem 0;
}

ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }

table {
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  width: 100%;
  font-size: 0.95rem;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--bg-soft);
  font-family: var(--font-display);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}
tbody tr:hover { background: rgba(200, 16, 46, 0.04); }

/* ---------- Site chrome ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 239, 224, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  border: none;
}
.brand:hover { color: var(--red); }
.brand__dot {
  color: var(--red);
  margin-right: 0.1rem;
}
.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 1.1rem;
  margin-left: auto;
  align-items: center;
  font-size: 0.95rem;
}
.nav a {
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  font-weight: 500;
}
.nav a:hover { color: var(--red); border-bottom-color: var(--red); }
.nav a.active { color: var(--red); border-bottom-color: var(--red); }

.nav a.nav__gh {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--ink);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.nav a.nav__gh svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.nav a.nav__gh:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--ink-soft); }

/* ---------- Landing page ---------- */

.hero {
  padding: 4rem 1.25rem 3rem;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.hero__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.25);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
}

.hero h1 em {
  font-style: italic;
  color: var(--red);
}

.hero__lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin-bottom: 1.75rem;
}

.hero__cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translateY(-1px); border-bottom-color: transparent; }

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--red); color: var(--bg); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--bg); }

.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.hero__meta span::before {
  content: "●";
  color: var(--gold);
  margin-right: 0.4rem;
}

.hero__art {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1.5rem 1.25rem;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-x: auto;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.5);
}
.hero__art::before {
  content: "● ● ●";
  position: absolute;
  top: 10px;
  left: 14px;
  color: #556274;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
}
.hero__art pre {
  background: none;
  padding: 1.2rem 0 0;
  box-shadow: none;
  border: none;
  color: inherit;
  font-size: inherit;
}

/* Simple fake scoreboard used in hero */
.scorebug {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(212, 168, 90, 0.3);
  display: grid;
  grid-template-columns: auto repeat(9, 1fr) auto auto auto;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--code-ink);
}
.scorebug .label { color: var(--gold); font-weight: 700; }
.scorebug .row-team { color: #eadfbf; }
.scorebug .tot { color: #fff; font-weight: 700; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.5rem;
  border: 0;
}

.section__headline {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 1.5rem;
  letter-spacing: -0.015em;
  max-width: 32rem;
}

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

.feature {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.feature__icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Key-reference grid used on scoring pages */
.keygrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin: 1.25rem 0 2rem;
}
.keygrid__item {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
}
.keygrid__item kbd { min-width: 2.1rem; text-align: center; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.callout {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.callout__mark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--red);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.callout--tip .callout__mark { background: var(--ok); }
.callout--note .callout__mark { background: var(--gold); color: var(--ink); }
.callout p:last-child { margin-bottom: 0; }

.bigcta {
  margin: 3rem auto 1rem;
  max-width: var(--max);
  padding: 2.25rem 2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ink) 0%, #112d4e 100%);
  color: var(--bg);
  display: grid;
  grid-template-columns: 1.1fr auto;
  align-items: center;
  gap: 2rem;
}
.bigcta h2 { color: var(--bg); border: none; margin: 0 0 0.4rem; font-size: 1.6rem; }
.bigcta p { margin: 0; opacity: 0.85; }
.bigcta a { color: var(--bg); }

/* ---------- Docs / guide layout ---------- */

.docs {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 4.5rem;
  font-size: 0.95rem;
  padding-right: 0.5rem;
  border-right: 1px solid var(--line);
}

.sidebar__group {
  margin-bottom: 1.25rem;
}

.sidebar__heading {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 0.45rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: 0.3rem 0.55rem;
  border-radius: 5px;
  border: none;
  color: var(--ink-soft);
}
.sidebar a:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-bottom: none;
}
.sidebar a.active {
  background: var(--red);
  color: var(--bg);
  font-weight: 600;
}

.content { min-width: 0; }

.content h1:first-child { margin-top: 0; }

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--red); }

.pager {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.pager a {
  flex: 1;
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--bg-card);
  transition: border-color 120ms ease, transform 120ms ease;
}
.pager a:hover {
  border-color: var(--red);
  border-bottom-color: var(--red);
  transform: translateY(-1px);
}
.pager__dir {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.15rem;
}
.pager__next { text-align: right; }

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.25rem 1.5rem;
  }
  .two-col { grid-template-columns: 1fr; gap: 1rem; }
  .bigcta { grid-template-columns: 1fr; gap: 1rem; text-align: center; }

  .docs {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .sidebar {
    position: static;
    border-right: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    background: var(--bg-card);
  }

  .nav a.nav__gh { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
  .nav a.nav__gh svg { width: 13px; height: 13px; }
  .nav { gap: 0.7rem; font-size: 0.9rem; }
}
