@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/fraunces-display-560.woff2") format("woff2");
  unicode-range: U+20, U+2C-2E, U+30-39, U+53, U+63-65, U+72, U+2014;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/outfit-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/outfit-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #12181f;
  --paper: #f7f5f2;
  --stone: #e6e2db;
  --text: #1a1f24;
  --text-on-dark: #f4f1eb;
  --muted-dark: #a39e96;
  --muted: #5c5852;
  --accent: #1f6b56;
  --accent-on-dark: #4eae8e;
  --accent-deep: #185744;
  --hair-light: rgba(18, 24, 31, 0.12);
  --hair-dark: rgba(244, 241, 235, 0.14);
  --danger: #8d3b32;
  --sans: "Outfit", "Avenir Next", "Century Gothic", "Trebuchet MS", "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --shadow: 0 18px 50px rgba(18, 24, 31, 0.12);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--ink); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text-on-dark);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
}

::selection { background: rgba(78, 174, 142, 0.35); color: var(--text-on-dark); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.55rem;
  background: var(--paper);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  z-index: 6;
  border-radius: 6px;
  transform: translateY(-180%);
}

.skip:focus { transform: none; }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--text-on-dark);
  outline-offset: 3px;
}

.panel :focus-visible,
.ledger :focus-visible,
.sheet :focus-visible {
  outline-color: var(--text);
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

a:hover { color: var(--accent-deep); }

.bar {
  background: var(--ink);
  border-bottom: 1px solid var(--hair-dark);
  position: sticky;
  top: 0;
  z-index: 4;
}

.bar-inner {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
  color: var(--text-on-dark);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 500;
  font-synthesis: none;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand:hover { color: var(--text-on-dark); }

.mark {
  width: 1.15rem;
  height: 2px;
  background: var(--accent-on-dark);
  display: inline-block;
  flex: none;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.15rem 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.15rem 0;
}

.switch::-webkit-scrollbar { display: none; }

.switch a {
  color: rgba(244, 241, 235, 0.72);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 180ms ease, box-shadow 180ms ease;
}

.switch a:hover { color: var(--text-on-dark); }

.switch a[aria-current] {
  color: var(--accent-on-dark);
  box-shadow: inset 0 -2px 0 var(--accent-on-dark);
}

.switch a:focus-visible {
  outline-offset: -2px;
}

.workspace {
  background: var(--ink);
  color: var(--text-on-dark);
}

.bench {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
  padding: 1.2rem 0 1.5rem;
}

.readout { display: contents; }

.stage { order: 1; min-width: 0; }

.panel { order: 2; min-width: 0; }

.figure { order: 3; min-width: 0; }

.crumbs {
  font-size: 0.84rem;
  margin: 0 0 0.7rem;
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0;
  margin: 0;
}

.crumbs a {
  color: var(--muted-dark);
  text-decoration: none;
}

.crumbs a:hover { color: var(--text-on-dark); }

.crumbs [aria-current="page"] { color: var(--text-on-dark); }

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.3rem;
  color: var(--muted-dark);
}

.stage h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--text-on-dark);
  margin: 0 0 0.2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  margin: 0 0 0.7rem;
}

.hero-num {
  font-family: var(--display);
  font-weight: 500;
  font-synthesis: none;
  font-size: clamp(4rem, 8vw, 7.25rem);
  line-height: 0.84;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-on-dark);
}

.hero-unit {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--muted-dark);
}

.summary {
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 0.7rem;
  max-width: 38ch;
  color: var(--text-on-dark);
  text-wrap: pretty;
}

.alt-model {
  margin: 0 0 0.7rem;
  max-width: 42ch;
  font-size: 0.92rem;
  color: #d4cfc6;
}

.vols {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0 0 0.45rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.vols > div {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.15rem 0.65rem;
  align-items: baseline;
}

.vols dt { margin: 0; color: var(--muted-dark); }

.vols dd { margin: 0; color: var(--text-on-dark); }

.stage .hint,
.figure .hint {
  margin: 0.15rem 0 0;
  max-width: 40ch;
  color: var(--muted-dark);
  font-size: 0.84rem;
}

.page-link-row {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
}

.stage a { color: var(--accent-on-dark); }

.stage a:hover { color: var(--text-on-dark); }

.panel {
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--hair-light);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.15rem 1.2rem;
  transition: border-color 180ms ease;
}

.panel ::selection { background: rgba(31, 107, 86, 0.2); color: var(--text); }

.group h3,
.prices > legend,
.choice > legend,
.choice-name {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
  padding: 0;
}

.group + .group,
.prices {
  border-top: 1px solid var(--hair-light);
  margin-top: 0.2rem;
  padding-top: 1rem;
}

.dim {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.32rem;
  margin: 0 0 0.8rem;
}

.dim > label,
.prices label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3c423e;
  line-height: 1.3;
}

.pair {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
}

.pair .num {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  background: #fff;
  border: 1px solid var(--hair-light);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 2.1rem 0 0.75rem;
  transition: border-color 180ms ease;
}

.pair:not(:has(.unit)) .num { padding-right: 0.75rem; }

.pair .unit {
  margin-left: -2rem;
  margin-right: 0.2rem;
  pointer-events: none;
}

.pair .num:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.pair:has(select) {
  background: #fff;
  border: 1px solid var(--hair-light);
  border-radius: 8px;
  padding: 0 0.55rem 0 0.75rem;
  min-height: 44px;
  gap: 0;
  transition: border-color 180ms ease;
}

.pair:has(select) .num {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0 0.4rem 0 0;
}

.pair:has(select):focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pair:has(select) .num:focus-visible,
.pair:has(select) select:focus-visible { outline: none; }

.pair > select {
  flex: 0 0 auto;
  width: auto;
  max-width: 7.2rem;
  min-height: 44px;
  border: 0;
  border-left: 1px solid var(--hair-light);
  background-color: transparent;
  padding-left: 0.6rem;
  margin-left: 0.15rem;
}

.unit {
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

input,
select,
button {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
}

input,
select {
  min-height: 44px;
}

.num { font-variant-numeric: tabular-nums; }

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.pair > select {
  background-position: calc(100% - 10px) calc(50% - 2px), calc(100% - 5px) calc(50% - 2px);
  padding-right: 1rem;
}

.choice {
  border: 0;
  padding: 0;
  margin: 0 0 0.85rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.seg-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--stone);
  border-radius: 8px;
}

.seg-opts label {
  position: relative;
  flex: 1 1 auto;
  min-height: 44px;
  min-width: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: background-color 180ms ease, color 180ms ease;
}

.seg-opts input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.seg-opts label:has(input:checked) {
  background: var(--paper);
  color: var(--accent);
  font-weight: 500;
}

.seg-opts label:has(input:focus-visible) {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.choice-name { display: block; }

.hint {
  margin: 0.05rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 0.75rem;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  margin: 0.35rem 0 0.85rem;
  padding: 1rem 0 0;
  min-width: 0;
}

.prices > legend {
  float: none;
  width: auto;
  grid-column: 1 / -1;
}

.prices label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.prices .span-2 { grid-column: 1 / -1; }

.prices input[type="text"],
.prices select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--hair-light);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  transition: border-color 180ms ease;
}

.prices select { padding-right: 1.7rem; }

.prices input:focus-visible,
.prices select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.98rem !important;
  font-weight: 400 !important;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  accent-color: var(--accent);
  padding: 0;
}

.seg-opts input[type="radio"] {
  width: 1px;
  height: 1px;
  accent-color: auto;
}

input:disabled { opacity: 0.45; }

.prices .choice {
  grid-column: 1 / -1;
  margin: 0;
}

.error {
  color: var(--danger);
  margin: 0.2rem 0 0.65rem;
  font-size: 0.92rem;
}

.error:empty { display: none; }

.calc-btn {
  width: 100%;
  min-height: 48px;
  padding: 0 1rem;
  background: var(--accent);
  color: var(--text-on-dark);
  border: 0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.calc-btn:hover { background: var(--accent-deep); color: var(--text-on-dark); }

.calc-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.noscript-note {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.figure { max-width: 460px; }

#diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

#diagram[data-stale="true"] { opacity: 0.45; }

.ledger {
  background: var(--stone);
  color: var(--text);
  padding: 2.3rem 0 2.6rem;
}

.ledger ::selection { background: rgba(31, 107, 86, 0.2); color: var(--text); }

.ledger-inner {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.ledger-heading {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.95rem;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 0 0 0.85rem;
}

.compare-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  padding: 1.05rem 1.1rem 1rem;
  background: var(--paper);
  border: 1px solid var(--hair-light);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.compare-row > span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-row > span:last-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compare-row strong {
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.compare-row.is-lower { border-color: rgba(31, 107, 86, 0.45); }

.tag {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(31, 107, 86, 0.4);
  border-radius: 4px;
  padding: 0.16rem 0.4rem;
}

.tag:empty { display: none; }

.ledger .hint { color: var(--muted); }

.disclaimer {
  border-top: 1px solid var(--hair-light);
  margin: 0.4rem 0 1.3rem;
  padding-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
  margin: 0 0 1.15rem;
}

caption {
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
  caption-side: top;
}

th,
td {
  border-bottom: 1px solid var(--hair-light);
  padding: 0.55rem 0.35rem;
  text-align: right;
  vertical-align: baseline;
}

th:first-child,
td:first-child { text-align: left; }

tbody tr.is-selected { background: rgba(31, 107, 86, 0.08); }

tbody tr.is-selected th { color: var(--accent); }

.mix-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0.4rem 0 0.45rem;
}

.cement-line {
  margin: 0.35rem 0;
  font-variant-numeric: tabular-nums;
}

.cement-line.is-selected {
  box-shadow: inset 2px 0 0 var(--accent);
  padding-left: 0.6rem;
}

.sheet {
  background: var(--paper);
  color: var(--text);
}

.sheet ::selection { background: rgba(31, 107, 86, 0.2); color: var(--text); }

.measure {
  width: min(68ch, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.5rem 0 2.8rem;
}

.lede,
.answer {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.block {
  border-top: 1px solid var(--hair-light);
  margin-top: 1.7rem;
  padding-top: 1.15rem;
}

.measure h2,
.essay h2,
.block h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.65rem;
}

.measure h3,
.essay h3,
.block h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 1.05rem 0 0.28rem;
}

.measure p,
.essay p,
.block p { margin: 0 0 0.75rem; text-wrap: pretty; }

.measure ul,
.measure ol,
.essay ul,
.essay ol,
.block ul,
.block ol { margin: 0 0 0.8rem; padding-left: 1.2rem; }

.measure li,
.essay li,
.block li { margin: 0.28rem 0; }

.colophon {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.2rem 0 2.7rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.4rem 2rem;
  color: #d9d4cc;
  font-size: 0.95rem;
}

.colophon h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin: 0 0 0.55rem;
}

.colophon > div:first-child > h2 {
  font-family: var(--display);
  font-weight: 500;
  font-synthesis: none;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--text-on-dark);
}

.colophon a { color: var(--text-on-dark); }

.colophon a:hover { color: var(--accent-on-dark); }

.colophon ul { list-style: none; margin: 0; padding: 0; }

.colophon li { margin: 0.22rem 0; }

.colophon p { margin: 0 0 0.7rem; }

.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;
}

#unit-row[hidden] + #unit-hint { display: none !important; }

@media (min-width: 1100px) {
  .switch { justify-content: flex-end; }

  .bench {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    column-gap: 1.75rem;
    align-items: start;
    min-height: calc(100vh - 4.6rem);
    padding-top: 1.4rem;
    padding-bottom: 1.7rem;
  }

  .readout {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .panel {
    grid-column: 2;
    grid-row: 1;
    order: 0;
  }

  .stage,
  .figure { order: 0; }

  .hero-num { font-size: clamp(5.4rem, 7.4vw, 7.4rem); }
}

@media (max-width: 720px) {
  .prices,
  .colophon { grid-template-columns: 1fr; }

  .compare-row { padding: 0.9rem 0.85rem; }

  .compare-row strong { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  html, body { background: #fff; color: #000; }
  .bar, .workspace, .ledger, .sheet, .colophon, .panel {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  .hero-num, .eyebrow, .brand, .stage a, .colophon a, a { color: #000 !important; }
  .switch, .skip, .calc-btn, .page-link-row { display: none !important; }
  .bench { display: block; min-height: 0; }
  .readout { display: block; }
  .panel, .compare-row { border-color: #000; }
  #diagram[data-stale="true"] { opacity: 1; }
  .bar { position: static; }
}
