:root {
  --osb: #d9c4a0;      /* OSB sheathing */
  --osb-2: #ccb48b;
  --ink: #1e2b45;    /* navy ink */
  --ink-soft: #45506a;
  --chalk: #2e63c9;        /* chalk-line blue */
  --red: #b8321f;        /* dimension red */
  --fir: #7a4a1f;
  --white: #fff;

  --display: "Archivo", system-ui, sans-serif;
  --body: "Archivo", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--osb);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 125; line-height: 1; letter-spacing: -.02em; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--chalk); color: var(--white); padding: 8px 14px; }
.skip:focus { left: 16px; top: 40px; }

/* Header */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 32px;
  padding: 14px var(--gutter);
  background: var(--osb);
  border-bottom: 2px solid var(--ink);
}
.mark { display: flex; align-items: baseline; gap: 6px; text-decoration: none; margin-right: auto; }
.mark__name, .mark__build { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 125; font-size: 1.35rem; line-height: 1; letter-spacing: -.02em; }
.mark { align-items: center; }
.mark svg, .foot__mark svg { width: 48px; height: 48px; flex: none; margin-right: 6px; image-rendering: pixelated; }
.bar__nav { display: flex; }
.bar__nav a, .bar__phone { text-decoration: none; font-weight: 600; font-size: .95rem; }
.bar__nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.bar__phone { padding: 8px 14px; border: 2px solid var(--ink); }
.bar__phone:hover { background: var(--ink); color: var(--white); }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer;
  font: 700 1.05rem/1 var(--body); text-decoration: none;
  padding: 16px 24px;
  background: var(--ink); color: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--chalk);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--chalk); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--chalk); }
.btn--plain { background: transparent; color: var(--ink); box-shadow: none; }
.btn--plain:hover { background: var(--ink); color: var(--white); transform: none; box-shadow: none; }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 4rem); max-width: 15ch; }
.hero__lede { margin-top: 28px; max-width: 34em; font-size: 1.15rem; color: var(--ink-soft); }
.hero__actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px 18px; }
.hero__drawing { margin: 0 -2vw 0 0; }

.frame { width: 100%; height: auto; overflow: visible; }
.frame .m { fill: var(--white); stroke: var(--ink); stroke-width: 1; }
.frame .plate { fill: #f1e4cc; }
.frame .header { fill: #c89a62; }
.frame .rafter { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: miter; }
.frame .ln { fill: none; stroke: var(--ink); stroke-width: 1; }
.frame .ln.g { stroke-dasharray: 3 3; }
.frame .dim path { fill: none; stroke: var(--red); stroke-width: 1; }
.frame .dim text { fill: var(--red); font: 700 13px var(--body); }
.frame .note text { fill: var(--ink-soft); font-weight: 500; font-style: italic; }

/* The one load moment: the wall frames itself up */
@media (prefers-reduced-motion: no-preference) {
  .js .frame > * { animation: raise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); transform-box: fill-box; transform-origin: 50% 100%; }
  .js .frame .rafter, .js .frame .ln { animation-name: draw; stroke-dasharray: 1200; }
  .js .frame .ln.g { animation-name: fade; stroke-dasharray: 3 3; }
  .js .frame .dim { animation-name: fade; }
}
@keyframes raise { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Facts strip */
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--ink); color: var(--osb);
}
.facts p { padding: 24px var(--gutter); font-size: .95rem; border-right: 1px solid var(--ink-soft); }
.facts p:last-child { border-right: 0; }
.facts strong { display: block; color: var(--white); font-family: var(--display); font-variation-settings: "wdth" 125; font-size: 1.15rem; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }

/* Section rhythm */
.work, .process, .jobs {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter) 0;
}
.section-title { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: clamp(32px, 4vw, 56px); }

/* What we build: a spec sheet, not cards */
.work__list { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 4px solid var(--ink); }
.trade { padding: 32px 40px 36px 0; border-bottom: 1px solid var(--ink); }
.trade:nth-child(2n) { padding: 32px 0 36px 40px; border-left: 1px solid var(--ink); }
.trade h3 { font-size: 1.6rem; margin-bottom: 14px; }
.trade p { max-width: 36em; }
.trade__spec { margin-top: 18px; font-weight: 600; font-size: .92rem; color: var(--fir); }

/* Process: it is a sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 24px 0 0; }
.steps li::before {
  content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: 22px;
  font: 800 1.4rem/1 var(--display); font-variation-settings: "wdth" 125; color: var(--white);
  background: var(--chalk); border: 2px solid var(--ink);
  position: relative; z-index: 1;
}
.steps li::after {
  content: ""; position: absolute; top: 26px; left: 52px; right: 0;
  border-top: 2px dashed var(--ink);
}
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 1.2rem; margin-bottom: 10px; }
.steps p { font-size: .98rem; color: var(--ink-soft); }

/* Jobs */
.jobs__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.job { margin: 0; grid-column: span 2; }
.job--wide { grid-column: span 3; }
.job__img {
  aspect-ratio: 4 / 3;
  background-color: var(--osb-2);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(40,50,58,.14) 38px 41px);
  border: 2px solid var(--ink);
}
.job--wide .job__img { aspect-ratio: auto; height: calc(100% - 64px); min-height: 220px; }
.job figcaption { padding-top: 12px; font-size: .95rem; color: var(--ink-soft); }
.job figcaption strong { display: block; color: var(--ink); font-size: 1.05rem; }

/* Estimate */
.estimate {
  max-width: var(--max); margin: clamp(80px, 10vw, 140px) auto 0;
  padding: clamp(40px, 5vw, 72px) var(--gutter);
  background: var(--ink); color: var(--white);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px);
}
.estimate h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.estimate__intro > p { margin-top: 20px; max-width: 28em; }
.estimate__contact { margin: 32px 0 0; display: grid; gap: 12px; }
.estimate__contact div { display: grid; grid-template-columns: 5.5em 1fr; }
.estimate__contact dt { font-weight: 700; }
.estimate__contact dd { margin: 0; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; align-content: start; }
.field { grid-column: 1 / -1; display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field--half { grid-column: span 1; }
.field label, .field legend { font-weight: 700; font-size: .95rem; padding: 0; }
.opt { font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 14px; background: var(--white);
  border: 2px solid var(--ink); border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--chalk); }
.estimate :focus-visible { outline-color: #8fb0ee; }
.field [aria-invalid="true"] { border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips label { position: relative; font-weight: 600; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: block; padding: 9px 14px; border: 2px solid var(--ink); background: var(--white); cursor: pointer; }
.chips span { color: var(--ink); }
.chips input:checked + span { background: var(--chalk); color: var(--white); border-color: var(--white); }
.chips input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; }
.form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 6px; }
.form .btn { background: var(--chalk); border-color: var(--white); box-shadow: 5px 5px 0 var(--white); }
.form .btn:hover { box-shadow: 3px 3px 0 var(--white); }
.form__status { font-weight: 600; }
.form__status.err { color: #ffb4a6; }
.field [aria-invalid="true"] { border-color: #ff8a73; }

/* Footer */
.foot { padding: 56px var(--gutter) 40px; max-width: var(--max); margin: 0 auto; display: grid; gap: 8px; }
.foot__mark { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.foot a { text-underline-offset: 3px; }
.foot__small { margin-top: 20px; font-size: .85rem; color: var(--ink-soft); }

/* Responsive */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero__drawing { margin: 0; }
  .hero h1 { max-width: 14ch; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li { padding: 0 0 0 76px; min-height: 52px; }
  .steps li::before { position: absolute; left: 0; top: 0; margin: 0; }
  .steps li::after { top: 52px; bottom: -28px; left: 25px; right: auto; border-top: 0; border-left: 2px dashed var(--ink); }
  .estimate { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bar { gap: 12px; }
  .mark__name, .mark__build { font-size: 1.45rem; }
  .bar__phone { font-size: .85rem; padding: 7px 10px; }
  .facts { grid-template-columns: 1fr; }
  .facts p { border-right: 0; border-bottom: 1px solid var(--ink-soft); padding-block: 18px; }
  .work__list { grid-template-columns: 1fr; }
  .trade, .trade:nth-child(2n) { padding: 28px 0; border-left: 0; }
  .jobs__grid { grid-template-columns: 1fr; }
  .job, .job--wide { grid-column: auto; }
  .job--wide .job__img { aspect-ratio: 4 / 3; height: auto; min-height: 0; }
  .form { grid-template-columns: 1fr; }
  .field--half { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  .mark__name, .mark__build { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Logo as <img> on inner pages */
.mark img, .foot__mark img { width: 48px; height: 48px; flex: none; margin-right: 6px; image-rendering: pixelated; }

/* Article pages (/diy/) */
.article { max-width: 860px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 0; }
.crumbs { font-size: .9rem; color: var(--ink-soft); margin-bottom: 20px; }
.crumbs a { color: inherit; }
.article h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); max-width: 20ch; }
.article__meta { margin-top: 16px; font-size: .95rem; color: var(--ink-soft); }
.article__hero { margin: 28px 0 36px; }
.article__hero img { width: 100%; height: auto; border: 2px solid var(--ink); }
.prose { font-size: 1.08rem; line-height: 1.7; max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.45rem, 2.8vw, 1.9rem); line-height: 1.15; margin-top: 2.2em; }
.prose h3 { font-size: 1.1rem; line-height: 1.3; font-variation-settings: "wdth" 110; margin-top: 1.6em; }
.prose h3 + p { margin-top: .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .55em; }
.prose li::marker { color: var(--chalk); font-weight: 700; }
.prose a { color: var(--chalk); text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.answer { background: var(--white); border: 2px solid var(--ink); border-left-width: 8px; padding: 22px 26px; margin-top: 1.8em; }
.answer h2 { margin-top: 0; font-size: 1.3rem; }
.answer p { margin-top: .7em; }
.article__cta { margin: 64px 0 0; padding: 32px; background: var(--ink); color: var(--white); }
.article__cta h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.15; }
.article__cta p { margin: 12px 0 24px; max-width: 46ch; }
.article__cta .btn { background: var(--chalk); border-color: var(--white); box-shadow: 5px 5px 0 var(--white); }

/* DIY hub */
.hub { max-width: 860px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 0; }
.hub h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hub__lede { margin-top: 16px; max-width: 52ch; color: var(--ink-soft); font-size: 1.1rem; }
.guides { list-style: none; padding: 0; margin: 36px 0 0; border-top: 4px solid var(--ink); }
.guides li { border-bottom: 1px solid var(--ink); }
.guides a { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; padding: 24px 0; text-decoration: none; }
.guides img { width: 100%; height: auto; border: 2px solid var(--ink); }
.guides h2 { font-size: 1.35rem; line-height: 1.2; }
.guides a:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.guides p { margin-top: 8px; color: var(--ink-soft); }
@media (max-width: 600px) { .guides a { grid-template-columns: 1fr; gap: 14px; } }

/* Photos */
.trade__img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 2px solid var(--ink); margin-bottom: 22px; }
.prose__fig { margin: 2em 0 0; }
.prose__fig img { width: 100%; height: auto; border: 2px solid var(--ink); }

/* Main menu */
.nav { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav a, .nav summary { text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--ink); cursor: pointer; }
.nav a:hover, .nav summary:hover, .nav a[aria-current="page"], .nav summary.is-current { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.nav__drop { position: relative; }
.nav__drop summary { list-style: none; display: flex; align-items: center; gap: 6px; }
.nav__drop summary::-webkit-details-marker { display: none; }
.nav__drop summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.nav__drop details[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.nav__drop ul { position: absolute; top: calc(100% + 14px); left: -16px; z-index: 40; min-width: 320px; list-style: none; margin: 0; padding: 8px 0; background: var(--white); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.nav__drop li a { display: block; padding: 10px 16px; font-weight: 500; line-height: 1.35; }
.nav__drop li:first-child a { font-weight: 700; border-bottom: 1px solid var(--osb-2); }
.nav__drop li a:hover { background: var(--osb); text-decoration: none; }
.nav-toggle { display: none; font: 700 .9rem/1 var(--body); color: var(--ink); background: transparent; border: 2px solid var(--ink); padding: 8px 12px; cursor: pointer; }
@media (max-width: 1000px) {
  .bar { flex-wrap: wrap; }
  .nav-toggle { display: block; order: 2; }
  .bar__phone { order: 1; margin-left: auto; }
  .mark { margin-right: 0; }
  .bar__nav { display: none; order: 3; width: 100%; }
  .bar__nav.is-open { display: block; }
  .nav { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 4px; }
  .nav > li { border-top: 1px solid var(--osb-2); }
  .nav > li > a, .nav summary { display: flex; padding: 14px 0; font-size: 1.05rem; }
  .nav__drop summary { justify-content: space-between; }
  .nav__drop ul { position: static; min-width: 0; border: 0; box-shadow: none; background: transparent; padding: 0 0 10px 14px; }
  .nav__drop li:first-child a { border-bottom: 0; }
  .nav__drop li a { padding: 8px 0; }
}
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 6px; }

/* Inner pages: about, contact */
.page { max-width: 860px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 0; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page__lede { margin-top: 16px; max-width: 52ch; color: var(--ink-soft); font-size: 1.15rem; }
.page__hero { margin: 28px 0 8px; }
.page__hero img { width: 100%; height: auto; border: 2px solid var(--ink); }
.page--contact { max-width: var(--max); }
.page--contact > .crumbs, .page--contact > h1, .page--contact > .page__lede { max-width: 860px; }
.estimate--page { margin-top: 36px; }
.page__after { margin-top: 48px; }
