/* blackowlstrategies.com: "navy on paper" (design spec, section 6). No dark mode. */

:root {
  --paper: #f7f4ee;
  --ink: #14213d;
  --muted: #4a5468;
  --accent: #8a6a3d;
  --rule: 1px solid var(--ink);
  --card: #ece6da;
  --hairline: 1px solid rgba(20, 33, 61, 0.2);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: 32px;
  color-scheme: light;
}

@media (max-width: 719px) {
  :root { --gutter: 16px; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Short pages, like the 404, still put the footer at the bottom of the window. */
main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: calc(1080px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 8px 12px; background: var(--ink); color: var(--paper); }
.skip:focus { left: 8px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Type */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3rem); line-height: 1.12; max-width: 24ch; margin: 0 0 24px; }
h2 { font-size: 1.75rem; margin: 0 0 16px; }
h3 { font-size: 1.25rem; font-weight: 500; margin: 0 0 8px; }
p, li, dd { max-width: 64ch; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 1.25em; }
li + li { margin-top: 4px; }
li > ul { margin: 4px 0 0; }

.steps { padding-left: 1.5em; }
.steps li + li { margin-top: 8px; }

.label { margin: 0 0 8px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Buttons */

.button { display: inline-block; padding: 12px 20px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; }
.button:hover { background: var(--paper); color: var(--ink); }
.button-small { padding: 8px 14px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* Header */

.site-header { border-bottom: var(--rule); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; }
.brand-owl { height: 34px; width: auto; }
.brand-wordmark { height: 26px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-nav a { color: var(--ink); font-weight: 500; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-underline-offset: 0.3em; }

/* Sections: full-width hairline rules between them */

.section { padding: 56px 0; border-top: var(--rule); }
main > .section:first-child, main > article > .section:first-child { border-top: 0; }

/* Proof strip */

.proof-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; }
.proof-strip li { max-width: none; }
.proof-strip li + li { margin-top: 0; border-left: var(--rule); }
.proof-strip a { display: block; height: 100%; padding: 8px 24px; color: var(--ink); text-decoration: none; }
.proof-strip li:first-child a { padding-left: 0; }
.proof-figure { display: block; margin-bottom: 8px; font-family: var(--serif); font-size: 2rem; line-height: 1.15; }
.proof-text { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.15em; }
.proof-strip-static li { padding: 8px 24px; }
.proof-strip-static li:first-child { padding-left: 0; }
.proof-strip-static .proof-text { text-decoration: none; }

/* Plans */

.plans { display: grid; grid-template-columns: repeat(2, 1fr); border: var(--rule); }
.plan { padding: 24px; }
.plan + .plan { border-left: var(--rule); }
.plan p:last-child { margin-bottom: 0; }
.grant-note { margin-top: 16px; }

/* Case cards: tinted panels in one column, in the fixed order (design spec). On wide
   screens each card puts its title and summary on the left, its facts and button on the right. */

.case-list { display: grid; grid-template-columns: 1fr; gap: 24px; margin: 0 0 24px; padding: 0; list-style: none; }
.case-card { display: flex; flex-direction: column; max-width: none; margin: 0; padding: 28px; background: var(--card); border-radius: 16px; }
li.case-card + li.case-card { margin-top: 0; }
.case-card h3 { margin: 0 0 8px; }
.case-card > p { max-width: none; margin: 0; }
.case-card-facts { margin: auto 0 0; padding-top: 24px; }
.case-card-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-top: var(--hairline); }
.case-card-facts > div:last-child { border-bottom: var(--hairline); }
.case-card-facts dt { flex: none; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.case-card-facts dd { margin: 0; font-size: 15px; text-align: right; text-wrap: balance; }
.case-card > p.case-card-link { margin-top: 24px; }
.case-card-link .button::after { content: "\2192"; content: "\2192" / ""; margin-left: 10px; }

/* Case pages */

.case-meta { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 32px; border-top: var(--rule); border-bottom: var(--rule); }
.case-meta > div { padding: 16px 16px 16px 0; }
.case-meta > div + div { padding-left: 16px; border-left: var(--rule); }
.case-meta dt { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.case-meta dd { margin: 0; }
.case-meta:last-child { margin-bottom: 0; }
.chapter-index ol { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.chapter-index li + li { margin-top: 0; }
.prose h2 { margin-top: 48px; }
.prose h2:first-child { margin-top: 0; }
.prose .label { margin-top: 48px; }
.prose .label:first-child { margin-top: 0; }
.prose .label + h2 { margin-top: 0; }

/* About */

.about-grid { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.headshot { display: block; width: 220px; border: var(--rule); }

/* Footer */

.site-footer { padding: 48px 0 56px; background: var(--ink); color: var(--paper); font-size: 15px; }
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--paper); }
.site-footer :focus-visible { outline-color: var(--paper); }
.site-footer .disclaimer { color: rgba(247, 244, 238, 0.75); }

/* Header, above phone width: pinned to the top. Once the page scrolls, site.js adds
   .is-scrolled and the wordmark folds away to the owl. It stays in the accessibility tree,
   so the home link keeps its name. */

@media screen and (min-width: 720px) {
  html { scroll-padding-top: 96px; }
  .site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); }
  .brand-wordmark { clip-path: inset(0 0 0 0); transition: opacity 0.3s ease, transform 0.3s ease, clip-path 0.3s ease; }
  .site-header.is-scrolled .brand-wordmark { opacity: 0; transform: translateX(-12px); clip-path: inset(0 100% 0 0); }
}

@media screen and (min-width: 1024px) {
  .case-card { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: auto 1fr auto; column-gap: 56px; padding: 32px 36px; }
  .case-card > * { grid-column: 1; }
  .case-card > p:not(.case-card-link) { grid-row: 2 / 4; }
  .case-card-facts { grid-column: 2; grid-row: 1 / 3; align-self: start; margin: 0; padding-top: 4px; }
  .case-card > p.case-card-link { grid-column: 2; grid-row: 3; align-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-wordmark { transition: none; }
}

/* Phones */

@media (max-width: 719px) {
  .site-nav { order: 3; width: 100%; gap: 8px 14px; font-size: 15px; }
  .section { padding: 40px 0; }
  .proof-strip, .plans, .case-meta, .about-grid { grid-template-columns: 1fr; }
  .case-list { grid-template-columns: 1fr; gap: 16px; }
  .case-card { padding: 24px; }
  .proof-strip li + li { border-left: 0; border-top: var(--rule); }
  .proof-strip a, .proof-strip li:first-child a { padding: 16px 0; }
  .proof-strip-static li, .proof-strip-static li:first-child { padding: 16px 0; }
  .plan + .plan { border-left: 0; border-top: var(--rule); }
  .case-meta > div, .case-meta > div + div { padding: 12px 0; border-left: 0; }
  .case-meta > div + div { border-top: var(--rule); }
  .headshot { width: 160px; }
}
