/* Tallymark base: reset, type, buttons, header, footer, forms and the ledger parts. Page sections are in sections.css. Colors and sizes come from tokens.css.
   The look is a ledger: ruled lines, a red margin, tally marks that count, and the double rule that closes a total. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; overflow-x: clip; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font: 400 var(--text-base)/1.62 var(--font-body); }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0 0 var(--space-md); font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -.018em; color: var(--ink); overflow-wrap: break-word; min-width: 0; }
h1 { font-size: var(--text-display); line-height: 1.02; letter-spacing: -.028em; }
h2 { font-size: var(--text-display-s); }
h3 { font-size: var(--text-lg); line-height: 1.15; }
h4 { font-size: var(--text-md); }
p { margin: 0 0 var(--space-md); }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
address { font-style: normal; }
table { border-collapse: collapse; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--red); color: var(--white); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: var(--space-md); top: -4rem; z-index: 1000; padding: .6em 1em; background: var(--white); color: var(--ink); font-family: var(--font-display); }
.skip:focus { top: var(--space-md); }
.fig { font-variant-numeric: lining-nums tabular-nums; }
.lede { font-size: var(--text-md); line-height: 1.45; color: var(--ink-2); max-width: 36rem; }
.note { font-size: var(--text-sm); color: var(--muted); }

/* A dark band redefines the same tokens, so every part inside it just works. */
.band--dark { --ink: var(--on-dark); --ink-2: var(--on-dark-2); --muted: var(--on-dark-2); --rule: var(--rule-dark); --rule-soft: var(--rule-dark); --focus: var(--red-on-dark); background: var(--dark); color: var(--on-dark); }
.band--wash { background: var(--wash); }
.section { padding-block: clamp(4rem, 9vw, var(--space-3xl)); position: relative; }
.head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-lg) var(--space-2xl); align-items: end; margin-bottom: clamp(2rem, 5vw, var(--space-2xl)); }
.head h2 { margin: 0; }
.head p { margin: 0; color: var(--ink-2); max-width: 32rem; }
.head--solo { grid-template-columns: minmax(0, 1fr); max-width: 50rem; }
@media (max-width: 760px) { .head { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); align-items: start; } }

/* The double rule of a closed total. It draws itself when it scrolls in. */
.dbl { display: block; height: 6px; margin: 0 0 var(--space-lg); border: 0; border-top: 2px solid var(--red); border-bottom: 2px solid var(--red); transform-origin: left; }
.band--dark .dbl { border-color: var(--red-on-dark); }
.js .dbl { transform: scaleX(0); transition: transform var(--dur-draw) var(--ease-out); }
.js .dbl.is-in { transform: none; }
.tally { display: block; width: 3.4rem; height: 2.125rem; fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; }
.band--dark .tally { stroke: var(--red-on-dark); }
.js [data-draw] .tally, .js .tally[data-draw] { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--dur-draw) var(--ease-out); }
.js [data-draw].is-in .tally, .js .tally[data-draw].is-in, .js .is-in [data-draw] .tally { stroke-dashoffset: 0; }

/* Buttons: a press you can feel, and on hover the double rule slides under the label. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; position: relative; padding: .82em 1.3em; border: 1.5px solid transparent; border-radius: var(--radius-s); font: 500 1rem/1.2 var(--font-display); text-decoration: none; white-space: nowrap; cursor: pointer; background: none; color: inherit;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn::after { content: ""; position: absolute; left: 1.3em; right: 1.3em; bottom: .42em; height: 4px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--dur-short) var(--ease-out); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn--solid { background: var(--brand); color: var(--white); }
.btn--paper { background: var(--paper); color: var(--dark); }
.btn--line { border-color: var(--ink); color: var(--ink); }
.btn--line-light { border-color: var(--on-dark-2); color: var(--on-dark); }
.btn[disabled] { opacity: .6; cursor: progress; }
@media (hover: hover) {
  .btn:hover::after { transform: none; }
  .btn--solid:hover { background: var(--brand-deep); }
  .btn--paper:hover { background: var(--tint); }
  .btn--line:hover { background: var(--ink); color: var(--paper); }
  .btn--line-light:hover { background: var(--on-dark); color: var(--dark); }
}
.actions { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-lg); }
@media (max-width: 400px) { .actions { gap: var(--space-sm); } .actions .btn { padding-inline: .9em; font-size: .94rem; } .actions .link { font-size: .94rem; } }
.link { color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 500; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; padding-bottom: .15em; transition: background-size var(--dur-short) var(--ease-out); white-space: nowrap; }
.link:hover { background-size: 35% 1.5px; }
.prose-link, .article a, .faq a, .contact a { color: var(--brand); text-underline-offset: .18em; }
.band--dark .prose-link { color: var(--tint); }

/* Header: always ink, so it never fights the page under it (Safari's top bar needs a solid color here). */
.site-header { position: sticky; top: 0; z-index: var(--z-sticky); background-color: var(--dark); color: var(--on-dark); border-bottom: 4px double transparent; transition: border-color var(--dur-short) var(--ease-out); }
.site-header.is-scrolled { border-bottom-color: var(--red-on-dark); }
.site-header__row { display: flex; align-items: center; gap: var(--space-lg); min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--on-dark); text-decoration: none; margin-right: auto; flex: none; }
.brand__mark { width: 2.4rem; height: 1.75rem; fill: none; stroke-linecap: round; stroke-width: 2.6; }
.brand__strokes { stroke: currentColor; }
.brand__slash { stroke: var(--red-on-dark); }
.js .brand__strokes, .js .brand__slash { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 900ms var(--ease-out); }
.js .brand__slash { transition-delay: 500ms; }
.js.is-ready .brand__strokes, .js.is-ready .brand__slash { stroke-dashoffset: 0; }
.brand__name { font: 600 1.4rem/1 var(--font-display); letter-spacing: -.02em; }
.nav__toggle { display: none; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 .75rem; border: 1.5px solid var(--on-dark-2); border-radius: var(--radius-s); background: none; color: inherit; font: 500 .95rem var(--font-display); cursor: pointer; }
.nav__bars { display: block; position: relative; width: 1.1rem; height: 2px; background: currentColor; transition: background-color var(--dur-micro); }
.nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; transition: transform var(--dur-short) var(--ease-out); }
.nav__bars::before { transform: translateY(-5px); }
.nav__bars::after { transform: translateY(5px); }
[aria-expanded="true"] .nav__bars { background: transparent; }
[aria-expanded="true"] .nav__bars::before { transform: rotate(45deg); }
[aria-expanded="true"] .nav__bars::after { transform: rotate(-45deg); }
.nav__list { display: flex; gap: .15rem; list-style: none; }
.nav__list > li { position: relative; }
.nav__list a { display: block; padding: .55rem .62rem; color: var(--on-dark); font: 400 .98rem/1.2 var(--font-display); text-decoration: none; }
.nav__list > li > a { background: linear-gradient(var(--red-on-dark), var(--red-on-dark)) .62rem calc(100% - .2rem) / 0 2px no-repeat; transition: background-size var(--dur-short) var(--ease-out); }
.nav__list > li > a:hover, .nav__list > li > a[aria-current] { background-size: calc(100% - 1.24rem) 2px; }
.sub { position: absolute; top: 100%; left: 0; min-width: 15rem; padding: var(--space-xs); list-style: none; background: var(--paper); box-shadow: 0 18px 40px color-mix(in oklch, var(--dark) 28%, transparent); border-top: 4px double var(--red); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), visibility var(--dur-short); z-index: var(--z-dropdown); }
.sub a { color: var(--ink); padding: .55rem .65rem; }
.sub a:hover { background: var(--wash); }
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.site-header__phone { display: inline-flex; align-items: center; gap: .5rem; color: var(--on-dark); text-decoration: none; font: 500 1rem var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-header__phone-icon { width: 1.25rem; height: 1.25rem; fill: currentColor; flex: none; }
.site-header__cta { flex: none; background: var(--paper); color: var(--dark); }
@media (hover: hover) { .site-header__cta:hover { background: var(--tint); } }
@media (max-width: 1319px) {
  .site-header__phone-num { display: none; }
  .site-header__phone { justify-content: center; width: 2.75rem; height: 2.75rem; border: 1.5px solid var(--on-dark-2); border-radius: 50%; }
  .site-header__phone:hover { background: var(--on-dark); color: var(--dark); }
}
@media (max-width: 1179px) {
  .site-header__row { gap: var(--space-sm); }
  .nav { order: 3; }
  .nav__toggle { display: inline-flex; }
  .nav__list { position: absolute; left: 0; right: 0; top: 100%; display: block; max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); overflow-y: auto; padding: var(--space-md) clamp(1.1rem, 4vw, 2.5rem) var(--space-xl); background: var(--dark); border-top: 1px solid var(--rule-dark); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), visibility var(--dur-short); }
  .is-open .nav__list { opacity: 1; visibility: visible; transform: none; }
  .nav__list > li { border-bottom: 1px solid var(--rule-dark); }
  .nav__list > li > a { padding: .85rem 0; font-size: var(--text-md); background: none; }
  .nav__list > li > a[aria-current] { color: var(--red-on-dark); }
  .sub { position: static; min-width: 0; padding: 0 0 var(--space-sm); background: none; box-shadow: none; border: 0; opacity: 1; visibility: visible; transform: none; }
  .sub a { color: var(--on-dark-2); padding: .5rem 0; }
  .sub a:hover { background: none; color: var(--on-dark); }
  .nav-open { overflow: hidden; }
}
@media (max-width: 560px) { .site-header__cta { display: none; } }

/* Footer */
.site-footer { background: var(--dark); color: var(--on-dark-2); padding-top: var(--space-2xl); font-size: var(--text-sm); border-top: 4px double var(--red-on-dark); }
.site-footer a { color: var(--on-dark); text-decoration-color: var(--rule-dark); text-underline-offset: .2em; }
.site-footer a:hover { text-decoration-color: currentColor; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: var(--space-xl); }
.site-footer__about { margin-top: var(--space-md); max-width: 22rem; }
.site-footer__h { margin: 0 0 var(--space-sm); font: 500 var(--text-base)/1.2 var(--font-display); letter-spacing: 0; color: var(--on-dark); }
.site-footer__h:not(:first-child) { margin-top: var(--space-lg); }
.site-footer__links { list-style: none; columns: 1; }
.site-footer__links li { margin-bottom: .3rem; }
.site-footer__base { display: flex; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-top: var(--space-2xl); padding-block: var(--space-md); border-top: 1px solid var(--rule-dark); }
.site-footer__base p { margin: 0; }
.site-footer__base a + a { margin-left: var(--space-md); }
.social { display: flex; gap: var(--space-xs); margin-top: var(--space-md); list-style: none; }
.social a { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1.5px solid var(--rule-dark); border-radius: 50%; color: var(--on-dark); transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.social a:hover { background: var(--on-dark); color: var(--dark); }
.social svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.news { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xs); }
.news input { width: 100%; min-width: 0; padding: .7em .8em; background: none; border: 1.5px solid var(--on-dark-2); border-radius: var(--radius-s); color: var(--on-dark); font: inherit; }
.news input::placeholder { color: var(--on-dark-2); }
.news__msg { grid-column: 1 / -1; margin: 0; min-height: 1.3em; color: var(--tint); }
@media (max-width: 960px) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .site-footer__grid { grid-template-columns: minmax(0, 1fr); } }

/* Page head of the inner pages: the ruled sheet, with a photo that lags behind on the right when the page has one. */
.page-head { position: relative; overflow: hidden; padding-block: clamp(3rem, 7vw, 6rem); }
.ruled { position: absolute; inset: -8% 0; pointer-events: none; opacity: .55; background: repeating-linear-gradient(180deg, transparent 0 calc(2.2rem - 1px), var(--rule-dark) calc(2.2rem - 1px) 2.2rem); transform: translate3d(0, var(--py, 0), 0); }
.margin-rule { position: absolute; top: 0; bottom: 0; left: max(.5rem, calc((100% - var(--wrap)) / 2 + .35rem)); width: 5px; border-left: 1px solid var(--red-on-dark); border-right: 1px solid var(--red-on-dark); pointer-events: none; opacity: .75; }
.page-head .wrap { position: relative; z-index: var(--z-base); }
.page-head h1 { max-width: 16em; font-size: clamp(2.4rem, 3.6vw + 1rem, 4.4rem); }
.page-head .lede { margin-bottom: 0; }
.page-head__photo { position: absolute; top: -12%; right: 0; bottom: -12%; width: 46%; height: 124%; max-width: none; object-fit: cover; transform: translate3d(0, var(--py, 0), 0); -webkit-mask-image: linear-gradient(90deg, transparent, var(--dark) 55%); mask-image: linear-gradient(90deg, transparent, var(--dark) 55%); opacity: .75; }
.crumbs { margin-bottom: var(--space-lg); font: 400 var(--text-sm)/1.2 var(--font-display); color: var(--on-dark-2); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .5em; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: .5em; opacity: .6; }
.crumbs a { color: var(--on-dark); text-underline-offset: .2em; }
@media (max-width: 820px) { .page-head__photo { width: 100%; opacity: .22; -webkit-mask-image: none; mask-image: none; } }

/* Reveal: sections rise once. Without JS or with reduced motion everything is simply there. */
.js [data-reveal-group] > * { opacity: 0; transform: translate3d(0, 20px, 0); transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out); transition-delay: calc(min(var(--i, 0), 6) * 70ms); }
.js [data-reveal-group] > .is-in { opacity: 1; transform: none; }
.word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.js .word__in { display: inline-block; transform: translateY(112%); transition: transform 900ms var(--ease-out); transition-delay: calc(var(--w, 0) * 40ms + 120ms); }
.js.is-ready .word__in { transform: none; }
.word__in { display: inline-block; }

/* Forms */
.field { display: grid; gap: .35rem; min-width: 0; }
.field label, .ctl__label { font: 500 var(--text-sm)/1.2 var(--font-display); color: var(--ink); }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 2.9rem; padding: .62em .8em; font: inherit; color: var(--ink); background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--radius-s); transition: border-color var(--dur-micro) var(--ease-out); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in oklch, var(--brand) 30%, transparent); outline-offset: 0; }
.field textarea { min-height: 8rem; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--error); }
.field__err { color: var(--error); font-size: var(--text-sm); min-height: 1.2em; }
.field__hint { color: var(--muted); font-size: var(--text-sm); }
.band--dark .field input, .band--dark .field select { color: var(--dark); }
.band--dark .field select option { color: var(--dark); }
.form { display: grid; gap: var(--space-xl); }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md); min-width: 0; }
.form legend { display: flex; align-items: center; gap: var(--space-sm); padding: 0; margin-bottom: var(--space-md); font: 500 var(--text-lg)/1.2 var(--font-display); }
.form .span-2 { grid-column: 1 / -1; }
.form .hp { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; } /* honeypot for php/quote.php */
.drop { border: 1.5px dashed var(--muted); border-radius: var(--radius-s); padding: var(--space-xl); text-align: center; cursor: pointer; background: var(--white); transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.drop p { margin: 0; }
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--wash); }
.drop__list { list-style: none; margin-top: var(--space-md); display: grid; gap: var(--space-xs); }
.drop__list li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: var(--space-sm); align-items: center; font-size: var(--text-sm); }
.drop__list img { width: 3rem; height: 3rem; object-fit: cover; border-radius: var(--radius-s); }
.drop__list progress { display: block; width: 100%; height: .35rem; accent-color: var(--brand); }
.drop__remove { width: 2.2rem; height: 2.2rem; border: 1.5px solid var(--rule); border-radius: 50%; background: none; cursor: pointer; color: var(--ink); font-size: 1.1rem; line-height: 1; }
.drop__remove:hover { border-color: var(--error); color: var(--error); }
.form__send { display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; }
.form__send p { margin: 0; }
.form__status { margin: 0; padding: var(--space-md); border-radius: var(--radius-s); background: color-mix(in oklch, var(--ok) 12%, var(--white)); color: var(--ok); }
.form__status.is-error { background: color-mix(in oklch, var(--error) 10%, var(--white)); color: var(--error); }
@media (max-width: 560px) { .form fieldset { grid-template-columns: minmax(0, 1fr); } }

/* Sliders and checks of the calculators */
.ctl { display: grid; gap: .55rem; }
.ctl__row { display: flex; justify-content: space-between; gap: var(--space-md); align-items: baseline; }
.ctl__val { font: 500 var(--text-md)/1 var(--font-display); font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 2.75rem; margin: 0; background: none; cursor: grab; --fill: 50%; }
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--red) var(--fill), var(--rule) var(--fill)); }
input[type="range"]::-moz-range-track { height: 3px; background: var(--rule); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--red); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 28px; margin-top: -12.5px; border: 0; border-radius: var(--radius-s); background: var(--ink); transition: transform var(--dur-micro) var(--ease-out); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 28px; border: 0; border-radius: var(--radius-s); background: var(--ink); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scaleX(1.25); }
input[type="range"]:disabled { opacity: .35; cursor: not-allowed; }
.check { display: flex; align-items: flex-start; gap: .65rem; padding-block: .5rem; cursor: pointer; line-height: 1.35; }
.check input { flex: none; width: 1.3rem; height: 1.3rem; margin: .08rem 0 0; accent-color: var(--red); cursor: pointer; }
.check small { display: block; font-size: var(--text-sm); color: var(--muted); }

/* The ledger sheet: rows of label and figure, a line above the total and a double rule under it. */
.ledger { --ink: var(--ink-paper); --ink-2: var(--ink-2-paper); --muted: var(--muted-paper); --rule: var(--rule-paper); padding: clamp(1.25rem, 3vw, 2rem); background: repeating-linear-gradient(180deg, var(--paper) 0 calc(2.6rem - 1px), var(--wash) calc(2.6rem - 1px) 2.6rem); color: var(--ink); box-shadow: 0 30px 60px -28px color-mix(in oklch, var(--dark) 60%, transparent); border-left: 4px double var(--red); border-radius: var(--radius-s); }
.ledger h3 { margin-bottom: var(--space-md); color: var(--ink); }
.ledger dl { margin: 0; }
.ledger__row { display: flex; justify-content: space-between; gap: var(--space-md); align-items: baseline; padding-block: .45rem; }
.ledger__row dt { color: var(--ink-2); min-width: 0; }
.ledger__row dd { margin: 0; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; color: var(--ink); }
.ledger__row--red dd { color: var(--red); }
.ledger__total { margin-top: var(--space-xs); padding-block: .6rem; border-top: 1.5px solid var(--ink); border-bottom: 5px double var(--red); }
.ledger__total dt { font: 500 var(--text-base)/1.2 var(--font-display); color: var(--ink); }
.ledger__total dd { font: 500 var(--text-xl)/1 var(--font-display); }
.ledger__foot { margin-top: var(--space-lg); }
.ledger .note { margin: var(--space-md) 0 0; }

@media print {
  .site-header, .site-footer, .btn, canvas, .ruled, .margin-rule, .peek, .story__hint { display: none; }
  .band--dark { --ink: black; --ink-2: black; --muted: black; background: none; color: black; }
  .js [data-reveal-group] > * { opacity: 1; transform: none; }
  .js .story.is-live { height: auto; }
  .js .story.is-live .story__screen { position: static; height: auto; }
}
