/* Tri-State Home Improvement
   Palette: Signal red #A80000, Black #000000, Steel grey #85868A, White #FFFFFF.
   Steel grey is kept to rules, ticks and text on black; on white it is below
   AA contrast for body copy, so small text on white stays black. */

:root {
  --red: #A80000;
  --red-dark: #8A0000;
  --black: #000000;
  --grey: #85868A;
  --white: #FFFFFF;
  --tint: #F3F3F4;          /* 6% steel grey on white, for quiet panels */
  --rule: rgba(133, 134, 138, .45);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 136px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
figure { margin: 0; }
h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h3 { font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--black); color: var(--white); padding: 10px 16px; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px;
  font: 700 0.95rem/1 var(--font);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-lg { padding: 17px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { border-color: var(--white); color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--black); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; color: var(--black); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong {
  font-size: 1.35rem; font-weight: 900;
  font-variation-settings: "wdth" 125; letter-spacing: -0.02em;
}
.brand-text span { font-size: .8rem; font-weight: 500; margin-top: 4px; letter-spacing: .01em; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:not(.btn):hover { color: var(--red); }
.nav-phone { font-variant-numeric: tabular-nums; }

.nav-toggle { display: none; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
  min-height: min(calc(100vh - 76px), 820px);
  background: var(--black);
  color: var(--white);
}
.hero-copy {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(56px, 8vw, 112px) clamp(24px, 5vw, 72px);
  padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
}
.hero h1 {
  font-size: clamp(2.75rem, 4.3vw, 4.5rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -0.035em;
}
.hero h1 span { display: block; white-space: nowrap; }
.lede { margin-top: 28px; max-width: 34em; color: #D6D6D8; font-size: 1.125rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.hero-media { position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* The signature element: an architect's dimension line over the headline */
.dim {
  position: relative;
  height: 22px;
  max-width: 420px;
  margin-bottom: 26px;
  color: var(--red);
}
.dim::before {                 /* the line itself, with end ticks */
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; background: currentColor;
  transform-origin: left center;
  animation: dim-draw 1.1s cubic-bezier(.6,.05,.2,1) .25s both;
}
.dim::after {
  content: "";
  position: absolute; inset: 0;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  animation: dim-ticks .3s ease-out .2s both;
}
.dim span {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 12px;
  background: var(--black);
  color: var(--grey);
  font-size: .85rem; font-weight: 500; font-style: italic;
  white-space: nowrap;
  animation: dim-label .5s ease-out 1.2s both;
}
@keyframes dim-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dim-ticks { from { opacity: 0; } to { opacity: 1; } }
@keyframes dim-label { from { opacity: 0; } to { opacity: 1; } }

/* Trust strip */
.trust { border-bottom: 1px solid var(--rule); }
.trust-list {
  list-style: none; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.trust-list li {
  padding: 26px 24px 26px 0;
  font-size: .95rem;
  line-height: 1.4;
}
.trust-list li + li { padding-left: 24px; border-left: 1px solid var(--rule); }
.trust-list strong { display: block; font-size: 1.05rem; }

/* Section heads */
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 64px; align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head p { max-width: 36em; font-size: 1.125rem; }

/* Services */
.services { padding: var(--section) 0; }
.services-grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.service-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--black); }
.service-list li { border-bottom: 1px solid var(--rule); }
.service {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 6px 32px; align-items: baseline;
  width: 100%;
  padding: 24px 0 24px 0;
  background: none; border: 0; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  position: relative;
}
.service-name::before {         /* red marker slides in on the active row */
  content: ""; position: absolute; left: -32px; top: .6em;
  width: 0; height: 2px; background: var(--red);
  transition: width .25s ease;
}
.service-name {
  position: relative;
  font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 800;
  font-variation-settings: "wdth" 115; letter-spacing: -0.015em; line-height: 1.15;
  transition: transform .25s ease, color .15s;
}
.service-desc { color: var(--black); font-size: .98rem; line-height: 1.45; }
.service.is-active .service-name { color: var(--red); transform: translateX(32px); }
.service.is-active .service-name::before { width: 20px; }
.service:hover .service-name { color: var(--red); }

.service-media {
  position: sticky; top: 110px;
  aspect-ratio: 5 / 6;
  overflow: hidden; background: var(--tint);
}
.service-media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease; }
.service-media img.is-fading { opacity: 0; }

/* Work gallery */
.work { padding: 0 0 var(--section); }
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(150px, 16vw, 230px);
  gap: 16px;
}
.g { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.g img { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.g figcaption { padding-top: 10px; font-size: .9rem; font-weight: 600; }
.g1 { grid-column: 1 / 8;  grid-row: span 2; }
.g2 { grid-column: 8 / 13; grid-row: span 2; }
.g3 { grid-column: 1 / 5;  grid-row: span 2; }
.g4 { grid-column: 5 / 9;  grid-row: span 2; }
.g5 { grid-column: 9 / 13; grid-row: span 2; }

/* About */
.about {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--tint);
}
.about-media img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }
.about-copy {
  padding: var(--section) clamp(24px, 5vw, 72px);
  padding-right: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  max-width: 760px;
}
.about-copy p { margin-top: 24px; font-size: 1.125rem; max-width: 34em; }
.checks { list-style: none; margin: 32px 0 0; padding: 0; }
.checks li {
  position: relative;
  padding: 14px 0 14px 34px;
  border-top: 1px solid var(--rule);
}
.checks li::before {
  content: ""; position: absolute; left: 2px; top: 21px;
  width: 14px; height: 8px;
  border-left: 3px solid var(--red); border-bottom: 3px solid var(--red);
  transform: rotate(-45deg);
}

/* Process */
.process { padding: var(--section) 0; }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  counter-reset: step;
  position: relative;
}
.steps::before {               /* one continuous rule tying the steps together */
  content: ""; position: absolute; left: 0; right: 0; top: 27px;
  height: 2px; background: var(--black);
}
.steps li { position: relative; padding-right: 32px; }
.step-n {
  position: relative;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 50%;
  font-size: 1.35rem; font-weight: 800;
  font-variation-settings: "wdth" 125;
  margin-bottom: 24px;
}
.steps li:first-child .step-n { background: var(--red); border-color: var(--red); color: var(--white); }
.steps p { margin-top: 10px; }

/* Estimate */
.estimate { background: var(--black); color: var(--white); padding: var(--section) 0; }
.estimate-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px);
}
.estimate-copy p { margin-top: 20px; font-size: 1.125rem; color: #D6D6D8; max-width: 30em; }
.contact { margin: 40px 0 0; }
.contact div { display: grid; grid-template-columns: 80px 1fr; padding: 14px 0; border-top: 1px solid rgba(133,134,138,.5); }
.contact dt { color: var(--grey); }
.contact dd { margin: 0; font-weight: 600; }
.contact a { text-decoration: none; }
.contact a:hover { color: #FF8A8A; }

.estimate-form { background: var(--white); color: var(--black); padding: clamp(24px, 4vw, 44px); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  font: inherit; font-size: 1rem;
  color: var(--black); background: var(--white);
  border: 1px solid var(--grey);
  border-radius: 2px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--black); box-shadow: 0 0 0 2px var(--black);
}
.field [aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.form-error { color: var(--red); font-weight: 600; margin: -4px 0 16px; }

/* Footer */
.site-footer { background: var(--black); color: var(--white); border-top: 1px solid rgba(133,134,138,.4); }
.footer-inner {
  display: grid; grid-template-columns: 1fr auto; gap: 24px 48px;
  padding-top: 48px; padding-bottom: 40px;
}
.footer-brand strong { font-size: 1.1rem; font-variation-settings: "wdth" 125; }
.footer-brand p { color: var(--grey); margin-top: 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: start; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: #FF8A8A; }
.footer-legal { grid-column: 1 / -1; color: var(--grey); font-size: .875rem; padding-top: 24px; border-top: 1px solid rgba(133,134,138,.4); }

/* Tablet */
@media (max-width: 1080px) {
  .site-nav { gap: 20px; }
  .nav-phone { display: none; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .steps::before { display: none; }
}

/* Mobile */
@media (max-width: 900px) {
  .nav-toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    background: none; border: 0; cursor: pointer;
  }
  .bars, .bars::before, .bars::after {
    display: block; width: 24px; height: 2px; background: var(--black);
    position: relative; transition: transform .2s, background-color .2s;
  }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -7px; }
  .bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute; left: 0; right: 0; top: 76px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white);
    border-bottom: 2px solid var(--black);
    padding: 8px var(--gutter) 24px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 1.1rem; }
  .nav-phone { display: block; }
  .site-nav .btn { margin-top: 20px; padding: 16px; }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 56px var(--gutter) 48px; }
  .hero-media { aspect-ratio: 4 / 3; order: -1; }

  .section-head { grid-template-columns: 1fr; }

  .services-grid { grid-template-columns: 1fr; }
  .service-media { position: relative; top: 0; order: -1; aspect-ratio: 4 / 3; }
  .service { grid-template-columns: 1fr; padding: 18px 0; }

  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 200px; gap: 12px; }
  .g1, .g5 { grid-column: 1 / -1; grid-row: span 2; }
  .g2, .g3, .g4 { grid-column: auto; grid-row: span 1; }
  .g4 { grid-column: 1 / -1; }

  .about { grid-template-columns: 1fr; }
  .about-media img { min-height: 0; aspect-ratio: 4 / 3; }
  .about-copy { padding: 64px var(--gutter); }

  .estimate-inner { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3.25rem); }
  .hero-actions .btn { width: 100%; }
  .trust-list { grid-template-columns: 1fr; }
  .trust-list li, .trust-list li + li { padding: 18px 0; border-left: 0; }
  .trust-list li + li { border-top: 1px solid var(--rule); }
  .steps { grid-template-columns: 1fr; row-gap: 36px; }
  .field-row { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .g1, .g2, .g3, .g4, .g5 { grid-column: 1 / -1; grid-row: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
