@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('/assets/atkinson-next-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/ibm-plex-mono-latin-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/ibm-plex-mono-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #e6e3cf;
  --surface: #f0eddd;
  --sheet: #eeecda;
  --text: #1a2121;
  --muted: #49504a;
  --line: #8e9487;
  --accent: #234d46;
  --accent-text: #f5f2df;
  --focus: #206251;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --space: clamp(1rem, 4vw, 3.5rem);
  --max: 76rem;
  font-family: 'Atkinson Hyperlegible Next', 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
::selection { background: #24574f; color: #fff; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; top: .75rem; left: .75rem; z-index: 3; padding: .5rem; background: var(--surface); }
.skip:not(:focus) { clip-path: inset(50%); }
.top, .wrap { width: min(100%, var(--max)); margin-inline: auto; padding-inline: var(--space); }
.top { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; position: relative; }
.top nav { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2rem); }
.top nav a { font-size: .9rem; }
.wordmark { display: inline-flex; align-items: center; gap: .38rem; font-family: var(--mono); font-size: 1.4rem; font-weight: 700; letter-spacing: -.08em; }
.wordmark::before { content: ''; width: 2rem; height: 2rem; background: currentColor; mask: url('/assets/tweak-mark.svg') center / 135% no-repeat; }
.nav-action { color: var(--accent); padding: .5rem 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space); align-items: center; padding-block: clamp(4rem, 10vw, 8.5rem); min-height: min(37rem, 72svh); }
h1, h2, p { margin: 0; }
h1 { font-family: var(--mono); font-size: clamp(2.7rem, 7vw, 5.7rem); line-height: .98; font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
h2 { font-size: clamp(1.15rem, 2.1vw, 1.55rem); font-weight: 660; letter-spacing: -.025em; line-height: 1.2; }
p { line-height: 1.6; color: var(--muted); }
.hero p { max-width: 33rem; margin-block: 1.6rem 2rem; font-size: clamp(1rem, 2.3vw, 1.22rem); }
.action { display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.9rem; border: 0; border-radius: 0; padding: .75rem 1.15rem; background: var(--text); color: var(--accent-text); font: inherit; font-weight: 680; cursor: pointer; }
.action:hover { background: var(--accent); color: var(--accent-text); }
.action:disabled { cursor: wait; opacity: .66; }
.arrow { display: inline-block; position: relative; width: 1.05rem; height: 1rem; flex: none; }
.arrow::before, .arrow::after { content: ''; position: absolute; }
.arrow::before { top: .45rem; left: .08rem; width: .84rem; border-top: 1px solid currentColor; }
.arrow::after { top: .23rem; right: .09rem; width: .44rem; height: .44rem; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.hero-sheet { padding: 1.55rem 2rem 1.35rem; background: var(--sheet); border: 1px solid #a9ab98; }
.sheet-scale { height: .65rem; background: repeating-linear-gradient(90deg, #7b8474 0 1px, transparent 1px 15px); opacity: .66; }
.sheet-measures { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem; margin: 1.45rem 0 1.6rem; }
.sheet-measures span, .hero-sheet label, .ratio-control label { display: block; font-size: .88rem; color: var(--muted); }
.sheet-measures strong { display: block; margin-top: .4rem; font: 700 clamp(2rem, 4vw, 3.4rem)/1 var(--mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.sheet-measures small { display: inline-block; margin-left: .3rem; font: 600 .8rem var(--mono); white-space: nowrap; color: var(--muted); }
.sheet-link, .plain-link { color: var(--accent); font-weight: 680; }
.sheet-link { display: inline-flex; align-items: center; gap: .52rem; }
.sheet-link:hover, .plain-link:hover { color: var(--text); }
.hero-sheet .sheet-link { margin-top: 1.2rem; }
.size-range { --range-fill: 25%; appearance: none; display: block; width: 100%; height: 2rem; margin: .2rem 0 0; background: transparent; cursor: pointer; }
.size-range::-webkit-slider-runnable-track { height: .32rem; background: linear-gradient(to right,var(--accent) 0 var(--range-fill),#bcc0ad var(--range-fill) 100%); }
.size-range::-moz-range-track { height: .32rem; background: linear-gradient(to right,var(--accent) 0 var(--range-fill),#bcc0ad var(--range-fill) 100%); }
.size-range::-webkit-slider-thumb { appearance: none; width: 1.08rem; height: 1.38rem; margin-top: -.53rem; border: 2px solid var(--accent); background: var(--sheet); }
.size-range::-moz-range-thumb { width: .9rem; height: 1.14rem; border: 2px solid var(--accent); border-radius: 0; background: var(--sheet); }
.size-range:hover::-webkit-slider-thumb { background: #c9dfcb; }
.size-range:hover::-moz-range-thumb { background: #c9dfcb; }
.range-endpoints { display: flex; justify-content: space-between; color: var(--muted); font: .78rem var(--mono); }
.home-section { margin-block: clamp(3.2rem, 8vw, 8rem); }
.home-section h2 { font: 700 clamp(2.1rem, 4.3vw, 3.7rem)/1.02 var(--mono); letter-spacing: -.04em; text-wrap: balance; }
.home-section h2 + p { margin-top: 1rem; max-width: 45ch; }
.reading, .lab, .ask { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(1.35rem, 5vw, 5rem); }
.reading-sheet { background: var(--surface); padding: 1.6rem; }
.reading-sheet table { min-width: 0; font-size: clamp(.72rem,1.3vw,1rem); }
.reading-sheet th, .reading-sheet td { padding: .63rem .35rem; }
.reading-sheet th { font-weight: 680; }
.reading-sheet tr:last-child td:last-child { color: #87402e; font-weight: 700; }
.example-label { font-size: .83rem; margin-bottom: .7rem; }
.reading-note { margin-top: .7rem; font-size: .88rem; }
.lab { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: stretch; }
.lab img { width: 100%; height: 100%; min-height: 20rem; object-fit: cover; display: block; }
.lab-copy { padding: clamp(1.4rem,4vw,3.2rem); align-content: center; background: #1b2925; color: var(--accent-text); }
.lab-copy p { color: #d1d9c7; }
.lab-copy .sheet-link { margin-top: 1.2rem; color: var(--accent-text); }
.lab-copy .sheet-link:hover { color: #bcdbc8; }
.ask { align-items: start; }
.questions summary { list-style: none; position: relative; cursor: pointer; padding: .95rem 2.1rem .95rem 0; font-weight: 680; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after, .questions summary::before { content: ''; position: absolute; right: .45rem; top: 50%; width: .8rem; border-top: 1px solid currentColor; }
.questions summary::before { transform: rotate(90deg); }
.questions details[open] summary::before { display: none; }
.questions details + details { border-top: 1px solid #b8bca8; }
.questions details p { margin: 0 1.2rem .8rem 0; }
.close { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.3rem; padding: clamp(1.5rem,4vw,3rem); background: #d5d8c0; }
.close h2 { max-width: 20ch; }
.foot-surface { background: #17201c; color: #e7ebd9; }
.foot { min-height: 6rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; font: .83rem var(--mono); }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; }
.foot a:hover { color: #b6d0bc; }
.work, .docs { padding-block: clamp(2.5rem, 6vw, 6rem); }
.work h1, .docs h1 { font-size: clamp(2.65rem, 5.4vw, 5.3rem); }
.intro { margin-top: .85rem; }
.quote-form { margin-top: 2.2rem; padding: 1.6rem; background: var(--sheet); }
.controls { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr auto; gap: .8rem; align-items: end; }
.controls fieldset { min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.controls legend, .amount { font-size: .92rem; }
.segments, .input-shell { display: flex; align-items: center; min-height: 2.9rem; margin-top: .5rem; border: 1px solid var(--line); background: var(--surface); }
.segments label { flex: 1; position: relative; cursor: pointer; }
.segments input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.segments span { display: block; padding: .65rem .6rem; text-align: center; color: var(--muted); }
.segments input:checked + span { background: var(--text); color: var(--accent-text); }
.segments input:not(:checked):hover + span { background: #e1e1cc; color: var(--text); }
.segments input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.input-shell { padding-inline: .65rem; gap: .45rem; }
.input-shell:focus-within { border-color: var(--focus); }
.input-shell input { min-width: 0; width: 100%; padding: .5rem 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.03rem; font-variant-numeric: tabular-nums; }
.input-shell input:focus { outline: none; }
.input-shell span, .note { font-size: .82rem; color: var(--muted); }
.note { margin-top: .8rem; }
.ratio-control { display: grid; grid-template-columns: auto minmax(5rem,18rem) 4.3rem; gap: 0 .9rem; align-items: center; margin-top: 1.25rem; }
.ratio-control .note { grid-column: 1 / -1; margin-top: .1rem; }
.ratio-control output { font: 700 .9rem var(--mono); color: var(--accent); }
.status { margin-block: 1.2rem; min-height: 1.6rem; }
.status[data-state='error'] { color: #8b3526; }
.results { margin-top: 2.1rem; }
.results-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; }
.results-top p { font-size: .82rem; }
.results-top a { color: var(--accent); }
.result-lead { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin-block: 1.1rem; }
.result-lead > div { padding: .9rem; background: #d9deca; overflow-wrap: anywhere; }
.result-lead strong { display: block; margin-block: .2rem; font: 700 clamp(1.05rem,2vw,1.7rem) var(--mono); }
.result-lead p { font-size: .8rem; }
.scroll-table { overflow-x: auto; margin-top: .8rem; }
table { width: 100%; min-width: 34rem; border-collapse: collapse; text-align: left; font-family: var(--mono); font-variant-numeric: tabular-nums; }
th, td { padding: .85rem .65rem; vertical-align: top; }
thead { background: var(--surface); }
thead th { color: var(--muted); font-weight: 550; }
tbody th a { color: var(--accent); }
tbody td[data-quote='muted'] { color: var(--muted); }
.quote-value { display: block; font-size: 1.04rem; color: var(--text); }
.quote-value[data-best] { color: var(--accent); }
.quote-rate { display: block; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.work-note { margin-block: 3rem 0; }
.work-note p { margin-top: .55rem; max-width: 68ch; }
.docs-layout { display: grid; grid-template-columns: minmax(8rem, .35fr) minmax(0, 1fr); gap: var(--space); margin-top: 2.5rem; }
.docs-layout nav { display: flex; align-self: start; flex-direction: column; gap: .85rem; color: var(--accent); position: sticky; top: 1.2rem; }
.docs-layout article { max-width: 44rem; }
.docs-layout section + section { margin-top: 2.6rem; }
.docs-layout p { margin-top: .6rem; }
.docs-layout li { margin-block: .6rem; color: var(--accent); }
.docs-layout ol { padding-left: 1.3rem; }
.docs-layout ol li { color: var(--muted); line-height: 1.5; }
.docs-layout dt { font-weight: 680; margin-block: .9rem .2rem; }
.docs-layout dd { margin: 0; color: var(--muted); line-height: 1.55; }
@media (max-width: 54rem) {
  .controls { grid-template-columns: 1fr 1fr; }
  .controls fieldset { grid-column: 1 / -1; max-width: 14rem; }
  .controls button { justify-self: start; }
}
@media (max-width: 41rem) {
  .hero { grid-template-columns: 1fr; gap: 2.25rem; padding-block: 3rem 2.5rem; }
  .hero p { margin-block: 1.25rem 1.55rem; }
  .hero-sheet, .reading-sheet, .quote-form { padding-inline: 1rem; }
  .reading, .lab, .ask, .docs-layout { grid-template-columns: 1fr; }
  .lab { gap: 0; }
  .lab img { min-height: 0; height: auto; }
  .ratio-control { grid-template-columns: 1fr 4.1rem; }
  .ratio-control label { grid-column: 1 / -1; }
  .docs-layout nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .results table { min-width: 0; table-layout: fixed; font-size: .73rem; }
  .results thead th:first-child { width: 15%; }
  .results thead th:last-child { width: 21%; }
  .results th, .results td { padding: .7rem .28rem; overflow-wrap: anywhere; }
  .results td:last-child { font-family: 'Atkinson Hyperlegible Next', 'Segoe UI', sans-serif; }
  .quote-value { font-size: .85rem; }
  .quote-rate { font-size: .7rem; }
}
