/* CranioCalc
   Palette: cool lightbox paper, slate ink, and gentian violet (the surgical skin-marker ink)
   as the single accent. Type: IBM Plex Sans throughout, with IBM Plex Sans Condensed for
   large page titles. Both self-hosted under the SIL Open Font License. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #f2f4f3;
  --paper-2: #e7ecea;
  --surface: #fbfcfb;
  --ink: #16232b;
  --ink-2: #4c5b64;
  --ink-3: #75838b;
  --rule: #cfd7d8;
  --violet: #5b3fa0;
  --violet-ink: #462f80;
  --violet-wash: #ebe6f6;
  --ok: #2b6a4e;
  --ok-wash: #e2efe8;
  --warn: #8a5a12;
  --warn-wash: #f5ecdc;
  --danger: #9b2c2c;
  --danger-wash: #f6e3e3;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "IBM Plex Sans Condensed", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: var(--sans); /* reading text uses Plex Sans too */

  /* Type scale (major third) */
  --t-xs: 0.8rem;
  --t-sm: 0.9rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 1.953rem;
  --t-3xl: 2.441rem;

  --measure: 68ch;
  --wide: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10171c;
    --paper-2: #172128;
    --surface: #141d23;
    --ink: #e3e9e8;
    --ink-2: #a2afb5;
    --ink-3: #7c8a91;
    --rule: #2a3740;
    --violet: #a993e6;
    --violet-ink: #c4b5f1;
    --violet-wash: #241e38;
    --ok: #7cc5a2;
    --ok-wash: #15291f;
    --warn: #e0b46c;
    --warn-wash: #2c2312;
    --danger: #ee9a9a;
    --danger-wash: #2e1717;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10171c;
  --paper-2: #172128;
  --surface: #141d23;
  --ink: #e3e9e8;
  --ink-2: #a2afb5;
  --ink-3: #7c8a91;
  --rule: #2a3740;
  --violet: #a993e6;
  --violet-ink: #c4b5f1;
  --violet-wash: #241e38;
  --ok: #7cc5a2;
  --ok-wash: #15291f;
  --warn: #e0b46c;
  --warn-wash: #2c2312;
  --danger: #ee9a9a;
  --danger-wash: #2e1717;
  color-scheme: dark;
}

*,
*::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: var(--t-md);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--violet-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 2px; }

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

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-family: var(--display); font-size: clamp(2.1rem, 4.4vw, var(--t-3xl)); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
p { margin: 0 0 1em; }

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

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }
.prose { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; }
.prose p, .prose li { max-width: var(--measure); }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.lede { font-size: var(--t-lg); color: var(--ink-2); max-width: 56ch; line-height: 1.45; }

/* Header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.wordmark {
  font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
}
.wordmark svg { width: 26px; height: 30px; flex: none; }
.wordmark .tld { color: var(--violet); }
.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a {
  display: block; padding: 8px 10px; border-radius: var(--radius); color: var(--ink-2);
  text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--violet); border-radius: 0; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--rule); color: var(--ink);
  border-radius: var(--radius); padding: 8px 12px; font: inherit; cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; margin: 0; padding-bottom: 12px; }
  .site-header .wrap { flex-wrap: wrap; }
  .site-header.open .nav { display: block; }
  .nav ul { flex-direction: column; }
  .nav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--violet); }
}

/* Page header ---------------------------------------------------------- */
.page-head { padding: clamp(32px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); }
.page-head p { margin-bottom: 0; }
.section { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(28px, 5vw, 56px); }
.wrap.section + .wrap.section { background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat; }

/* Hero (home) ---------------------------------------------------------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(16px, 3vw, 32px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); max-width: 14ch; margin-bottom: 0.35em; }
.hero .lede { margin-bottom: 28px; }
.hero-figure { justify-self: center; width: min(100%, 360px); }
.hero-figure figcaption { font-size: var(--t-xs); color: var(--ink-3); text-align: center; margin-top: 6px; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-figure { order: -1; width: 170px; justify-self: start; }
  .hero-figure figcaption { display: none; }
}

/* Vertex tracing (the site's one decorative device) */
.tracing { color: var(--ink-3); overflow: visible; }
.tracing .outline, .tracing .suture, .tracing .feature { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.tracing .outline { stroke: var(--ink); stroke-width: 2; }
.tracing .suture { stroke-width: 1.2; stroke-dasharray: 2 4; }
.tracing .feature { stroke-width: 1.6; }
.tracing .axis { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 1 5; }
.tracing .diag { stroke: var(--violet); stroke-width: 2.4; stroke-linecap: round; }
.tracing .diag.b { stroke-width: 1.6; stroke-dasharray: 6 5; }
.tracing .tick { fill: var(--violet); }
.tracing text { font-family: var(--sans); font-size: 15px; fill: var(--ink-2); }
.tracing text.v { fill: var(--violet-ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .hero .tracing .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.6s cubic-bezier(.6,.05,.3,1) forwards; }
  .hero .tracing .diag.draw { animation-delay: 1.1s; animation-duration: 0.9s; }
  .hero .tracing .diag.b.draw { animation-delay: 1.5s; }
  .hero .tracing .late { opacity: 0; animation: fade 0.6s ease 2.2s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* Forms ---------------------------------------------------------------- */
label { font-weight: 500; font-size: 0.95rem; display: block; margin-bottom: 6px; }
.hint { font-size: var(--t-sm); color: var(--ink-2); margin: 4px 0 0; font-weight: 400; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); outline-offset: -1px; border-color: var(--violet); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--violet); width: 18px; height: 18px; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 450; margin: 0; cursor: pointer; }
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  padding: 11px 20px; min-height: 46px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--violet); color: #fff;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #160f2a; } }
:root[data-theme="dark"] .btn { color: #160f2a; }
.btn:hover { background: var(--violet-ink); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--paper-2); }

/* Big question box */
.ask { display: flex; gap: 10px; align-items: stretch; }
.ask textarea { min-height: 58px; height: 58px; font-size: 1.1rem; padding: 15px 14px; resize: none; overflow: hidden; }
.ask .btn { flex: none; min-height: 58px; padding: 0 24px; }
@media (max-width: 560px) { .ask { flex-direction: column; } .ask .btn { width: 100%; } }
.ask-options { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 12px; font-size: var(--t-sm); color: var(--ink-2); }
.ask-options select { width: auto; min-height: 36px; padding: 6px 10px; font-size: var(--t-sm); }
.examples { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: var(--t-sm); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); text-align: left;
}
.chip:hover { border-color: var(--violet); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--violet-wash); border-color: var(--violet); color: var(--violet-ink); }

/* Notices */
.notice { border-left: 3px solid var(--rule); padding: 10px 14px; background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0; font-size: var(--t-sm); color: var(--ink-2); }
.notice.warn { border-color: var(--warn); background: var(--warn-wash); color: var(--ink); }
.notice.error { border-color: var(--danger); background: var(--danger-wash); color: var(--ink); }
.notice.ok { border-color: var(--ok); background: var(--ok-wash); color: var(--ink); }
.notice p:last-child { margin: 0; }

/* Index list (home + hubs): ruled rows instead of a card grid */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.index li { border-bottom: 1px solid var(--rule); }
.index a.row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; gap: 8px 24px; padding: 18px 4px; text-decoration: none; color: var(--ink); align-items: baseline; }
.index a.row:hover { background: var(--paper-2); }
.index .row-title { font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.index .row-desc { color: var(--ink-2); }
.index .row-meta { font-size: var(--t-sm); color: var(--ink-3); white-space: nowrap; }
@media (max-width: 680px) { .index a.row { grid-template-columns: 1fr; gap: 2px; } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.col-head h2 { margin: 0; }
.col-head a { font-size: var(--t-sm); white-space: nowrap; }

/* Status badges */
.badge {
  display: inline-block; font-size: var(--t-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; vertical-align: middle;
}
.badge.live, .badge.recruiting { background: var(--ok-wash); color: var(--ok); border-color: transparent; }
.badge.dev, .badge.pending { background: var(--warn-wash); color: var(--warn); border-color: transparent; }
.badge.violet { background: var(--violet-wash); color: var(--violet-ink); border-color: transparent; }

/* Literature search results ------------------------------------------ */
.results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 960px) { .results { grid-template-columns: 1fr; } }
.answer { font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; }
.answer p, .answer ul { max-width: var(--measure); }
.answer ul { padding-left: 1.2em; }
.answer li { margin-bottom: 0.5em; }
.answer .bottom-line { font-family: var(--sans); font-size: 1.25rem; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; border-left: 3px solid var(--violet); padding-left: 16px; margin-bottom: 1.2em; }
.cite { font-family: var(--sans); font-size: 0.7em; vertical-align: super; line-height: 0; margin-left: 1px; }
.cite a { text-decoration: none; padding: 0 2px; border-radius: 3px; font-weight: 600; }
.cite a:hover, .cite a.hl { background: var(--violet-wash); }
.refs h2 { font-size: var(--t-lg); }
.refs ol { margin: 0; padding: 0; list-style: none; counter-reset: ref; }
.refs li { counter-increment: ref; position: relative; padding: 10px 0 10px 2.2em; border-top: 1px solid var(--rule); font-size: var(--t-sm); line-height: 1.45; scroll-margin-top: 16px; }
.refs li::before { content: counter(ref); position: absolute; left: 0; top: 10px; font-weight: 700; color: var(--violet-ink); min-width: 1.6em; }
.refs li.target { background: var(--violet-wash); }
.refs .ref-title { font-weight: 600; color: var(--ink); display: block; margin-bottom: 2px; }
.refs .ref-meta { color: var(--ink-2); }
.refs details { margin-top: 16px; font-size: var(--t-sm); }
.refs details ul { list-style: none; padding: 0; margin: 8px 0 0; }
.refs details li { padding-left: 0; }
.refs details li::before { content: none; }
.query-box { margin-top: 24px; font-size: var(--t-sm); color: var(--ink-2); }
.query-box code { display: block; white-space: pre-wrap; word-break: break-word; background: var(--paper-2); padding: 10px 12px; border-radius: var(--radius); margin-top: 6px; font-size: 0.82rem; color: var(--ink); }

.loading { display: flex; gap: 12px; align-items: center; color: var(--ink-2); padding: 24px 0; }
.loading .steps { list-style: none; margin: 0; padding: 0; }
.loading .steps li { opacity: 0.45; padding: 2px 0; }
.loading .steps li.on { opacity: 1; color: var(--ink); }
.loading .steps li.done { opacity: 0.8; }
.loading .steps li.done::after { content: " ✓"; color: var(--ok); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--rule); border-top-color: var(--violet); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; align-self: flex-start; margin-top: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Calculators --------------------------------------------------------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.calc-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: clamp(18px, 3vw, 28px); }
.unit-input { position: relative; }
.unit-input input { padding-right: 46px; }
.unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: var(--t-sm); pointer-events: none; }
.readout { margin-top: 8px; }
.readout .value { font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.readout .value small { font-size: 0.4em; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.readout .grade { font-size: var(--t-lg); font-weight: 600; margin-top: 8px; }
.readout .sub { color: var(--ink-2); font-size: var(--t-sm); margin-top: 4px; font-variant-numeric: tabular-nums; }
.scale { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 4px; }
.scale li { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 12px; padding: 8px 10px; border-radius: var(--radius); font-size: var(--t-sm); align-items: baseline; font-variant-numeric: tabular-nums; }
.scale li.on { background: var(--violet-wash); color: var(--violet-ink); font-weight: 600; }
.scale .range { color: var(--ink-2); }
.scale li.on .range { color: inherit; }
.calc-figure { margin: 0 0 16px; }
.calc-figure svg { width: 100%; max-width: 280px; display: block; margin: 0 auto; }
.method { margin-top: clamp(32px, 5vw, 56px); }
.method h2 { font-size: var(--t-lg); }
.formula { font-family: var(--serif); font-size: 1.1rem; background: var(--paper-2); padding: 12px 16px; border-radius: var(--radius); display: inline-block; }

/* Model card */
.card-grid { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 0 32px; border-top: 1px solid var(--rule); }
.card-grid dt { font-weight: 600; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.card-grid dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
@media (max-width: 680px) { .card-grid { grid-template-columns: 1fr; } .card-grid dt { border-bottom: 0; padding-bottom: 0; } }
table.metrics { border-collapse: collapse; width: 100%; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
table.metrics th, table.metrics td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.metrics th { font-weight: 600; color: var(--ink-2); }
.embed { width: 100%; height: 820px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }

/* Digest -------------------------------------------------------------- */
.digest-group { margin-top: 36px; }
.digest-group h2 { font-size: var(--t-lg); padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.paper { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.paper h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 6px; }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--violet-ink); text-decoration: underline; }
.paper .takeaway { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; margin: 0 0 6px; max-width: var(--measure); }
.paper .meta { font-size: var(--t-sm); color: var(--ink-2); }
.paper .design { font-weight: 600; color: var(--ink); }
.subscribe { display: flex; gap: 10px; flex-wrap: wrap; max-width: 480px; }
.subscribe input { flex: 1 1 220px; }
.compact .paper { padding: 12px 0; }
.compact .paper h3 { font-size: 1rem; }

/* Trials -------------------------------------------------------------- */
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 820px) { .filters { grid-template-columns: 1fr 1fr; } .filters .field-cond { grid-column: 1 / -1; } .filters .btn { grid-column: 1 / -1; } }
.filters .field { margin: 0; }
.trial { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.trial h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; margin-bottom: 8px; letter-spacing: -0.01em; }
.trial h3 a { color: var(--ink); text-decoration: none; }
.trial h3 a:hover { color: var(--violet-ink); text-decoration: underline; }
.trial dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 20px; margin: 10px 0; font-size: var(--t-sm); }
.trial dt { color: var(--ink-3); font-size: var(--t-xs); }
.trial dd { margin: 0; color: var(--ink); }
.trial details { font-size: var(--t-sm); color: var(--ink-2); }
.trial summary { cursor: pointer; color: var(--violet-ink); font-weight: 500; }
.trial details p { font-family: var(--serif); font-size: 1rem; margin-top: 8px; max-width: var(--measure); color: var(--ink); }

/* Meetings ------------------------------------------------------------ */
.meetings { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.meetings li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.meetings .when { font-weight: 600; font-variant-numeric: tabular-nums; }
.meetings .when small { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--t-xs); }
.meetings .what a { font-weight: 600; color: var(--ink); text-decoration: none; }
.meetings .what a:hover { color: var(--violet-ink); text-decoration: underline; }
.meetings .where { color: var(--ink-2); font-size: var(--t-sm); }
@media (max-width: 520px) { .meetings li { grid-template-columns: 1fr; } }

.link-list { list-style: none; padding: 0; margin: 0; columns: 2 18rem; column-gap: 40px; }
.link-list li { break-inside: avoid; padding: 10px 0; border-top: 1px solid var(--rule); }
.link-list a { font-weight: 600; }
.link-list span { display: block; color: var(--ink-2); font-size: var(--t-sm); }

/* Steps (validation process — a real sequence) */
.steps-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
.steps-list li::before { content: counter(step); font-weight: 700; font-size: var(--t-xl); color: var(--violet); line-height: 1; grid-row: span 2; }
.steps-list h3 { font-size: 1.05rem; margin: 0 0 4px; }
.steps-list p { margin: 0; color: var(--ink-2); max-width: 60ch; }

/* Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: clamp(40px, 6vw, 80px); padding: 28px 0 40px; font-size: var(--t-sm); color: var(--ink-2); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
.site-footer p { margin: 0 0 8px; max-width: 70ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; }
.site-footer a { color: var(--ink-2); }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } .site-footer ul { justify-content: flex-start; } }

.empty { padding: 24px 0; color: var(--ink-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wordmark .wm-diag { stroke: var(--violet); }

.answer:focus { outline: none; }
#search-status, #search-results { margin-top: 28px; }
#search-status:empty { margin-top: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.calc-figure .tracing text.side { font-size: 24px; font-weight: 600; }
.calc-left { display: grid; gap: 0; align-content: start; }
.calc-left .method { margin-top: 40px; }
@media (max-width: 860px) { .calc-left { display: contents; } .calc-left .method { order: 3; } }
.trial dl .loc { grid-column: 1 / -1; }
#digest { margin-top: 32px; }

/* CranioCalc logo (skull illustration from the CranioSTRIP mark) */
.wordmark img { width: 40px; height: auto; display: block; }
.wordmark span { font-size: 1.25rem; }

/* Grouped calculator hub */
.calc-group { margin-bottom: clamp(36px, 6vw, 64px); }
.calc-group > p { max-width: var(--measure); }
.calc-group .disclaimer { font-size: var(--t-sm); color: var(--ink-2); border-left: 3px solid var(--rule); padding-left: 12px; margin-top: 12px; }

/* Research page layout: digest + side column */
.research-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: clamp(28px, 5vw, 64px); align-items: start; }
.research-layout aside h2 { font-size: var(--t-lg); }
.research-layout aside section + section { margin-top: 40px; }
.research-layout .meetings li { grid-template-columns: 1fr; gap: 2px; }
@media (max-width: 960px) { .research-layout { grid-template-columns: 1fr; } }

/* Collaboration options */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 40px); border-top: 1px solid var(--rule); }
.ways > div { padding: 20px 0; }
.ways h3 { font-size: 1.1rem; margin-bottom: 6px; }
.ways p { color: var(--ink-2); margin: 0; }
@media (max-width: 820px) { .ways { grid-template-columns: 1fr; } .ways > div + div { border-top: 1px solid var(--rule); } }

/* Home: collaboration band */
.band { background: var(--violet-wash); border-radius: 10px; padding: clamp(22px, 4vw, 36px); display: flex; gap: 20px 40px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.band h2 { margin: 0 0 4px; }
.band p { margin: 0; color: var(--ink-2); max-width: 56ch; }

/* Built-in model calculator */
.coef-table td:nth-child(n+2), .coef-table th:nth-child(n+2) { text-align: right; }
.check-input { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); min-height: 46px; cursor: pointer; font-weight: 450; margin: 0; }

[hidden] { display: none !important; }
.index.simple a.row { grid-template-columns: 1fr; padding: 14px 4px; }
.wordmark img { width: 44px; }

/* Calculator hub: established calculators listed by name only */
.index.names-only a.row { grid-template-columns: minmax(0, 1fr) auto; }
@media (min-width: 900px) {
  .index.names-only { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; border-top: 0; }
  .index.names-only li:nth-child(-n+2) { border-top: 1px solid var(--rule); }
}

/* Home page cephalometric tracing: inline SVG strokes in currentColor, so the line
   color follows the theme (black in light mode, white in dark mode). Each path draws
   in after its own delay (--d) over its own duration (--t). */
:root { --tracing-line: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tracing-line: #fff; } }
:root[data-theme="dark"] { --tracing-line: #fff; }
.ceph-tracing { display: block; width: 100%; height: auto; color: var(--tracing-line); overflow: visible; }
.hero-figure:has(.ceph-tracing) { width: min(100%, 440px); }
@media (max-width: 820px) { .hero-figure:has(.ceph-tracing) { width: 200px; } }
@media (prefers-reduced-motion: no-preference) {
  .hero .ceph-tracing path { stroke-dasharray: 1; animation: ceph-draw var(--t, 1s) cubic-bezier(.45,.05,.35,1) var(--d, 0s) both; }
}
@keyframes ceph-draw {
  0% { stroke-dashoffset: 1; opacity: 0; }
  1% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

/* Header calculator search ------------------------------------------------ */
.site-search { position: relative; flex: none; width: clamp(170px, 17vw, 240px); }
.site-search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px; font: inherit; font-size: 0.92rem;
  color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
}
.site-search input::placeholder { color: var(--ink-3); }
.site-search input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-wash); }
.site-search input::-webkit-search-cancel-button { cursor: pointer; }
.ss-field { position: relative; display: block; }
.ss-icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.site-search [role=listbox] {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(400px, calc(100vw - 2 * var(--gutter, 16px)));
  max-height: min(70vh, 520px); overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--rule); border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 12px 32px rgba(16, 23, 28, 0.16);
}
.site-search [role=option] a { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.site-search [role=option][aria-selected="true"] a { background: var(--violet-wash); }
.ss-name { font-weight: 600; }
.ss-tag { font-size: 0.72rem; font-weight: 600; color: var(--ink-3); margin-left: 6px; white-space: nowrap; }
.ss-desc { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.ss-group { font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.ss-empty { padding: 12px; font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 900px) {
  .site-search { order: 1; flex: 1; width: auto; min-width: 0; }
  .nav-toggle { order: 2; margin-left: 0; }
  .nav { order: 3; }
  .site-header .wrap { gap: 12px; position: relative; }
  .site-search { position: static; }
  .site-search [role=listbox] { left: var(--gutter); right: var(--gutter); width: auto; top: 58px; }
}

/* Research page: subscribe box above the digest */
.research-layout .subscribe-box { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.research-layout .subscribe-box h2 { font-size: var(--t-lg); }

/* CranioSTRIP form */
.cs-step { margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.cs-step:first-child { margin-top: 0; }
.cs-checks { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.cs-checks legend { font-weight: 500; font-size: .95rem; margin-bottom: 8px; padding: 0; }
.cs-checks .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0; }
.cs-checks .check input { margin-top: 2px; flex: none; }
@media (min-width: 861px) { #cs-calc > [aria-live] { position: sticky; top: 24px; } }
