/* Cell Based Milk — site styles
   Palette comes straight from the logo: splash blue, deep navy, pale milk tint. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --blue: #0085c8;        /* logo splash */
  --blue-ink: #00699e;    /* accessible link/text blue (AA on white and tint) */
  --navy: #002132;        /* logo outline */
  --ink: #12303f;         /* body text */
  --ink-soft: #4a6170;    /* captions, meta */
  --tint: #eff7fc;        /* milk-blue wash */
  --sky: #8fc9e7;
  --line: #d3e6f2;
  --white: #ffffff;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  --gutter: 16px;
  --radius: 14px;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}
@media (min-width: 720px) { body { font-size: 1.125rem; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 750;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.05rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--navy); }
.brand img { width: 56px; height: 56px; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem 1.4rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  color: var(--navy); text-decoration: none; padding: 0.35rem 0; display: inline-block;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--blue); color: var(--navy); }
@media (max-width: 560px) {
  .site-header .wrap { padding-top: 0.45rem; padding-bottom: 0.2rem; gap: 0.2rem; }
  .brand img { width: 44px; height: 44px; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: space-between; gap: 0.25rem 0.8rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1rem;
  padding: 0.75rem 1.25rem; border-radius: 999px; text-decoration: none; line-height: 1.2;
  border: 2px solid transparent;
}
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--tint); color: var(--navy); }
.btn-ghost { color: var(--white); border-color: rgba(255,255,255,0.7); }
.btn-ghost:hover { color: var(--white); border-color: var(--white); background: rgba(255,255,255,0.1); }

/* ---------- home hero: the one loud moment ---------- */
.hero { background: var(--blue); color: var(--white); position: relative; }
.hero .wrap {
  display: grid; gap: 2rem; align-items: center;
  padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(3.5rem, 8vw, 6rem);
}
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.15fr 0.85fr; gap: 3rem; } }
.hero h1 { color: var(--white); font-size: clamp(2.3rem, 1.3rem + 4.4vw, 4.1rem); font-weight: 800; max-width: 14ch; margin-bottom: 0.45em; }
.hero p.lede { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); max-width: 34rem; color: #f2f9fd; margin-bottom: 1.6rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-art { justify-self: center; width: min(100%, 460px); }
.hero-art img { width: 100%; height: auto; }
@media (max-width: 899px) { .hero-art { width: min(70%, 300px); margin-top: -0.5rem; } }
.hero-edge { display: block; width: 100%; height: clamp(46px, 7vw, 96px); margin-top: -1px; position: absolute; left: 0; right: 0; bottom: -1px; }

/* ---------- home sections ---------- */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; }
.section-head a { font-family: var(--display); font-weight: 600; }

.status {
  border: 2px solid var(--navy); border-radius: var(--radius);
  display: grid; overflow: hidden;
}
@media (min-width: 760px) { .status { grid-template-columns: 1fr 1fr; } }
.status-item { padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) {
  .status-item:nth-child(odd) { border-right: 1px solid var(--line); }
  .status-item:nth-last-child(-n+2) { border-bottom: 0; }
}
.status-item:last-child { border-bottom: 0; }
.status-item h3 { font-size: 1.12rem; margin-bottom: 0.3rem; }
.status-item p { margin: 0 0 0.4rem; font-size: 1rem; }
.status-item a { font-family: var(--display); font-weight: 600; font-size: 0.95rem; }
.status-note { font-family: var(--display); font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.8rem; }

.path { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 760px) { .path { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 2.2rem; } }
.path li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.path li::before {
  content: counter(step);
  font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--white);
  background: var(--blue); width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; line-height: 1;
}
.path h3 { margin: 0.15rem 0 0.25rem; font-size: 1.15rem; }
.path h3 a { color: var(--navy); text-decoration: none; }
.path h3 a:hover { text-decoration: underline; }
.path p { margin: 0; font-size: 1rem; color: var(--ink-soft); }

.band { background: var(--tint); }

/* topic listing (home + articles index) */
.topic { margin-bottom: 2.6rem; }
.topic:last-child { margin-bottom: 0; }
.topic > h2 { padding-bottom: 0.4rem; border-bottom: 2px solid var(--navy); margin-bottom: 0.2rem; }
.topic > p.topic-desc { color: var(--ink-soft); margin: 0.5rem 0 0.6rem; font-size: 1rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 112px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: start; }
@media (min-width: 720px) { .row { grid-template-columns: 180px 1fr; gap: 1.4rem; } }
.row img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--tint); }
.row h3 { font-size: 1.1rem; margin: 0 0 0.3rem; }
@media (min-width: 720px) { .row h3 { font-size: 1.28rem; } }
.row h3 a { color: var(--navy); text-decoration: none; }
.row h3 a:hover { text-decoration: underline; }
.row p { margin: 0; font-size: 0.98rem; color: var(--ink-soft); }
.row .meta { font-family: var(--display); font-size: 0.86rem; color: var(--ink-soft); margin-top: 0.35rem; }
@media (max-width: 480px) { .row p.summary { display: none; } }

.feature { display: grid; gap: 1.4rem; align-items: center; }
@media (min-width: 860px) { .feature { grid-template-columns: 1.1fr 1fr; gap: 2.5rem; } }
.feature img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.feature h3 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); margin-bottom: 0.4rem; }
.feature h3 a { color: var(--navy); text-decoration: none; }
.feature h3 a:hover { text-decoration: underline; }

/* faq teaser + faq page */
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  cursor: pointer; list-style: none; padding: 1rem 2.2rem 1rem 0; position: relative;
  font-family: var(--display); font-weight: 700; font-size: 1.12rem; color: var(--navy);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%; width: 0.7rem; height: 0.7rem;
  border-right: 2.5px solid var(--blue); border-bottom: 2.5px solid var(--blue);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease;
}
.qa details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.qa .answer { padding: 0 0 1.1rem; }
.qa .answer p { margin-bottom: 0.4rem; }
.qa .answer a { font-family: var(--display); font-weight: 600; font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .qa summary::after { transition: none; } }

/* ---------- article ---------- */
.crumbs { font-family: var(--display); font-size: 0.9rem; color: var(--ink-soft); padding-top: 1.2rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 0.4rem; color: var(--sky); }
.crumbs a { color: var(--ink-soft); }

.article-head { padding: 1rem 0 1.5rem; max-width: 50rem; }
.article-head .cat { font-family: var(--display); font-weight: 700; font-size: 0.98rem; text-decoration: none; color: var(--blue-ink); display: inline-block; margin-bottom: 0.6rem; }
.article-head .dek { font-size: clamp(1.12rem, 1rem + 0.4vw, 1.3rem); color: var(--ink-soft); margin: 0.2rem 0 1rem; line-height: 1.5; }
.byline { font-family: var(--display); font-size: 0.92rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; }
.hero-img { margin: 0 0 2rem; }
.hero-img img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); background: var(--tint); }

.layout { display: grid; gap: 2.5rem; padding-bottom: 3.5rem; }
@media (min-width: 1060px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; } }
.prose { max-width: 42rem; min-width: 0; }
.prose h2 { margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--blue); }
.prose strong { color: var(--navy); }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 3px solid var(--sky); color: var(--ink-soft); font-style: italic; }
.prose em { color: inherit; }

.takeaways { background: var(--tint); border-radius: var(--radius); padding: 1.3rem 1.4rem 0.6rem; margin: 0 0 2rem; }
.takeaways h2 { font-size: 1.15rem; margin: 0 0 0.6rem; padding: 0; }
.takeaways ul { margin: 0 0 0.6rem; padding-left: 1.2em; font-size: 1rem; }

.note { border-left: 4px solid var(--blue); background: var(--tint); padding: 0.9rem 1.2rem; margin: 1.6em 0; border-radius: 0 10px 10px 0; font-size: 1rem; }
.note p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 1.4em 0 1.6em; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--display); font-size: 0.93rem; line-height: 1.4; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--navy); color: var(--white); font-weight: 700; }
.prose thead th:first-child { border-top-left-radius: 8px; }
.prose thead th:last-child { border-top-right-radius: 8px; }
.prose tbody th, .prose tbody td:first-child { font-weight: 600; color: var(--navy); }
.prose tbody tr:nth-child(even) { background: #f7fbfe; }
.prose table + p em, .prose .table-wrap + p em { font-size: 0.92rem; }

.prose figure { margin: 1.8em 0; }
.prose figcaption { font-family: var(--display); font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.6rem; }
.diagram { background: var(--tint); border-radius: var(--radius); padding: 1rem; }
.diagram svg { width: 100%; height: auto; display: block; }

.sources { font-size: 0.95rem; }
.prose h2#sources { font-size: 1.25rem; border-top: 2px solid var(--navy); padding-top: 1rem; }
.prose h2#sources + ul { font-size: 0.95rem; line-height: 1.5; }

.article-faq h2 { margin-top: 2.2em; }

.aside-inner { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }
.toc { border-top: 2px solid var(--navy); padding-top: 0.8rem; font-family: var(--display); }
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.35rem 0; color: var(--ink); text-decoration: none; font-size: 0.95rem; line-height: 1.35; border-bottom: 1px solid var(--line); }
.toc a:hover { color: var(--blue-ink); }
@media (max-width: 1059px) { .aside { display: none; } }

.related { border-top: 1px solid var(--line); padding: 2.5rem 0 3.5rem; }

/* ---------- ads (only rendered once AdSense is configured) ---------- */
.ad { margin: 2rem 0; min-height: 280px; text-align: center; }
.ad-label { font-family: var(--display); font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.aside .ad { min-height: 600px; margin: 0; }

/* ---------- simple pages ---------- */
.page { padding: 1.5rem 0 4rem; }
.page .prose { max-width: 44rem; }
.contact-email { font-family: var(--display); font-size: 1.4rem; font-weight: 700; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #cfe3ee; font-family: var(--display); font-size: 0.95rem; }
.site-footer .wrap { padding-top: 2.5rem; padding-bottom: 2.5rem; display: grid; gap: 2rem; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { color: var(--white); font-size: 1rem; margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.3rem 0; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--white); }
.site-footer .foot-brand { display: flex; gap: 0.8rem; align-items: flex-start; }
.site-footer .foot-brand img { width: 64px; height: 64px; border-radius: 12px; }
.site-footer p { margin: 0 0 0.6rem; }
.copy { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1rem; font-size: 0.88rem; color: #a9c6d6; grid-column: 1 / -1; }

/* ---------- 404 ---------- */
.notfound { padding: 4rem 0 5rem; max-width: 40rem; }

@media print {
  .site-header nav, .aside, .ad, .site-footer, .related { display: none !important; }
}
