/* ==========================================================================
   zzop documentation site — shared design system
   Plain CSS, no build step. Dark theme only (fixed, no toggle).
   ========================================================================== */

:root {
  /* --- surfaces --- */
  --bg: #0f1115;
  --bg-alt: #171a20;
  --bg-deep: #0a0b0e;
  --bg-raised: #1e222b;

  /* --- borders --- */
  --border: #262b35;
  --border-subtle: #1a1d24;
  --input-border: #3a4150;

  /* --- text --- */
  --text: #e8eaed;
  --text-secondary: #a7adba;
  --text-muted: #6b7280;
  --text-on-accent: #06281d;

  /* --- accent (mint) --- */
  --accent: #34d399;
  --accent-hover: #5eead4;
  --accent-soft-bg: #113325;
  --accent-soft-border: #1a4a35;

  /* --- type --- */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;

  /* --- layout widths --- */
  --width-header: 1152px;
  --width-hero: 1280px;
  --width-docs: 1320px;

  /* --- misc --- */
  --header-height: 56px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent-soft-bg);
  color: var(--text);
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

button {
  font: inherit;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(15, 17, 21, 0.86);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--width-header);
  height: 100%;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand__wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 24px;
  flex: 1;
}

.site-nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.site-nav__link:hover {
  color: var(--text);
}

.site-nav__link.is-active {
  font-weight: 600;
  color: var(--accent);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: #232833;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding-inline: 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 4px 14px -4px rgba(52, 211, 153, 0.25);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--outline-accent {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn--outline-accent:hover {
  background: var(--accent-soft-bg);
}

.btn--outline {
  background: transparent;
  border-color: var(--input-border);
  color: var(--text);
}

.btn--outline:hover {
  background: #232833;
}

/* --------------------------------------------------------------------------
   Eyebrow / kicker label
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.eyebrow--sm {
  font-size: 0.75rem;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Hero (editorial variant)
   -------------------------------------------------------------------------- */

.hero {
  padding: 136px 24px 88px;
  max-width: var(--width-hero);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: start;
}

.hero__title {
  margin: 0 0 24px;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text);
  font-family: var(--font-mono);
}

.hero__lead {
  margin: 0 0 40px;
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
}

.hero__code {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Stat band / chips
   -------------------------------------------------------------------------- */

.stat-band {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 24px;
}

.stat-band__inner {
  max-width: var(--width-hero);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
}

.stat-chip {
  padding-right: 48px;
  border-right: 1px solid var(--border);
  margin-right: 48px;
  display: flex;
  align-items: baseline;
}

.stat-chip:last-child {
  padding-right: 0;
  border-right: none;
  margin-right: 0;
}

.stat-chip__value {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
}

.stat-chip__label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 10px;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  padding: 100px 24px;
}

.section--alt {
  background: var(--bg-alt);
}

.section__inner {
  max-width: 900px;
  margin-inline: auto;
}

.section__inner--wide {
  max-width: 1000px;
}

.section__inner--narrow {
  max-width: 820px;
}

.section-title {
  margin: 0 0 48px;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

.section-title--tight {
  margin-bottom: 32px;
}

/* prominent prose block ("Why zzop") */

.prose-block {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 760px;
}

.prose-block strong {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Card grid
   -------------------------------------------------------------------------- */

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

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */

.cta-band {
  background: var(--accent-soft-bg);
  border-top: 1px solid var(--accent-soft-border);
  border-bottom: 1px solid var(--accent-soft-border);
  padding: 64px 24px;
}

.cta-band__inner {
  max-width: var(--width-hero);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta-band__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.cta-band__lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Doc link rows (end-of-page "explore the docs")
   -------------------------------------------------------------------------- */

.link-rows {
  display: flex;
  flex-direction: column;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 8px;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
}

.link-rows > .link-row:last-child {
  border-bottom: 1px solid var(--border);
}

.link-row:hover {
  background: var(--bg-alt);
}

.link-row h3 {
  margin: 0 0 6px;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
}

.link-row p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.link-row__arrow {
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Code blocks / panels
   -------------------------------------------------------------------------- */

.code-panel {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-deep);
}

.hero__code .code-panel {
  box-shadow: 0 18px 32px -16px rgba(0, 0, 0, 0.55);
}

.code-panel__tab {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.code-block {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.hero__code .code-block {
  padding: 20px;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre;
}

/* inline code, everywhere */

code {
  font-family: var(--font-mono);
}

.docs-content code,
.prose-block code,
p code {
  background: var(--bg-raised);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.code-block code,
h1 code,
h2 code,
h3 code {
  background: none;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.site-footer__inner {
  max-width: var(--width-header);
  margin-inline: auto;
  padding: 32px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.site-footer__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-secondary);
}

.site-footer__gh {
  color: var(--text-muted);
  text-decoration: underline;
}

.site-footer__gh:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   3-column docs layout
   -------------------------------------------------------------------------- */

.docs-layout {
  max-width: var(--width-docs);
  margin-inline: auto;
  padding: 40px 24px 120px;
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(320px, 1fr) minmax(150px, 220px);
  gap: 32px;
  align-items: start;
}

.docs-nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

/* left: cross-page nav */

.docs-nav {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.docs-nav__group {
  margin-bottom: 24px;
  padding: 0 2px;
}

.docs-nav__group--current {
  background: var(--accent-soft-bg);
  border: 1px solid var(--accent-soft-border);
  border-radius: 10px;
  padding: 14px 16px;
}

.docs-nav__group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.docs-nav__group--current .docs-nav__group-label {
  color: var(--accent);
}

.docs-nav__link {
  display: block;
  padding: 5px 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.docs-nav__link:hover {
  color: var(--text);
}

.docs-nav__link.is-active {
  color: var(--accent);
  font-weight: 600;
}

.docs-nav__group--current .docs-nav__link {
  color: #dfe2e8;
}

.docs-nav__group--current .docs-nav__link:hover {
  color: #ffffff;
}

/* center: article content */

.docs-content {
  min-width: 0;
}

.docs-content-header {
  margin-bottom: 48px;
}

.docs-content-header .eyebrow {
  margin-bottom: 12px;
}

.docs-content-header h1 {
  margin: 0 0 12px;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.docs-content-header p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
}

.docs-content section {
  scroll-margin-top: 80px;
  margin-bottom: 64px;
}

.docs-content section:last-child {
  margin-bottom: 0;
}

.docs-content h2 {
  margin: 0 0 20px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.docs-content h3 {
  margin: 32px 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.docs-content p {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.docs-content p:last-child {
  margin-bottom: 0;
}

.docs-content ul,
.docs-content ol {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.docs-content li {
  padding-left: 20px;
  position: relative;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.875rem;
}

.docs-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.docs-content li strong {
  color: var(--text);
}

.docs-content blockquote {
  margin: 0 0 20px;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* tables: horizontal-scroll wrapper, body never scrolls */

.table-scroll {
  overflow-x: auto;
  margin-bottom: 20px;
}

.docs-content table {
  border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  min-width: 560px;
}

.docs-content th {
  padding: 8px 12px 8px 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

/* click-to-sort headers (behavior in docs.js) */
.docs-content th.is-sortable {
  cursor: pointer;
  user-select: none;
}

.docs-content th.is-sortable:hover {
  color: var(--text-secondary);
}

.docs-content th.is-sortable::after {
  content: "\2195"; /* up-down: unsorted */
  margin-left: 0.4em;
  opacity: 0.4;
  font-size: 0.9em;
}

.docs-content th[aria-sort="ascending"],
.docs-content th[aria-sort="descending"] {
  color: var(--accent);
}

.docs-content th[aria-sort="ascending"]::after {
  content: "\2191"; /* up: ascending */
  opacity: 0.95;
}

.docs-content th[aria-sort="descending"]::after {
  content: "\2193"; /* down: descending */
  opacity: 0.95;
}

.docs-content td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.6;
  vertical-align: top;
}

.docs-content td:first-child,
.docs-content th:first-child {
  padding-left: 0;
}

.docs-content td code {
  color: var(--accent);
  white-space: nowrap;
}

.docs-content a {
  color: var(--accent);
}

.docs-content a:hover {
  text-decoration: underline;
}

/* definition-style two-column block (e.g. Finding field list) */

.def-list {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.def-list__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.def-list__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.8125rem;
}

.def-list__grid code {
  color: var(--accent);
  background: none;
  padding: 0;
}

.def-list__grid span {
  color: var(--text-secondary);
}

/* right: in-page table of contents */

.docs-toc {
  position: sticky;
  top: 80px;
  align-self: start;
}

.docs-toc__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 12px;
}

.docs-toc__link {
  display: block;
  padding: 6px 0 6px 12px;
  font-size: 0.8125rem;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 400;
}

.docs-toc__link:hover {
  color: var(--text);
}

.docs-toc__link.is-active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 96px 24px 64px;
  }

  .hero__code {
    position: static;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-nav-toggle {
    display: inline-flex;
  }

  .docs-nav {
    position: static;
    max-height: none;
    display: none;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .docs-nav.is-open {
    display: block;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero__title {
    font-size: 2.75rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .stat-chip {
    padding-right: 24px;
    margin-right: 24px;
  }
}
