@font-face {
  font-family: "Instrument Sans";
  src: url("./assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Baskervville";
  src: url("./assets/fonts/baskervville.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Baskervville";
  src: url("./assets/fonts/baskervville-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ivory: #faf7f3;
  --ink: #251d2b;
  --muted: #665d63;
  --plum: #572e55;
  --plum-deep: #3d233d;
  --plum-pale: #f7f1f6;
  --gold: #946530;
  --line: #e9e2d9;
  --line-strong: #d9cfc5;
  --serif: "Baskervville", Baskerville, Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --rail: clamp(168px, 14.4vw, 218px);
  --gutter: clamp(24px, 4.15vw, 64px);
  --page-width: 1500px;
  --tabbar: 62px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 18px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
button, select, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .2em; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 4px;
}
p, h1, h2, h3, h4, dl, dd { margin: 0; }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 400; }
h1, h2, h3 { line-height: 1.13; }
h2 { font-size: clamp(2.25rem, 3.45vw, 3.4rem); }
h3 { font-size: clamp(1.55rem, 2.15vw, 2.15rem); }
h4 { font-weight: 590; }
.wrap { width: min(calc(100% - var(--gutter) * 2), var(--page-width)); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; z-index: 15; top: 8px; left: 8px; background: var(--plum); color: var(--paper); padding: 10px 14px; }
.eyebrow { font-size: .765rem; line-height: 1.45; font-weight: 650; letter-spacing: .145em; text-transform: uppercase; color: var(--gold); }

.site-rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 4; border-right: 1px solid var(--line);
  background: #fcfaf7; display: flex; flex-direction: column; padding: 34px clamp(15px, 1.85vw, 30px) 28px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; width: fit-content; white-space: nowrap; text-decoration: none; font-size: 1.35rem; line-height: 1.14; color: var(--ink); }
.brand-gem {
  display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; flex: none;
  background: var(--plum); color: #fff1d9;
}
.brand-gem::before, .brand-gem::after { grid-area: 1 / 1; width: 11px; height: 11px; content: ""; transform: rotate(45deg); }
.brand-gem::before { border: 1px solid currentColor; border-radius: 1px; }
.brand-gem::after { border: 1px solid currentColor; border-width: 1px 0 0 1px; width: 6px; height: 6px; }
.site-nav { display: grid; gap: 5px; margin-top: 48px; }
.site-nav a {
  display: flex; align-items: center; min-height: 45px; gap: 11px; text-decoration: none; color: var(--muted);
  padding: 8px 11px; font-size: .95rem; font-weight: 555; border: 1px solid transparent; border-radius: 7px;
}
.site-nav a:hover { color: var(--plum); background: #f7f1ed; }
.site-nav a[aria-current="location"] { color: var(--plum); background: #f3eaf1; border-color: #eee1eb; font-weight: 650; }
.nav-icon { display: inline-grid; place-items: center; width: 17px; color: var(--gold); font: 400 1.22rem/1 Georgia, serif; }
.site-nav a[aria-current="location"] .nav-icon { color: var(--plum); }
.rail-meta { margin: auto 0 0 5px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .79rem; color: var(--muted); line-height: 1.6; }
.page { margin-left: var(--rail); }
.mobile-masthead { display: none; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .94fr); align-items: center;
  gap: 25px 34px; padding-top: clamp(30px, 4.4vw, 64px); border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(3.25rem, 4.95vw, 5.4rem); line-height: 1.02; margin: 13px 0 17px; }
.hero h1 em { color: var(--plum); font-weight: 400; }
.hero-intro { color: var(--muted); max-width: 33ch; font-size: clamp(1rem, 1.38vw, 1.15rem); line-height: 1.52; }
.primary-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 21px; padding: 8px 19px;
  background: var(--plum); color: white; text-decoration: none; border-radius: 6px; font-weight: 580; font-size: .95rem;
  transition: background-color .17s ease;
}
.primary-action:hover { background: var(--plum-deep); }
.hero-art {
  position: relative; align-self: stretch; min-height: 320px; overflow: hidden; border-radius: 8px;
  background: radial-gradient(ellipse at 57% 46%, #fffdf9, #f0e6dd); border: 1px solid #eddfd1;
}
.hero-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 56% center; }
.hero-stats {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block: 3px 0;
  padding: 17px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.hero-stats div { display: flex; flex-direction: column-reverse; justify-content: start; gap: 3px; padding-inline: clamp(13px, 2.5vw, 38px); border-left: 1px solid var(--line); }
.hero-stats div:first-child { padding-left: 0; border-left: 0; }
.hero-stats dt { color: var(--muted); font-size: .84rem; line-height: 1.3; }
.hero-stats dd { font: 400 clamp(1.8rem, 3.15vw, 2.6rem)/.94 var(--serif); }

.section-models, .learning-section, .compare-section, .dataset-section, .methodology { margin-top: clamp(43px, 5.4vw, 77px); }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 21px; }
.section-title .eyebrow, .panel-heading .eyebrow { margin-bottom: 5px; }
.section-title > p { color: var(--muted); max-width: 34ch; line-height: 1.45; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.notice { padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--ivory); color: var(--muted); }

.model-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 15px; }
.model-option {
  position: relative; width: 100%; min-width: 0; min-height: 77px; display: grid; grid-template-columns: 30px 1fr; align-items: start;
  gap: 8px; text-align: left; padding: 12px 10px; border: 0;
  background: var(--paper); color: var(--ink);
}
.model-option:first-child { border-radius: 7px 0 0 7px; }
.model-option:last-child { border: 0; border-radius: 0 7px 7px 0; }
.model-option:hover { background: var(--ivory); }
.model-option[aria-pressed="true"] { background: var(--plum-pale); color: var(--plum-deep); cursor: default; }
.model-option[aria-pressed="true"]::after { position: absolute; content: ""; inset: auto 0 0; height: 2px; background: var(--plum); }
.model-icon {
  display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px;
  width: 27px; height: 27px; color: var(--plum); background: white; font: 1.03rem/1 Georgia, serif;
}
.model-option[aria-pressed="true"] .model-icon { border-color: #e2cdde; }
.model-name { display: block; font-size: 1rem; font-weight: 650; line-height: 1.25; }
.model-method { display: block; margin-top: 4px; color: var(--muted); font-size: .85rem; line-height: 1.22; }
.best-label { display: block; margin-top: 5px; color: var(--gold); font-size: .74rem; line-height: 1.25; }

.explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(247px, 25%); gap: 15px; align-items: stretch; }
.chart-panel { grid-column: 1; grid-row: 1; padding: clamp(15px, 2.1vw, 26px); }
.chart-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chart-heading p { margin-top: 7px; color: var(--muted); }
.chart-score {
  display: flex; flex-direction: column; align-items: end; gap: 2px; flex: none; padding: 6px 10px; border-radius: 7px;
  background: var(--ivory); color: var(--muted); border: 1px solid var(--line); text-decoration: none; font-size: .78rem;
}
.chart-score:hover { border-color: var(--gold); }
.chart-score strong { color: var(--plum); font: 400 1.65rem/1.01 var(--serif); }
.chart-tabs { display: flex; align-items: center; gap: clamp(7px, 2.1vw, 24px); border-bottom: 1px solid var(--line); }
.chart-tabs button { position: relative; flex: none; border: 0; background: none; color: var(--muted); min-height: 43px; padding: 5px 2px; font-weight: 580; font-size: .94rem; }
.chart-tabs button:hover { color: var(--plum); }
.chart-tabs button[aria-selected="true"] { color: var(--plum); font-weight: 700; }
.chart-tabs button[aria-selected="true"]::after { position: absolute; content: ""; inset: auto 0 -1px; height: 2px; background: var(--plum); }
.chart-tabs button:focus-visible { outline-offset: 0; }
.chart-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 38px; padding-top: 3px; }
.legend, .chart-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; color: var(--muted); font-size: .825rem; }
.legend { padding-block: 9px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ad98a5; }
.legend .legend-line { width: 16px; height: 2px; border-radius: 2px; background: #592c58; }
.legend .legend-selected, .legend .legend-recorded { transform: rotate(45deg); border-radius: 1px; }
.legend .legend-selected { background: #a4753c; }
.legend .legend-recorded { background: white; border: 1.5px solid #755171; }
.legend .legend-ref, .legend .legend-baseline { width: 16px; height: 0; border-radius: 0; background: none; border-top: 1.5px dashed #87788b; }
.plot-option { display: inline-flex; align-items: center; gap: 5px; min-height: 39px; cursor: pointer; }
.plot-option input { accent-color: var(--plum); width: 14px; height: 14px; margin: 0; }
.plot-option:has(input:disabled) { color: #7b7078; cursor: default; }
.chart-wrap { position: relative; }
#regression-chart { display: block; width: 100%; height: clamp(400px, 36vw, 525px); }
.chart-tooltip {
  position: absolute; z-index: 2; width: max-content; max-width: min(235px, 85%); padding: 8px 10px;
  background: white; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px;
  pointer-events: none; font-size: .85rem; box-shadow: 0 3px 16px #3d263c18;
}
.chart-tip-heading { display: block; margin-bottom: 3px; color: var(--plum); }
.chart-tip-row { display: flex; justify-content: space-between; gap: 13px; }
.chart-insight { font-size: .93rem; min-height: 2em; color: var(--muted); }
.chart-insight strong { color: var(--ink); font-weight: 650; }
.chart-range-note { color: var(--gold); }

.profile-panel { grid-column: 2; grid-row: 1; padding: 17px; background: #fdfbf9; }
.profile-heading, .presets-heading, .field-top { display: flex; justify-content: space-between; gap: 7px; align-items: center; }
.profile-heading { margin-bottom: 12px; }
.quiet-button {
  padding: 4px 0; min-height: 36px; border: 0; background: transparent; color: var(--plum);
  font-size: .89rem; text-decoration: underline; text-underline-offset: 3px;
}
.quiet-button:hover { color: var(--gold); }
.estimate { display: grid; gap: 3px; background: var(--plum-pale); border: 1px solid #e9dae6; border-radius: 7px; padding: 12px; }
.estimate-label { color: var(--muted); font-size: .86rem; }
#price-output { color: var(--plum-deep); font: 400 clamp(2.6rem, 4.3vw, 3.6rem)/.98 var(--serif); white-space: nowrap; }
#estimate-context { color: var(--muted); font-size: .81rem; line-height: 1.38; }
#profile-form { margin-top: 16px; }
.field-top label:first-child, .select-grid label { font-size: .91rem; font-weight: 590; }
.weight-entry {
  display: inline-flex; gap: 3px; align-items: center; min-height: 36px; padding: 3px 7px;
  background: white; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--muted); font-size: .9rem;
}
.weight-entry input { width: 45px; padding: 0; border: 0; text-align: right; color: var(--plum); font-weight: 650; font-variant-numeric: tabular-nums; background: transparent; appearance: textfield; }
.weight-entry input::-webkit-inner-spin-button, .weight-entry input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.weight-entry:has(input[aria-invalid="true"]) { border-color: #a24a47; }
.weight-feedback { color: #883930; font-size: .82rem; line-height: 1.35; margin-top: 6px; }
#carat { width: 100%; margin: 5px 0 0; height: 25px; accent-color: var(--plum); cursor: ew-resize; }
.range-limits { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.select-grid { display: grid; grid-template-columns: 47px minmax(0, 1fr); gap: 8px 7px; align-items: center; margin-top: 15px; }
.select-grid select {
  appearance: none; width: 100%; min-width: 0; height: 40px; padding: 4px 24px 4px 9px; border: 1px solid var(--line-strong);
  border-radius: 5px; color: var(--ink); background-color: white; font-size: .96rem;
  background-image: linear-gradient(45deg, transparent 50%, #625265 50%), linear-gradient(135deg, #625265 50%, transparent 50%);
  background-size: 4px 4px; background-repeat: no-repeat; background-position: calc(100% - 13px) center, calc(100% - 9px) center;
}
.select-grid select:hover { border-color: var(--gold); }
.profile-note { min-height: 2em; margin-top: 12px; color: var(--muted); font-size: .86rem; line-height: 1.42; }
.presets { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 9px; }
.presets-heading h4 { font-size: .91rem; }
.preset-options { display: grid; gap: 6px; }
.preset-option {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 5px; min-height: 38px; padding: 5px 7px;
  border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); text-align: left; font-size: .88rem; line-height: 1.24;
}
.preset-option small { color: var(--muted); font-size: .79rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.preset-option:hover, .preset-option[aria-pressed="true"] { border-color: #c5a6bf; background: var(--plum-pale); }

.same-stone { margin-top: 22px; }
.same-stone-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 11px; }
.same-stone-heading h3 { font-size: clamp(1.6rem, 2.25vw, 2.15rem); }
.same-stone-heading p { color: var(--muted); font-size: .88rem; }
.quote-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; }
.quote {
  display: grid; align-content: start; gap: 3px; min-width: 0; min-height: 94px; padding: 10px 14px;
  border: 0; text-align: left; background: white; color: var(--muted);
}
.quote:first-child { border-radius: 7px 0 0 7px; }
.quote:last-child { border: 0; border-radius: 0 7px 7px 0; }
.quote:hover, .quote[aria-pressed="true"] { background: var(--plum-pale); }
.quote strong { font: 400 1.96rem/1 var(--serif); color: var(--ink); white-space: nowrap; }
.quote[aria-pressed="true"] strong { color: var(--plum); }
.quote span:first-child { font-size: .88rem; font-weight: 595; }
.quote small { font-size: .79rem; line-height: 1.25; }

.lesson-panel { margin-top: 21px; padding: clamp(16px, 2.5vw, 30px); }
.panel-heading { margin-bottom: 15px; }
.lesson-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(15px, 3vw, 31px); }
.formula-block {
  display: grid; align-items: center; min-height: 59px; padding: 11px 14px;
  border-radius: 5px; border: 1px solid var(--line); border-left: 3px solid #ac875f; background: var(--ivory);
  color: var(--plum); font: 1rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.formula-terms { display: grid; grid-template-columns: minmax(43px, auto) 1fr; gap: 7px 11px; margin-top: 12px; font-size: .9rem; }
.formula-terms dt { font-family: var(--mono); color: var(--plum); max-width: 16ch; overflow-wrap: anywhere; }
.formula-terms dd { color: var(--muted); min-width: 0; }
.lesson-explanation { min-width: 0; }
.lesson-note { margin-top: 12px; font-size: .93rem; }
.fitted-detail { margin-top: 12px; padding: 9px 10px; background: var(--ivory); border-radius: 5px; border: 1px solid var(--line); }
.fitted-detail summary { color: var(--plum); cursor: pointer; font-weight: 620; font-size: .91rem; }
.fitted-detail > div { padding-top: 9px; font-size: .89rem; }
.fitted-detail p + p { margin-top: 5px; }
.fitted-detail dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 9px; margin: 7px 0; }
.fitted-detail dd { font-family: var(--mono); text-align: right; }
.fit-calculation { color: var(--plum); font: .85rem/1.6 var(--mono); overflow-wrap: anywhere; }
.tree-example { border-left: 2px solid #bb9467; padding: 1px 10px 3px; margin-block: 10px 2px; color: var(--muted); }
.tree-example h4 { color: var(--ink); font-size: .94rem; }
.tree-example ol { margin: 6px 0; padding-left: 19px; }
.fitted-source { display: inline-block; color: var(--plum); font-size: .87rem; margin-top: 9px; }

.dataset-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 13px; background: var(--line); }
.dataset-stats div { display: flex; flex-direction: column-reverse; gap: 4px; padding: 13px 14px; background: var(--ivory); }
.dataset-stats dt { color: var(--muted); font-size: .86rem; line-height: 1.3; }
.dataset-stats dd { color: var(--plum-deep); font: 400 clamp(1.25rem, 2.2vw, 2rem)/1.1 var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dataset-panel { padding: 17px 18px 8px; }
.dataset-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 10px; }
.dataset-head p { font-size: .93rem; }
.table-wrap { overflow-x: auto; padding: 1px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .94rem; }
th, td { padding: 9px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .84rem; font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
td:nth-child(5), td:first-child { font-variant-numeric: tabular-nums; }
td:last-child { text-align: right; }
.sample-button { padding: 4px 9px; min-height: 35px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--ivory); color: var(--plum); font-size: .89rem; font-weight: 580; }
.sample-button:hover { border-color: var(--plum); }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.method-grid article { padding: 17px; }
.method-grid article h3 { font-size: clamp(1.4rem, 2.2vw, 1.86rem); }
.method-grid article p { color: var(--muted); margin-top: 7px; font-size: .94rem; }
.site-footer { margin-top: 50px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 58px; gap: 7px 16px; }
.footer-inner span:first-child { color: var(--plum); font: 400 1.65rem/1 var(--serif); }

@media (min-width: 900px) and (max-width: 1200px) {
  .site-rail { padding-inline: 13px; }
  .site-rail .brand { font-size: 1.125rem; gap: 7px; }
  .site-rail .brand-gem { width: 25px; height: 25px; }
}
@media (max-width: 1179px) {
  .explorer { grid-template-columns: minmax(0, 1fr); }
  .chart-panel { grid-row: auto; }
  .profile-panel {
    grid-column: 1; display: grid; grid-template-columns: 1fr 1.12fr; gap: 0 18px;
    grid-template-areas: "heading heading" "estimate form" "note form" "presets presets";
  }
  .profile-heading { grid-area: heading; }
  .estimate { grid-area: estimate; }
  #profile-form { grid-area: form; margin-top: 0; }
  .profile-note { grid-area: note; }
  .presets { grid-area: presets; }
  .preset-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .select-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 7px; }
  .select-grid label:nth-of-type(1) { grid-area: 1 / 1; }
  .select-grid label:nth-of-type(2) { grid-area: 1 / 2; }
  .select-grid label:nth-of-type(3) { grid-area: 1 / 3; }
  .select-grid select { padding-left: 6px; font-size: .91rem; }
}
@media (max-width: 899px) {
  html { overflow-x: clip; scroll-padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); }
  body { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .page { margin-left: 0; }
  .site-rail { position: static; display: contents; }
  .site-rail > .brand, .rail-meta { display: none; }
  .site-nav {
    position: fixed; inset: auto 0 0; z-index: 5; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0; margin: 0; padding: 4px 5px env(safe-area-inset-bottom); background: #fdfbf8f7; border-top: 1px solid var(--line-strong);
  }
  .site-nav a { position: relative; flex-direction: column; justify-content: center; gap: 3px; padding: 3px 2px; min-height: calc(var(--tabbar) - 5px); font-size: .83rem; line-height: 1.1; }
  .nav-icon { font-size: 1.25rem; }
  .site-nav a[aria-current="location"] { border-color: transparent; }
  .site-nav a[aria-current="location"]::after { position: absolute; content: ""; width: 22px; height: 2px; top: 2px; background: var(--plum); }
  .mobile-masthead { display: block; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); }
  .hero { padding-top: 23px; gap: 18px 20px; }
  .hero-art { min-height: 269px; }
  .hero h1 { font-size: clamp(2.9rem, 5.9vw, 4.6rem); }
}
@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero h1 { font-size: clamp(2.7rem, 9.5vw, 4.05rem); margin-block: 8px 10px; }
  .hero-break { display: none; }
  .hero-intro { max-width: 41ch; }
  .primary-action { margin-top: 14px; }
  .hero-art { min-height: 0; aspect-ratio: 1.64; }
  .hero-art img { object-position: center 58%; }
  .hero-stats { padding-block: 12px; margin: 0; }
  .hero-stats dd { font-size: 1.85rem; }
  .hero-stats dt { font-size: .77rem; }
  .section-title, .same-stone-heading, .dataset-head { display: block; }
  .section-title > p, .same-stone-heading p, .dataset-head p { margin-top: 5px; }
  .model-options, .quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-option:nth-child(2), .quote:nth-child(2) { border-right: 0; border-radius: 0 7px 0 0; }
  .model-option:nth-child(1), .quote:nth-child(1) { border-radius: 7px 0 0 0; }
  .model-option:nth-child(3), .quote:nth-child(3) { border-radius: 0 0 0 7px; }
  .model-option:nth-child(4), .quote:nth-child(4) { border-radius: 0 0 7px 0; }
  .model-option:last-child, .quote:last-child { grid-column: 1 / -1; border-radius: 0 0 7px 7px; }
  .profile-panel { padding: 13px; gap: 0 11px; }
  .profile-heading { margin-bottom: 7px; }
  .chart-panel { padding: 13px 10px; }
  .chart-heading { margin-inline: 2px; gap: 7px; margin-bottom: 8px; }
  .chart-heading h3 { font-size: 1.55rem; }
  .chart-heading p { font-size: .94rem; line-height: 1.42; }
  .chart-tabs { gap: clamp(5px, 3vw, 20px); }
  .chart-tabs button { font-size: .89rem; min-height: 44px; }
  .plot-option { min-height: 44px; font-size: .84rem; }
  .legend { padding-block: 7px; }
  #regression-chart { height: clamp(325px, 76vw, 410px); }
  .lesson-layout, .method-grid { grid-template-columns: minmax(0, 1fr); }
  .dataset-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dataset-panel { padding-inline: 10px; }
  .footer-inner { flex-wrap: wrap; padding-block: 10px; }
}
@media (max-width: 470px) {
  .profile-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "heading" "estimate" "form" "note" "presets"; }
  #profile-form { margin-top: 12px; display: grid; grid-template-columns: 1fr; }
  .select-grid { margin-top: 8px; }
  .preset-option { justify-content: start; align-content: center; min-height: 46px; }
  .profile-note { min-height: 0; }
  .chart-score { text-align: end; padding-inline: 5px; max-width: 78px; line-height: 1.15; }
  .chart-score strong { font-size: 1.47rem; }
  .chart-switches { gap: 0 12px; }
}
@media (max-width: 340px) {
  :root { --gutter: 12px; }
  .site-nav a { font-size: .77rem; }
  .model-option { gap: 4px; padding-inline: 5px; }
  .chart-tabs { gap: 8px; }
  .chart-tabs button { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.secondary-action { display: inline-flex; align-items: center; color: var(--plum); font-weight: 600; font-size: .93rem; padding: 8px 3px; }
.hero .secondary-action { margin-left: 11px; }
.explorer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin: 0 0 9px; }
.compare-fits-action { margin: 0; min-height: 40px; padding: 6px 14px; border: 1px solid transparent; }
@media (max-width: 460px) {
  .site-nav a { font-size: .75rem; }
  .site-nav { gap: 0; }
}
