/* Ridgeline Build Co.: "Plumb and level" */

@font-face {
  font-family: "Shoulders";
  src: url("fonts/big-shoulders-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Public";
  src: url("fonts/public-sans-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --concrete: #E1E2E0;
  --slab: #CBCDCA;
  --asphalt: #16191B;
  --asphalt-2: #22272A;     /* raised panels on asphalt */
  --steel: #4A4E51;         /* secondary text, 5.2:1 on slab */
  --gravel: #A7ABAD;        /* secondary text on asphalt, 6.5:1 */
  --layout: #F5C400;        /* layout yellow: primary actions */
  --layout-deep: #D9AD00;
  --pine: #D9B67C;          /* fresh lumber: dimension lines on dark */
  --white: #FFFFFF;
  --map-land: #F2EFE9;      /* OSM land color: tile seams blend in */
  --rule: rgb(22 25 27 / .2);
  --rule-dark: rgb(255 255 255 / .14);

  --display: "Shoulders", "Arial Narrow", sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 1280px;
  --bar-h: 0px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html.lenis { scroll-behavior: auto; }   /* Lenis animates scrolling itself */

body {
  margin: 0;
  background: var(--concrete);
  color: var(--asphalt);
  font-family: "Public", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bar-h);
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: from-font; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; }
[role="list"] { list-style: none; }
figure { margin: 0; }
button { font: inherit; }

::selection { background: var(--layout); color: var(--asphalt); }
:focus-visible { outline: 3px solid var(--layout); outline-offset: 3px; box-shadow: 0 0 0 6px var(--asphalt); }

.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--layout); color: var(--asphalt); padding: .75rem 1rem; font-weight: 700;
}
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.h2 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.6rem, 1.4rem + 4.6vw, 5.5rem);
  line-height: .9; letter-spacing: -.005em;
}
.lede { margin-top: 1.1rem; max-width: 44ch; font-size: 1.125rem; color: var(--steel); }

/* ---------- Buttons: square, heavy ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: .8rem 1.5rem;
  font-weight: 700; font-size: 1rem; line-height: 1.1; letter-spacing: .01em;
  text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: 0; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .15s cubic-bezier(.2,.7,.3,1);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 2.6rem; padding: .5rem 1rem; font-size: .9375rem; }
.btn--go { background: var(--layout); color: var(--asphalt); }
.btn--go:hover { background: var(--layout-deep); }
.btn--ghost { color: var(--white); border-color: var(--white); background: rgb(22 25 27 / .35); }
.btn--ghost:hover { background: var(--white); color: var(--asphalt); }

/* ---------- Header ---------- */

.header { position: fixed; inset: 0 0 auto 0; z-index: 50; color: var(--white); transition: background-color .25s, color .25s; }
.header::before {
  content: ""; position: absolute; inset: 0 0 -2.5rem 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgb(22 25 27 / .7), rgb(22 25 27 / 0));
  transition: opacity .25s;
}
.header.is-solid { background: var(--asphalt); }
.header.is-solid::before { opacity: 0; }
.header__inner {
  max-width: var(--max); margin-inline: auto; padding: .7rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark { display: inline-flex; align-items: baseline; gap: .4rem; text-decoration: none; line-height: 1; }
.wordmark__name { font-family: var(--display); font-weight: 900; font-size: 1.9rem; text-transform: uppercase; letter-spacing: .01em; }
.wordmark__sub { font-family: var(--display); font-weight: 600; font-size: 1.15rem; text-transform: uppercase; color: var(--layout); }

.nav { display: none; gap: 1.75rem; font-weight: 600; font-size: .9375rem; }
.nav a { text-decoration: none; padding-block: .4rem; background: linear-gradient(var(--layout), var(--layout)) 0 100% / 0 2px no-repeat; transition: background-size .2s; }
.nav a:hover { background-size: 100% 2px; }
.header__actions { display: flex; align-items: center; gap: 1rem; }
.header__phone { display: none; font-weight: 700; text-decoration: none; }
.header__actions .btn { display: none; }
@media (min-width: 640px) { .header__actions .btn { display: inline-flex; } }
@media (min-width: 1020px) { .nav { display: flex; } .header__phone { display: inline; } }

/* ---------- Hero ---------- */

.hero { position: relative; height: 300vh; height: 300svh; background: var(--asphalt); }
.hero__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero__poster, .hero__poster img, .hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__poster img { object-fit: cover; object-position: 30% 50%; }
.hero__canvas { opacity: 0; transition: opacity .4s; }
.hero__canvas.is-ready { opacity: 1; }
.hero__wash {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgb(22 25 27 / .92) 0%, rgb(22 25 27 / .6) 38%, rgb(22 25 27 / 0) 68%),
    linear-gradient(90deg, rgb(22 25 27 / .5) 0%, rgb(22 25 27 / 0) 55%);
}
.hero__copy {
  position: absolute; inset: auto 0 0 0;
  max-width: var(--max); margin-inline: auto;
  padding: 0 var(--gutter) calc(2.25rem + max(var(--bar-h), env(safe-area-inset-bottom)));
  color: var(--white);
}
.hero__title {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(4rem, 1.2rem + 9.5vw, 10.5rem); line-height: .84; letter-spacing: -.01em;
  max-width: 9ch;
}
.hero__lede { margin-top: 1.25rem; max-width: 50ch; font-size: clamp(1rem, .95rem + .25vw, 1.15rem); color: rgb(255 255 255 / .9); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero__late { margin-top: 1.1rem; font-weight: 600; font-size: .9375rem; color: var(--pine); opacity: 0; transform: translateY(.75rem); }
@media (prefers-reduced-motion: reduce) { .hero__late { opacity: 1; transform: none; } }
@media (max-width: 639px) {
  .hero__lede-more { display: none; }
  .hero__ctas .btn { flex: 1 1 100%; }
}

/* ---------- Dimension line: the measured-line motif ---------- */

.dim {
  --len: calc(var(--weeks, 14) / 14 * 100%);
  position: relative; height: 2.6rem; margin-top: 1.25rem; color: var(--pine);
}
.dim__line {
  position: absolute; left: 0; bottom: .55rem; width: var(--len); height: 2px; background: currentColor;
}
.dim__line::before, .dim__line::after {
  content: ""; position: absolute; top: -.45rem; width: 2px; height: 1.05rem; background: currentColor;
}
.dim__line::before { left: 0; }
.dim__line::after { right: 0; }
.dim__label {
  position: absolute; left: 0; top: 0;
  font-family: var(--display); font-weight: 800; font-size: 1.3rem; line-height: 1; text-transform: uppercase; letter-spacing: .02em;
}

/* ---------- Services ---------- */

.services { padding-block: clamp(4.5rem, 9vw, 8rem); }
.services__grid { display: grid; gap: 3rem; }
.services__photo { margin-top: 2rem; aspect-ratio: 4 / 3; overflow: hidden; background: var(--slab); }
.services__photo img { width: 100%; height: 100%; object-fit: cover; }
.svc { border-top: 4px solid var(--asphalt); }
.svc li { display: grid; gap: .3rem; padding: 1.35rem 0; border-bottom: 1px solid var(--rule); }
.svc h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.4rem); line-height: .95; }
.svc p { color: var(--steel); max-width: 52ch; }
@media (min-width: 960px) {
  .services__grid { grid-template-columns: 1fr 1.15fr; gap: 5rem; align-items: start; }
  .services__intro { position: sticky; top: 6rem; }
  .svc li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 2rem; align-items: baseline; }
}

/* ---------- Projects ---------- */

.projects { background: var(--asphalt); color: var(--white); padding-block: clamp(4.5rem, 9vw, 8rem); }
.projects__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.projects__key { color: var(--gravel); max-width: 34ch; }
.proj-grid { display: grid; gap: 3rem 2rem; margin-top: 3rem; }
@media (min-width: 820px) { .proj-grid { grid-template-columns: 1fr 1fr; } }

.proj__open {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--asphalt-2);
  cursor: zoom-in; aspect-ratio: 3 / 2; overflow: hidden;
}
.proj__open img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.proj__open:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .proj__open:hover img { transform: none; } }
.proj__zoom {
  position: absolute; right: 0; bottom: 0; padding: .45rem .75rem;
  background: var(--asphalt); color: var(--white); font-size: .875rem; font-weight: 700;
}
.proj__body { padding-top: 1.35rem; }
.proj__name { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 1.5rem + 1.5vw, 2.75rem); line-height: .95; }
.proj__town { margin-top: .35rem; font-weight: 700; color: var(--pine); }
.proj__scope { margin-top: .5rem; color: var(--gravel); max-width: 54ch; }

.fineprint { margin-top: 3rem; font-size: .875rem; color: var(--gravel); }

/* Lightbox */
.lightbox {
  width: min(1200px, 100vw - 2rem); max-height: calc(100vh - 2rem); padding: 0; border: 0;
  background: var(--asphalt); color: var(--white); overflow: auto;
}
.lightbox::backdrop { background: rgb(22 25 27 / .9); }
.lightbox__bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end; }
.lightbox__close {
  min-height: 2.75rem; padding: .5rem 1.1rem; border: 0; cursor: pointer;
  background: var(--layout); color: var(--asphalt); font-weight: 700;
}
.lightbox__frame { background: var(--asphalt-2); }
.lightbox__frame img { width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 14rem); margin-inline: auto; }
.lightbox__caption { padding: 1.25rem 1.5rem 1.75rem; }
.lightbox__title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 2.25rem; line-height: 1; }
.lightbox__meta { margin-top: .35rem; font-weight: 700; color: var(--pine); }
.lightbox__scope { margin-top: .5rem; color: var(--gravel); max-width: 64ch; }

/* ---------- Process ---------- */

.process { padding-block: clamp(4.5rem, 9vw, 8rem); }
.process__head { display: grid; gap: 2.5rem; align-items: end; }
.process__photo { aspect-ratio: 16 / 9; overflow: hidden; background: var(--slab); }
.process__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
@media (min-width: 960px) { .process__head { grid-template-columns: 1fr 1.2fr; gap: 4rem; } }

.steps { position: relative; display: grid; gap: 0; margin-top: 3.5rem; }
.steps li { position: relative; display: grid; grid-template-columns: 3.5rem 1fr; column-gap: 1rem; padding: 0 0 2rem; }
.steps li::before { content: ""; position: absolute; left: 1.2rem; top: 2.6rem; bottom: 0; width: 2px; background: var(--asphalt); }
.steps li:last-child::before { display: none; }
.steps__num {
  grid-row: span 2; display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
  background: var(--asphalt); color: var(--layout);
  font-family: var(--display); font-weight: 900; font-size: 1.6rem; line-height: 1;
}
.steps h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.8rem; line-height: 1; padding-top: .35rem; }
.steps p { margin-top: .4rem; color: var(--steel); max-width: 40ch; }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; padding-top: 0; }
  /* one long dimension line from site visit to walkthrough */
  .steps::before { content: ""; position: absolute; left: 0; right: 0; top: 1.25rem; height: 2px; background: var(--asphalt); }
  .steps::after { content: ""; position: absolute; right: 0; top: .7rem; width: 2px; height: 1.15rem; background: var(--asphalt); }
  .steps li { display: block; padding: 0; }
  .steps li::before { display: none; }
  .steps__num { position: relative; margin-bottom: 1.25rem; }
  .steps h3 { padding-top: 0; }
}

/* ---------- Spec sheet: every estimate includes ---------- */

.spec { background: var(--slab); padding-block: clamp(4.5rem, 9vw, 7rem); }
.spec__grid { display: grid; gap: 2.5rem; }
@media (min-width: 960px) { .spec__grid { grid-template-columns: 1fr 1.4fr; gap: 5rem; align-items: start; } }
.spec__list { border-top: 4px solid var(--asphalt); }
.spec__list div { display: grid; gap: .2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.spec__list dt { font-weight: 800; font-size: 1.15rem; }
.spec__list dd { color: var(--steel); }
@media (min-width: 640px) { .spec__list div { grid-template-columns: 15rem 1fr; column-gap: 1.5rem; align-items: baseline; } }
.spec__note { margin-top: 1.5rem; padding: 1rem 1.25rem; background: var(--asphalt); color: var(--white); font-weight: 700; }

/* ---------- Service area ---------- */

.area { padding-block: clamp(4.5rem, 9vw, 8rem); }
.area__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .area__grid { grid-template-columns: 1fr 1.15fr; gap: 4rem; } }
.towns { margin-top: 1.5rem; border-top: 4px solid var(--asphalt); }
.towns li {
  padding: .45rem 0; border-bottom: 1px solid var(--rule);
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.6rem); line-height: 1;
}
.area__note { margin-top: 1.5rem; color: var(--steel); max-width: 44ch; }
.area__note a { font-weight: 700; color: var(--asphalt); }

.map {
  position: relative; isolation: isolate; /* keep Leaflet's pane z-indexes under the fixed header */
  aspect-ratio: 4 / 3; overflow: hidden; background: var(--map-land); border: 4px solid var(--asphalt);
}
.map__canvas { position: absolute; inset: 0; background: var(--map-land); }
.map .leaflet-container { font-family: inherit; font-size: .75rem; background: var(--map-land); }
.map .leaflet-control-attribution { background: rgb(255 255 255 / .9); color: var(--steel); padding: .1rem .4rem; }
.map .leaflet-control-attribution a { color: var(--asphalt); }
.map .leaflet-bar { border-radius: 0; }
.map .leaflet-bar a { color: var(--asphalt); border-radius: 0 !important; }
.map__activate {
  position: absolute; right: .75rem; top: .75rem; z-index: 1000;
  font-weight: 700; font-size: .875rem; cursor: pointer;
  background: var(--asphalt); color: var(--white); border: 0; padding: .6rem .9rem; min-height: 2.75rem;
}
.map.is-active .map__activate, .map.is-failed .map__activate { display: none; }

/* ---------- Estimate + contact ---------- */

.estimate { background: var(--asphalt); color: var(--white); padding-block: clamp(4.5rem, 9vw, 8rem); }
.estimate__grid { display: grid; gap: 2.5rem; }
@media (min-width: 980px) { .estimate__grid { grid-template-columns: 1.5fr 1fr; gap: 4rem; align-items: start; } }

.demo-flag { display: inline-block; margin-top: 1.25rem; padding: .55rem .8rem; background: var(--asphalt-2); font-size: .9375rem; }
.demo-flag__tag {
  display: inline-block; margin-right: .4rem; padding: .05rem .45rem;
  background: var(--layout); color: var(--asphalt); font-size: .8125rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}

.form { display: grid; gap: 1rem; margin-top: 1.25rem; background: var(--concrete); color: var(--asphalt); padding: 1.5rem; }
@media (min-width: 640px) { .form { grid-template-columns: 1fr 1fr; padding: 2rem; } .field--wide { grid-column: 1 / -1; } }
.field { display: grid; gap: .4rem; min-width: 0; }
.field label { font-weight: 700; font-size: .9375rem; }
.optional { font-weight: 400; color: var(--steel); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--asphalt);
  background: var(--white); border: 2px solid var(--asphalt); border-radius: 0;
  padding: .75rem .85rem; min-height: 3rem; width: 100%; caret-color: var(--asphalt);
}
.field select {
  appearance: none; padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--asphalt) 50%), linear-gradient(135deg, var(--asphalt) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - .8rem) 55%;
  background-size: .35rem .35rem; background-repeat: no-repeat;
}
.field textarea { resize: vertical; min-height: 6.5rem; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--layout); outline-offset: 0; box-shadow: none; }
.form .btn { justify-self: start; }
.form__status { font-weight: 700; }
.form__status:empty { display: none; }

.contact { padding: 1.75rem 1.5rem; background: var(--asphalt-2); }
.contact__title { font-size: 1rem; font-weight: 700; color: var(--gravel); }
.contact__title--hours { margin-top: 1.75rem; }
.contact__phone {
  display: block; margin-top: .35rem; text-decoration: none; white-space: nowrap;
  font-family: var(--display); font-weight: 800; font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem); line-height: 1; color: var(--layout);
}
.contact__phone:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.contact__line { margin-top: .6rem; color: var(--gravel); overflow-wrap: anywhere; }
.contact__line a { color: var(--white); }
.status { margin-top: .5rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.status::before { content: ""; width: .6rem; height: .6rem; background: var(--gravel); }
.status.is-open::before { background: var(--layout); }
.hours { width: 100%; margin-top: .75rem; border-collapse: collapse; }
.hours th, .hours td { padding: .5rem 0; border-top: 1px solid var(--rule-dark); vertical-align: top; }
.hours th { text-align: left; font-weight: 400; color: var(--gravel); padding-right: 1rem; }
.hours td { text-align: right; font-weight: 600; }
.hours tr.is-today th, .hours tr.is-today td { color: var(--white); font-weight: 700; }
.today-tag {
  display: inline-block; margin-left: .5rem; padding: 0 .4rem;
  background: var(--layout); color: var(--asphalt); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; vertical-align: .1em;
}

/* ---------- Footer ---------- */

.footer { background: var(--asphalt); color: var(--gravel); border-top: 1px solid var(--rule-dark); }
.footer__grid { display: grid; gap: 2rem; padding-block: 3.5rem 2rem; }
.wordmark--footer { color: var(--white); }
.footer__tag { margin-top: 1rem; max-width: 40ch; }
.footer__nav, .footer__contact { display: grid; gap: .5rem; align-content: start; }
.footer__nav a, .footer__contact a { color: var(--white); text-decoration: none; font-weight: 600; width: fit-content; }
.footer__nav a:hover, .footer__contact a:hover { color: var(--layout); }
.footer__contact { overflow-wrap: anywhere; }
.footer__legal { padding-block: 1.5rem 2rem; border-top: 1px solid var(--rule-dark); font-size: .875rem; }
@media (min-width: 820px) { .footer__grid { grid-template-columns: 1.5fr 1fr 1fr; } }

/* ---------- Mobile action bar ---------- */

.mobile-bar {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1.3fr; gap: .5rem;
  padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom));
  background: var(--asphalt); border-top: 1px solid var(--rule-dark);
}
.mobile-bar a {
  display: flex; align-items: center; justify-content: center; min-height: 3rem;
  text-decoration: none; font-weight: 800; -webkit-tap-highlight-color: transparent;
}
.mobile-bar__call { color: var(--white); border: 2px solid var(--white); }
.mobile-bar__go { background: var(--layout); color: var(--asphalt); }
@media (max-width: 759px) { :root { --bar-h: calc(4rem + env(safe-area-inset-bottom)); } }
@media (min-width: 760px) { .mobile-bar { display: none; } }

@media (hover: none) {
  .btn--go:hover { background: var(--layout); }
  .btn--ghost:hover { background: rgb(22 25 27 / .35); color: var(--white); }
}
