/* Holdout Labs — site styles. No build step. */

:root {
  --paper: #f5f3ec;
  --paper-2: #ecE9df;
  --ink: #1a1c1e;
  --ink-2: #3d4145;
  --muted: #62676c;
  --rule: #d4d0c4;
  --rule-strong: #1a1c1e;
  --accent: #1e4a5a;       /* deep slate teal: "in-sample" */
  --accent-ink: #f5f3ec;
  --hold: #a8741f;         /* muted ochre: "held out" */
  --hold-soft: #efe3cc;
  --pass: #2f6b45;
  --caution: #8a6414;
  --fail: #9a3a2c;
  --focus: #1f6fd1;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --measure: 68ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131517;
    --paper-2: #1b1e21;
    --ink: #e8e5dc;
    --ink-2: #c4c1b8;
    --muted: #9a9d9f;
    --rule: #33373b;
    --rule-strong: #e8e5dc;
    --accent: #7fb3c4;
    --accent-ink: #131517;
    --hold: #d6a453;
    --hold-soft: #2e2618;
    --pass: #7cbf93;
    --caution: #d8ae5a;
    --fail: #e08c7c;
    --focus: #7fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131517;
  --paper-2: #1b1e21;
  --ink: #e8e5dc;
  --ink-2: #c4c1b8;
  --muted: #9a9d9f;
  --rule: #33373b;
  --rule-strong: #e8e5dc;
  --accent: #7fb3c4;
  --accent-ink: #131517;
  --hold: #d6a453;
  --hold-soft: #2e2618;
  --pass: #7cbf93;
  --caution: #d8ae5a;
  --fail: #e08c7c;
  --focus: #7fb0ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--ink-2); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 6.5vw, 4.25rem); margin: 0 0 1rem; font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); margin: 0 0 .75rem; }
h3 { font-size: 1.3rem; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
pre { font-family: var(--mono); font-size: .85rem; background: var(--paper-2); border: 1px solid var(--rule); padding: 1rem; overflow-x: auto; line-height: 1.5; border-radius: 3px; }

.eyebrow { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem; }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.35rem); color: var(--ink-2); max-width: 44ch; }
.small { font-size: .9rem; color: var(--muted); }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 20px; flex: none; }
.nav { display: flex; align-items: center; gap: .25rem 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; padding: .35rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hold); text-decoration-thickness: 2px; }
.nav-toggle { display: none; }
.theme-btn { background: none; border: 1px solid var(--rule); color: var(--ink-2); border-radius: 999px; width: 2.1rem; height: 2.1rem; display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.theme-btn:hover { border-color: var(--ink); color: var(--ink); }
.theme-btn svg { width: 16px; height: 16px; }

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 3px; padding: .4rem .7rem; font: inherit; font-size: .9rem; cursor: pointer; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding: .25rem 0 1rem; gap: 0; }
  .nav.open { display: flex; }
  .nav a { padding: .55rem 0; width: 100%; border-top: 1px solid var(--rule); }
  .nav .btn { margin-top: .75rem; }
}

/* ---------- buttons ---------- */
.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem; text-decoration: none; padding: .75rem 1.25rem; border-radius: 3px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.sm { font-size: .88rem; padding: .45rem .85rem; }
.nav a.btn { color: var(--paper); padding: .45rem .85rem; text-decoration: none; }
.nav a.btn:hover { color: var(--accent-ink); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.75rem; }

/* ---------- sections ---------- */
main { display: block; }
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section-head { display: grid; gap: .25rem; margin-bottom: 2rem; max-width: 46rem; }
.page-head { padding: clamp(3rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); max-width: 22ch; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem); border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { max-width: 12ch; }
.figure { margin: 0; }
.figure figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; max-width: 52ch; }
.plot { width: 100%; border-top: 1.5px solid var(--rule-strong); border-bottom: 1px solid var(--rule); padding: .75rem 0; }
.plot .axis { stroke: var(--rule); }
.plot .ins { stroke: var(--accent); }
.plot .oos { stroke: var(--hold); }
.plot .hold-zone { fill: var(--hold-soft); }
.plot .lbl { fill: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.plot .divider { stroke: var(--ink); stroke-dasharray: 3 4; }

/* ---------- numbered steps (ruled, not cards) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.steps li { counter-increment: step; border-top: 1.5px solid var(--rule-strong); padding: 1.1rem 0 1.5rem; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--mono); font-size: .8rem; color: var(--hold); letter-spacing: .08em; margin-bottom: .6rem; }
.steps h3 { font-size: 1.35rem; }
.steps p { color: var(--ink-2); margin: 0; }

/* ---------- offers: ruled columns ---------- */
.offers { display: grid; gap: 0; border-top: 1.5px solid var(--rule-strong); }
@media (min-width: 56rem) { .offers { grid-template-columns: repeat(3, 1fr); } .offer + .offer { border-left: 1px solid var(--rule); } .offer { padding: 1.5rem 1.5rem 1.75rem; } .offer:first-child { padding-left: 0; } .offer:last-child { padding-right: 0; } }
.offer { padding: 1.5rem 0 1.75rem; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; }
@media (min-width: 56rem) { .offer { border-bottom: 0; } }
.offer .price { font-family: var(--serif); font-size: 2.2rem; line-height: 1; margin: .35rem 0 .25rem; }
.offer .price small { font-family: var(--sans); font-size: .95rem; color: var(--muted); font-weight: 400; }
.offer .meta { font-family: var(--mono); font-size: .78rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1rem; }
.offer ul { padding-left: 1.1rem; margin: 0 0 1.5rem; color: var(--ink-2); }
.offer li { margin-bottom: .35rem; }
.offer .btn { margin-top: auto; align-self: flex-start; }
.offer.featured h3::after { content: "Start here"; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--hold); margin-left: .6rem; vertical-align: middle; }

/* ---------- ledger list (trust signals etc.) ---------- */
.ledger { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.ledger li { display: grid; grid-template-columns: 1fr; gap: .25rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 48rem) { .ledger li { grid-template-columns: 16rem 1fr; } }
.ledger .k { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.ledger .v { color: var(--ink-2); }
.ledger .v p:last-child { margin-bottom: 0; }

/* ---------- method entries ---------- */
.stat { border-top: 1px solid var(--rule); padding: 2rem 0; display: grid; gap: .5rem 3rem; }
@media (min-width: 56rem) { .stat { grid-template-columns: 18rem 1fr; } }
.stat .tag { font-family: var(--mono); font-size: .75rem; color: var(--hold); letter-spacing: .08em; text-transform: uppercase; }
.stat h3 { margin-top: .2rem; }
.stat .body p { color: var(--ink-2); }
.cite { font-size: .88rem; color: var(--muted); border-left: 2px solid var(--hold); padding-left: .75rem; margin-top: .75rem; }
.cite a { color: inherit; }
.rule-line { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); background: var(--paper-2); padding: .5rem .7rem; border-radius: 3px; display: inline; line-height: 1.9; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1.5px solid var(--rule-strong); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.grade-letter { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; }

/* ---------- callouts ---------- */
.note { border-left: 3px solid var(--hold); background: var(--hold-soft); padding: 1rem 1.25rem; margin: 1.5rem 0; color: var(--ink); max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }
.note.plain { background: var(--paper-2); border-left-color: var(--accent); }
.draft-banner { background: var(--hold-soft); border-bottom: 1px solid var(--hold); font-size: .9rem; padding: .6rem 0; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--rule-strong); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.5rem; max-width: var(--measure); }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .45rem; width: 10px; height: 10px; background: var(--paper); border: 1.5px solid var(--ink); }
.timeline li.hold::before { background: var(--hold); border-color: var(--hold); }
.timeline .when { font-family: var(--mono); font-size: .8rem; color: var(--muted); display: block; }
.timeline p { color: var(--ink-2); margin: .2rem 0 0; }

/* ---------- key figures ---------- */
.figures { display: grid; gap: 0; border-top: 1.5px solid var(--rule-strong); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .figures { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .figures { grid-template-columns: repeat(4, 1fr); } }
.figures div { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--rule); }
.figures b { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.figures span { font-size: .9rem; color: var(--muted); }

/* ---------- samples ---------- */
.sample { display: grid; gap: .75rem 2rem; border-top: 1px solid var(--rule); padding: 1.75rem 0; }
@media (min-width: 48rem) { .sample { grid-template-columns: 6rem 1fr auto; align-items: start; } }
.sample .gradebox { width: 5rem; height: 5rem; border: 1.5px solid var(--ink); display: grid; place-items: center; font-family: var(--serif); font-size: 2.6rem; font-weight: 700; }
.sample[data-pending] .gradebox { border-style: dashed; color: var(--muted); font-size: 1.1rem; font-family: var(--mono); }
.sample .todo { font-family: var(--mono); font-size: .8rem; color: var(--hold); }
.sample[data-pending] .report-link { display: none; }
.sample:not([data-pending]) .pending-note { display: none; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--rule); padding: 1rem 0; max-width: var(--measure); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--hold); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); margin: .75rem 0 0; }

/* ---------- forms ---------- */
form.intake { max-width: 44rem; display: grid; gap: 1.4rem; }
.field { display: grid; gap: .35rem; }
.field label, .field legend { font-weight: 600; font-size: .98rem; }
.field .hint { font-size: .88rem; color: var(--muted); margin: 0; }
input[type=text], input[type=email], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--muted); border-radius: 3px; padding: .65rem .75rem; width: 100%;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
fieldset { border: 0; padding: 0; margin: 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: .35rem; width: 1.05rem; height: 1.05rem; flex: none; }
.hp { position: absolute; left: -5000px; }
.two { display: grid; gap: 1.4rem; }
@media (min-width: 40rem) { .two { grid-template-columns: 1fr 1fr; } }

/* ---------- two-column layout ---------- */
.split { display: grid; gap: 2rem 4rem; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1.5px solid var(--rule-strong); margin-top: 0; padding: 2.5rem 0 3rem; font-size: .9rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 52rem) { .site-footer .cols { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .disclaimer { max-width: 60ch; }

@media (prefers-reduced-motion: no-preference) {
  .plot .oos-draw { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.6s .4s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
@media print {
  .site-header nav, .theme-btn, .nav-toggle, .actions { display: none !important; }
  body { background: #fff; color: #000; }
}

/* grid children may shrink below content width (long code / rule lines on phones) */
.split > *, .stat > *, .hero .wrap > * { min-width: 0; }
