:root {
  --paper: #ffffff;
  --granite: #eceeeb;
  --spruce: #1d2521;
  --stone: #5c6560;
  --maroon: #6b1118;
  --maroon-dark: #520c12;
  --cedar: #a4643a;
  --rule: #cfd4d0;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 10vw, 128px);
}

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

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 76px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--spruce);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  letter-spacing: -0.005em;
  margin-bottom: clamp(32px, 5vw, 56px);
}

h3 {
  font-size: 2rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.4em;
}

p { margin: 0 0 1em; max-width: 62ch; }

/* Buttons and links */

.btn {
  display: inline-block;
  background: var(--maroon);
  color: #fff;
  font: 600 1.25rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 26px 15px;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--maroon-dark); }

.btn-small { font-size: 1.05rem; padding: 11px 16px 10px; }

.link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--cedar);
}
.link:hover { color: var(--maroon); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 76px;
}

.brand img { width: 210px; }

.site-header nav { margin-left: auto; }

.site-header ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  font-weight: 500;
  text-decoration: none;
  color: var(--stone);
}
.site-header nav a:hover { color: var(--spruce); }

/* Hero */

.hero { padding-top: clamp(40px, 7vw, 88px); overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(3rem, 5.4vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--maroon);
  margin-bottom: 28px;
}

.lede { font-size: 1.2rem; color: var(--stone); margin-bottom: 36px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
}

.hero-photo {
  margin: 0 calc(-1 * var(--gutter)) 0 0;
}
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  object-position: 45% 20%;
}

/* Plank lines */

.planks {
  display: block;
  width: 100%;
  height: 44px;
  stroke: var(--spruce);
  stroke-width: 2.4;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.planks path { vector-effect: non-scaling-stroke; }

.planks-hero { margin-top: clamp(40px, 6vw, 72px); }

@media (prefers-reduced-motion: no-preference) {
  .planks-hero path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: draw 1.4s cubic-bezier(.6, 0, .2, 1) forwards;
  }
  .planks-hero path:nth-child(2) { animation-delay: 0.08s; }
  .planks-hero path:nth-child(3) { animation-delay: 0.16s; }
  .planks-hero path:nth-child(4) { animation-delay: 0.24s; }
  .planks-hero path:nth-child(5) { animation-delay: 0.32s; }
}

@keyframes draw { to { stroke-dashoffset: 0; } }

/* What we build */

.build { padding: var(--section) 0; }

.build-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1px solid var(--rule);
}
.build-row:last-child { border-bottom: 1px solid var(--rule); }

.build-row img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.build-row-flip img { order: 2; }

.build-row p { color: var(--stone); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}
.tags li {
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 4px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

/* Recent work */

.work {
  background: var(--granite);
  padding: var(--section) 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: clamp(180px, 22vw, 270px);
  gap: 14px;
}

.gallery figure {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-wide { grid-column: span 2; grid-row: span 2; }
.g-tall { grid-row: span 2; }
.g-span2 { grid-column: span 2; }

.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 16px 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  background: linear-gradient(transparent, rgba(16, 22, 19, 0.75));
}

/* Process */

.process { padding: var(--section) 0; }

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  border-top: 3px solid var(--spruce);
  padding-top: 18px;
}

.steps li::before {
  content: counter(step);
  display: block;
  font: 700 3.5rem/1 var(--display);
  color: var(--cedar);
  margin-bottom: 14px;
}

.steps h3 { font-size: 1.6rem; }
.steps p { color: var(--stone); }

/* Estimate */

.estimate {
  background: var(--spruce);
  color: #fff;
  padding: var(--section) 0;
}

.estimate h2 { margin-bottom: 20px; }
.estimate p { color: #c3cbc6; }

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px);
}

.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 24px;
  margin: 36px 0 0;
}
.contact dt { color: #9aa49e; }
.contact dd { margin: 0; font-weight: 600; }
.contact a { text-decoration: none; }
.contact a:hover { text-decoration: underline; }

.form {
  display: grid;
  gap: 18px;
}

.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 500;
}

.form input,
.form select,
.form textarea {
  font: inherit;
  color: var(--spruce);
  background: #fff;
  border: 2px solid transparent;
  border-radius: 2px;
  padding: 12px 14px;
  width: 100%;
}
.form textarea { resize: vertical; }
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--cedar);
}

.form .btn { justify-self: start; margin-top: 6px; }
.form .btn { background: var(--paper); color: var(--maroon); }
.form .btn:hover { background: var(--granite); }

.form .btn:disabled { opacity: 0.7; cursor: default; }

.form-status {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--cedar);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.form-status.is-error { border-left-color: #e07a7a; }

/* Spam trap for Netlify; hidden from people */
.hp { position: absolute; left: -9999px; }

/* Footer */

.site-footer {
  padding: 48px 0 32px;
  color: var(--stone);
  font-size: 0.95rem;
}
.site-footer .planks { margin-bottom: 28px; opacity: 0.85; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.footer-inner p { margin: 0; }

.footer-inner address {
  font-style: normal;
  margin-top: 10px;
  line-height: 1.5;
}
.footer-inner address a { text-decoration: none; }
.footer-inner address a:hover { color: var(--spruce); text-decoration: underline; }

/* Responsive */

@media (max-width: 900px) {
  .site-header nav { display: none; }
  .header-inner { justify-content: space-between; height: 64px; }
  .brand img { width: 170px; }

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

  .hero-photo { margin: 0 calc(-1 * var(--gutter)); }

  .build-row { grid-template-columns: 1fr; }
  .build-row-flip img { order: 0; }

  .steps { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
}

@media (max-width: 600px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }
  .g-wide, .g-tall, .g-span2 { grid-column: auto; grid-row: auto; }

  .steps { grid-template-columns: 1fr; }
  .form-pair { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .btn-small { font-size: 0.95rem; padding: 10px 12px 9px; }
  .brand img { width: 140px; }
}
