/* owlabee guides: one stylesheet, light and dark via prefers-color-scheme.
   No scripts and no trackers. The only third-party request is the Google Fonts stylesheet
   (Jost, Cormorant Garamond); the mark is inline SVG and everything else is CSS.
   Brand (brand/README.md): Cream ground, Charcoal text and mark, Gold accents and rules,
   Gold Deep for links and italic taglines, Linen cards with hairline borders.
   Contrast: small text never uses plain Gold on Cream (2.4:1); links are Gold Deep on Cream
   (4.7:1) and a deeper gold on Linen (5.4:1). */
:root {
  --cream: #faf7f1;
  --charcoal: #2e2e2e;
  --gold: #c29a45;
  --gold-deep: #8c6a26;
  --sage: #7f8e7c;
  --stone: #5e5a55;
  --linen: #f4ede2;
  --hairline: #e2d3b5;

  --bg: var(--cream);
  --text: var(--charcoal);
  --muted: var(--stone);
  --card: var(--linen);
  --rule: var(--hairline);
  --accent: var(--gold);
  --link: var(--gold-deep);
  --link-on-card: #7a5b1f;
  --tagline: var(--gold-deep);
  --mark: var(--charcoal);
  --focus: var(--gold-deep);
  --button-bg: var(--charcoal);
  --button-text: var(--cream);
  --code-bg: #2a2928;
  --code-text: #efe8da;
  --inline-code-bg: #ece2cf;

  --sans: Jost, "Futura", "Century Gothic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --caps: 0.22em;
  --radius: 6px;
  --measure: 46rem;
  --wide: 72rem;
  color-scheme: light dark;
}

/* Dark: Charcoal ground, Cream text, Gold accents, reversed (cream) mark. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--charcoal);
    --text: var(--cream);
    --muted: #c9c1b4;
    --card: #363533;
    --rule: #57503f;
    --link: #d4b26e;
    --link-on-card: #d4b26e;
    --tagline: #d4b26e;
    --mark: var(--cream);
    --focus: var(--gold);
    --button-bg: var(--cream);
    --button-text: var(--charcoal);
    --code-bg: #232323;
    --code-text: #efe8da;
    --inline-code-bg: #46433e;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Anchor targets land below the sticky header, not under it. */
[id] { scroll-margin-top: 92px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* The guide-head band bleeds to the viewport edges with 100vw; `clip`, unlike `hidden`,
     makes no scroll container, so the sticky header still sticks. */
  overflow-x: clip;
}

a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: var(--wide); }
@media (min-width: 48rem) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); color: var(--text); padding: 4px 8px; z-index: 10; }

/* Spaced capitals: wordmark, section labels, small captions. */
.wordmark,
.lockup-word,
.motto,
.kicker,
.group-title,
.site-header nav,
h2 {
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--caps);
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--mark); text-decoration: none; }
.brand:hover .wordmark { color: var(--link); }
.logo { width: 40px; height: 40px; flex: none; color: var(--mark); }
.wordmark { font-size: 1.05rem; letter-spacing: 0.26em; margin-right: -0.26em; color: var(--text); }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 0.74rem; letter-spacing: 0.2em; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.site-header nav a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.site-header nav a.nav-store { color: var(--text); padding: 6px 12px; border: 1px solid var(--accent); border-radius: 2px; }
.site-header nav a.nav-store:hover { background: var(--card); text-decoration: none; }

/* ---- type ---- */
main.wrap { padding-top: 0; padding-bottom: 64px; }
h1, h3 { font-family: var(--sans); text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 400; line-height: 1.18; letter-spacing: -0.005em; margin: 0.3em 0 0.4em; }
h3 { font-size: 1.12rem; font-weight: 500; line-height: 1.3; margin: 1.6em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
strong, b { font-weight: 500; }

/* Section labels: spaced capitals, then a hairline that fills the rest of the line. */
h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  margin: 3em 0 1.2em;
}
h2::after { content: ""; flex: 1 1 2rem; min-width: 2rem; height: 1px; background: var(--rule); }

/* Lede lines: Cormorant Garamond italic. */
.lede { font: italic 400 1.42rem/1.45 var(--serif); color: var(--text); max-width: 42rem; }
.note { color: var(--muted); font-size: 0.95rem; }
.kicker { margin: 0 0 0.7em; font-size: 0.74rem; line-height: 1.6; color: var(--muted); }

.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.6em; }
.crumbs a { color: var(--muted); }

/* ---- buttons ---- */
.cta { margin: 1.5em 0 0; }
.cta .note { margin-top: 0.8em; }
.button {
  display: inline-block;
  background: var(--button-bg);
  color: var(--button-text);
  padding: 12px 22px;
  border: 1px solid var(--button-bg);
  border-radius: 2px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  max-width: 100%;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: transparent; color: var(--text); border-color: var(--accent); text-decoration: none; }
.button-ghost { background: transparent; color: var(--text); border-color: var(--accent); }
.button-ghost:hover { background: var(--card); }
@media (prefers-reduced-motion: reduce) { .button, .cards a { transition: none; } }

/* ---- home ---- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 60rem) { .hero-grid { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); } }

.lockup { display: flex; flex-direction: column; align-items: center; text-align: center; }
.lockup-mark { width: 132px; height: 132px; color: var(--mark); margin-bottom: 14px; }
.lockup-word {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0 0 22px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.26em;
  color: var(--text);
}
/* Cancel the trailing letter-space so the word, and the rules under it, sit centered. */
.lockup-name { margin-right: -0.26em; }
/* ".COM" in gold between two thin gold rules. */
.dotcom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.42em;
  letter-spacing: 0.3em;
  color: var(--accent);
}
.dotcom::before,
.dotcom::after { content: ""; flex: 1; height: 1px; background: var(--accent); }
/* The same for ".COM": pull the right rule over its trailing letter-space. */
.dotcom::after { margin-left: -0.3em; }
.motto { margin: 0 0 6px; font-size: 0.8rem; letter-spacing: 0.24em; color: var(--text); }
.tagline { margin: 0; font: italic 400 1.45rem/1.35 var(--serif); color: var(--tagline); text-wrap: balance; }

.hero h1 { font-size: clamp(2.1rem, 5.6vw, 3.4rem); max-width: 18ch; margin-top: 0.1em; }
.hero .hl { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--tagline); }
.hero .lede { font-size: clamp(1.3rem, 2vw, 1.5rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.8em 0 0; }

.stats {
  list-style: none;
  padding: 0;
  margin: clamp(36px, 5vw, 64px) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 12px;
}
.stats li { margin: 0; padding: 18px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.stats strong { display: block; font-size: 1.5rem; font-weight: 400; line-height: 1.3; }
.stats span { display: block; color: var(--muted); font-size: 0.92rem; }

.band { padding: clamp(40px, 6vw, 80px) 0; }
.band-alt { border-block: 1px solid var(--rule); }
.band h2 { margin-top: 0; }
.group-title { margin: 2.2em 0 0.9em; color: var(--muted); font-size: 0.74rem; line-height: 1.6; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 16px; }
.cards li { margin: 0; }
.cards a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.18s ease;
}
.cards a:hover { border-color: var(--accent); }
.cards strong { display: block; font-size: 1.06rem; font-weight: 500; margin-bottom: 8px; line-height: 1.35; }
.cards span { display: block; color: var(--muted); font-size: 0.94rem; flex: 1; }
.cards em { display: block; margin-top: 14px; font-style: normal; font-weight: 500; font-size: 0.9rem; color: var(--link-on-card); }

.actor-groups { display: grid; gap: 8px 48px; }
@media (min-width: 60rem) { .actor-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.actor-group h3 { margin-top: 1.2em; }
.actor-list { list-style: none; padding: 0; margin: 0; }
.actor-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.actor-list li:last-child { border-bottom: 0; }
.actor-list strong { font-weight: 500; }
.actor-list span { display: block; color: var(--muted); font-size: 0.94rem; }
.small { font-size: 0.88rem; }

.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.steps li { counter-increment: step; margin: 0; padding: 22px 24px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow-wrap: anywhere; }
.steps li a { color: var(--link-on-card); }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--text);
  font-weight: 500;
}

/* ---- guide pages ---- */
.guide-head {
  position: relative;
  isolation: isolate;
  padding: 32px 0 36px;
  margin-bottom: 8px;
}
.guide-head::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}
.guide-head a:not(.button) { color: var(--link-on-card); }
.guide-head .crumbs a { color: var(--muted); }
.guide-head h1 { margin-top: 0.15em; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; font-size: 0.9rem; }
.toc a { padding: 5px 14px; border: 1px solid var(--rule); border-radius: 999px; color: var(--text); text-decoration: none; }
.toc a:hover { border-color: var(--accent); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--inline-code-bg);
  padding: 0.12em 0.36em;
  border-radius: 3px;
  overflow-wrap: break-word;
}
pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-bg);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0 0 1.3em;
}
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; color: inherit; }

.table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
th { background: var(--card); font-weight: 500; }
section > table { display: block; overflow-x: auto; }

.cta-box {
  margin: 3.5em 0 0;
  padding: 28px 30px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.cta-box h2 { margin-top: 0; }
.cta-box a:not(.button) { color: var(--link-on-card); }

.related ul { padding-left: 1.2em; }
q { font-style: italic; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; padding: 32px 0 40px; margin-top: 24px; }
.site-footer a { color: var(--link); }
.site-footer .maker { color: var(--text); font-size: 1rem; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.site-footer a.maker-link { color: var(--link); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.site-footer a.maker-link:hover { text-decoration-thickness: 3px; }

/* PACER court reference table */
.courts { font-size: 0.9rem; }
.courts tr.group-start td { border-top: 2px solid var(--rule); }
.courts td.num, .courts th:last-child { text-align: right; white-space: nowrap; }
.courts td:nth-child(2) { white-space: nowrap; }
.codes { line-height: 2; }
.courts td code, .court-list td code { white-space: nowrap; }

/* Free data and comparison tables (tools/data-pages.mjs, tools/compare-pages.mjs) */
.data-table { font-size: 0.9rem; }
.data-table td .note { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
