/* Bedrock Costs. A cost report on green-bar listing paper. */
@font-face {
  font-family: "Archivo";
  src: url("/bedrock-costs/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --desk: #e3e8e0;
  --paper: #fcfdfa;
  --band: #dcebd8;
  --ink: #14241b;
  --muted: #45564b;
  --rule: #b9c7ba;
  --blue: #1d3fc4;
  --marker: #ffe55c;
  --row: 2.25rem;
  --sans: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  font-stretch: 100%;
}
a { color: var(--blue); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; }

.top, main, footer { max-width: 73rem; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.top { padding-top: 1.5rem; padding-bottom: 1.75rem; }
.brand { margin: 0 0 2.25rem; font-weight: 800; font-stretch: 125%; font-size: 1rem; letter-spacing: -0.01em; }
.brand::before { content: ""; display: inline-block; width: 1.6rem; height: 0.7rem; margin-right: 0.5rem; background: linear-gradient(var(--blue), var(--blue)) left / 100% 100% no-repeat; }
h1 { max-width: 22ch; font-weight: 800; font-stretch: 112%; font-size: clamp(1.9rem, 4.6vw, 3.25rem); line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
.lead { max-width: 58ch; margin: 1rem 0 0; font-size: 1.125rem; color: var(--muted); }

/* The sheet: continuous listing paper with feed holes down both edges */
.sheet {
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule), 0 14px 30px -22px rgba(20, 36, 27, 0.55);
}
.sheet h2 { font-weight: 700; font-stretch: 100%; font-size: 1.125rem; margin-bottom: 1.1rem; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem 1.25rem; align-items: end; }
.fields label { display: block; font-size: 0.875rem; font-stretch: 88%; font-weight: 500; color: var(--muted); line-height: 1.25; }
.fields input, .fields select {
  display: block; width: 100%; height: 2.75rem; margin-top: 0.4rem; padding: 0 0.65rem;
  font: 600 1.125rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink);
  background: #fff; border: 1px solid var(--muted); border-bottom-width: 3px; border-radius: 2px;
}
.fields select { font-size: 1rem; font-weight: 500; }
.fields input:focus-visible, .fields select:focus-visible { outline-offset: 1px; border-color: var(--blue); }

.result { min-height: 4.8em; margin: 1.6rem 0 1rem; font-weight: 600; font-stretch: 100%; font-size: clamp(1.2rem, 2.3vw, 1.6rem); line-height: 1.6; letter-spacing: -0.01em; text-wrap: balance; }
.result mark { padding: 0.08em 0.22em; margin: 0 -0.05em; color: var(--ink); background: var(--marker); font-weight: 800; font-variant-numeric: tabular-nums; border-radius: 0.5em 0.2em 0.6em 0.25em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.scroll { overflow-x: auto; min-height: calc(var(--row) * 22 + 2px); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
table { width: 100%; min-width: 40rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { height: var(--row); padding: 0 0.7rem; text-align: left; white-space: nowrap; font-size: 0.975rem; }
thead th { font-weight: 600; font-stretch: 80%; font-size: 0.875rem; color: var(--muted); border-bottom: 1px solid var(--ink); }
tbody th { font-weight: 600; }
.num { text-align: right; }
thead th.num { text-align: right; }
td.total { font-weight: 700; }
td.times { color: var(--muted); }
.scale { width: 42%; min-width: 9rem; padding-right: 0.25rem; }
td.scale { border-left: 1px solid var(--ink); padding-left: 0; }
.bar { display: block; height: 0.95rem; min-width: 2px; background: var(--blue); }
/* green bar: three rows on, three rows off */
tbody tr:nth-child(6n + 1) > *, tbody tr:nth-child(6n + 2) > *, tbody tr:nth-child(6n + 3) > * { background: var(--band); }
tbody tr:hover > * { box-shadow: inset 0 1px 0 var(--ink), inset 0 -1px 0 var(--ink); }

.small { margin: 1rem 0 0; max-width: 100ch; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }

@media (max-width: 39.99rem) {
  .sheet { padding-left: 0.9rem; padding-right: 0.9rem; }
  .scroll { margin: 0 -0.9rem; }
  th, td { padding: 0 0.35rem; font-size: 0.875rem; }
  tbody th, thead th:first-child { padding-left: 0.9rem; }
  table { width: max-content; min-width: 100%; }
  .scale { width: 5rem; min-width: 5rem; padding-right: 0; }
  thead th.scale { padding-left: 0.3rem; font-size: 0.8125rem; }
}
@media (min-width: 40rem) { .result { min-height: 3.2em; } }
@media (min-width: 60rem) {
  .sheet { padding: 2rem 4rem 1.75rem; }
  .sheet::before, .sheet::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 2.5rem;
    background: radial-gradient(circle at 50% 50%, var(--desk) 0 0.33rem, transparent 0.36rem) center top / 100% 2.25rem repeat-y;
  }
  .sheet::before { left: 0; border-right: 1px dashed var(--rule); }
  .sheet::after { right: 0; border-left: 1px dashed var(--rule); }
  .fields { grid-template-columns: repeat(3, 1fr) 1.35fr 1.2fr; }
}

/* Offer */
.offer { display: grid; gap: 1.25rem 3rem; margin-top: 2.5rem; padding: 1.75rem 1.25rem; background: var(--ink); color: #f1f6ee; }
.offer h2 { font-weight: 600; font-stretch: 100%; font-size: 1.0625rem; color: #c9d8c9; }
.price { margin: 0.35rem 0 0; font-weight: 800; font-stretch: 112%; font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.offer-body p { max-width: 56ch; }
.offer :focus-visible { outline-color: var(--marker); }
button { font: 700 1.0625rem/1 var(--sans); cursor: pointer; }
.buy, form[data-signup] button { min-height: 3.1rem; padding: 0 1.4rem; color: var(--ink); background: var(--marker); border: 0; border-radius: 2px; }
.buy:hover, form[data-signup] button:hover { background: #fff09a; }
.buy:active, form[data-signup] button:active { transform: translateY(1px); }
form[data-signup] { display: flex; flex-wrap: wrap; gap: 0.6rem; min-height: 3.1rem; }
form[data-signup] input[type="email"] { flex: 1 1 14rem; min-width: 0; height: 3.1rem; padding: 0 0.8rem; font: 500 1.0625rem/1 var(--sans); color: var(--ink); background: #fff; border: 0; border-radius: 2px; }
form[data-signup] input::placeholder { color: #5d6b61; }
form[data-signup] button:disabled { opacity: 0.6; cursor: default; }
form[data-signup] [data-note] { flex-basis: 100%; margin: 0.2rem 0 0; font-size: 0.9375rem; color: #c9d8c9; }
form[data-signup].done input, form[data-signup].done button { display: none; }
form[data-signup].done [data-note] { font-size: 1.125rem; font-weight: 700; color: var(--marker); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (min-width: 60rem) {
  .offer { grid-template-columns: 1fr 1.25fr; align-items: start; padding: 2.5rem 4rem; }
}

/* Explanatory text */
.notes { margin-top: 1rem; }
.notes section { display: grid; gap: 0.6rem 3rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.notes section:first-child { border-top: 0; }
.notes h2 { font-weight: 800; font-stretch: 112%; font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.notes h3 { margin-top: 1.5rem; font-weight: 700; font-size: 1.0625rem; }
.notes h3:first-child { margin-top: 0; }
.notes h3 + p { margin-top: 0.3rem; }
.notes div { max-width: 66ch; }
.notes p:last-child { margin-bottom: 0; }
@media (min-width: 60rem) {
  .notes section { grid-template-columns: 1fr 1.25fr; padding-left: 4rem; padding-right: 4rem; }
}

footer { margin-top: 1rem; padding-top: 1.25rem; padding-bottom: 3rem; border-top: 2px solid var(--ink); font-size: 0.875rem; color: var(--muted); }
footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .buy:active, form[data-signup] button:active { transform: none; }
}
@media (max-width: 23.4rem) {
  .scale { width: 3.1rem; min-width: 3.1rem; }
  thead th.scale { white-space: normal; line-height: 1.05; font-size: 0.75rem; }
}

/* Supporting pages: an article printed on the same listing paper */
.brand a { color: inherit; text-decoration: none; }
.brand a:hover { text-decoration: underline; }
.crumb { margin: -1.25rem 0 1.25rem; font-size: 0.875rem; font-stretch: 88%; font-weight: 500; color: var(--muted); }
.crumb span[aria-hidden] { margin: 0 0.3rem; }
.scroll.fit { min-height: 0; margin-top: 1.1rem; }
.doc h1, .top h1 { max-width: 24ch; }
.sheet.doc > h2 { margin: 2.5rem 0 0.7rem; font-weight: 800; font-stretch: 112%; font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.sheet.doc > h2:first-child { margin-top: 0; }
.sheet.doc > p, .sheet.doc > ul { max-width: 68ch; }
.sheet.doc > .scroll + .small { margin: 0.6rem 0 1.25rem; }
.sheet.doc > ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.sheet.doc li { margin-bottom: 0.45rem; }
.sheet.doc code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; padding: 0.05em 0.3em; background: var(--band); }
.sheet.doc .calc-link { margin: 2rem 0 0; padding-top: 1.1rem; border-top: 2px solid var(--ink); font-weight: 700; }
.sheet.doc .made { margin-top: 0.75rem; }
.more ul { margin: 0; padding: 0; list-style: none; }
.more li { padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.more li:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 39.99rem) {
  .scroll.fit th, .scroll.fit td { padding: 0 0.55rem; }
  .scroll.fit tbody th, .scroll.fit thead th:first-child { padding-left: 0.9rem; }
}
