/* K.D. Clark Construction — a cabinetmaker's card. */
:root {
  --field: #f6f1e7;
  --ink: #221d14;
  --call: #9e2b25;
  --ghost: #f6f1e7;
  --accent: #7c4a21;
  --sage: #5f6f52;
  --card: #efe6d3;
  --line: #d8c9ab;

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

  --ease-out-expo: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-expo-alt: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-circ: cubic-bezier(0.075, 0.82, 0.165, 1);
  --dur-fast: 0.3s;
  --dur-hover: 0.5s;
  --dur-enter: 0.7s;
  --dur-hero: 1.5s;
}

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

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0 0 0.4em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

a { color: var(--call); }
a:hover { color: var(--accent); }

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

.kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9em;
}

section { padding: 5rem 6vw; }

.section-head {
  max-width: 40rem;
  margin-bottom: 2.75rem;
}

/* Header — wordmark left, jumps, Call pill. Never animated. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.8rem 6vw;
  background: var(--field);
  border-bottom: 2px solid var(--ink);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
}

.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-header .btn-fill {
  background: var(--call);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--call);
}

.site-header .btn-fill:hover { color: #fff; }

/* Hero — full-bleed plate, copy on the image. */
.hero {
  padding: 0;
  display: flex;
  align-items: center;
  min-height: 100dvh;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(100deg, rgba(28, 22, 13, 0.78) 0%, rgba(28, 22, 13, 0.55) 34%, rgba(28, 22, 13, 0.12) 62%, rgba(28, 22, 13, 0) 78%);
  pointer-events: none;
}

.hero-img { object-position: center 30%; }

.hero-copy {
  z-index: 1;
  max-width: 34rem;
  margin: 0 6vw;
  padding: 4rem 0;
  color: var(--field);
}

.hero-copy .kicker { color: #e8d5ae; }

.hero-copy p { max-width: 30rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.6rem 0 0;
}

.hero-actions .btn {
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
}

.hero-actions .btn-fill {
  background: var(--call);
  color: #fff;
  border: 2px solid var(--call);
}

.hero-actions .btn-fill:hover { color: #fff; }

.hero-actions .btn-ghost {
  border: 2px solid var(--field);
  color: var(--field);
  background: transparent;
}

.hero-actions .btn-ghost:hover {
  background: rgba(246, 241, 231, 0.16);
  color: var(--field);
}

/* Services river — illustration on one half, copy on the other, flipping. */
.services { padding-bottom: 3rem; }

.river { display: grid; gap: 0; }

.river .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 2.75rem 0;
  border-top: 2px solid var(--line);
}

.river .row:last-child { border-bottom: 2px solid var(--line); }

.river .row:nth-child(even) figure { order: 2; }

.river figure {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.river figure img { width: 100%; }

.row-copy h3 { margin-bottom: 0.35em; }
.row-copy p { margin: 0; max-width: 32rem; }

/* Work — three honest plates. */
.work { background: var(--ink); color: var(--field); }
.work .kicker { color: #e8d5ae; }

.plates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.plates figure { margin: 0; }

.plates img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.plates figcaption {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e8d5ae;
}

/* About — voice plus the credential card. */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-cta { margin-top: 1.6rem; }

.about-cta .btn-fill {
  display: inline-block;
  background: var(--call);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--call);
}

.about-cta .btn-fill:hover { color: #fff; }

.creds {
  margin: 0;
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 1.75rem;
  display: grid;
  gap: 1.1rem;
}

.creds div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.creds div:first-child { border-top: 0; padding-top: 0; }

.creds dt {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.creds dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Area — one sage band, the towns written out. */
.area { background: var(--sage); color: var(--field); }
.area .kicker { color: #e8d5ae; }
.area .section-head { margin-bottom: 0; }
.area p:last-child { margin-bottom: 0; max-width: 44rem; }

/* Contact — lines, mailto form, map. */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-lines {
  list-style: none;
  margin: 0 0 2.25rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.contact-lines li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.contact-lines svg { color: var(--accent); flex: none; }

.contact-lines a { color: var(--ink); }
.contact-lines a:hover { color: var(--call); }

#quote-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 1.5rem;
}

#quote-form .field { display: grid; gap: 0.35rem; }
#quote-form .field-wide { grid-column: 1 / -1; }

#quote-form label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#quote-form input,
#quote-form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--ink);
  padding: 0.6rem 0.7rem;
  border-radius: 0;
  width: 100%;
}

#quote-form .form-note {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  margin: 0;
}

#quote-form button {
  grid-column: 1 / -1;
  justify-self: start;
  font: inherit;
  font-weight: 700;
  background: var(--call);
  color: #fff;
  border: 2px solid var(--call);
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
}

#quote-form button:hover { transform: translate3d(0, -2px, 0); }

.map iframe {
  width: 100%;
  min-height: 26rem;
  height: 100%;
  border: 2px solid var(--ink);
}

/* Footer. */
.site-footer {
  padding: 2.5rem 6vw 3rem;
  background: var(--ink);
  color: var(--field);
}

.site-footer p { margin: 0 0 0.4em; max-width: none; }
.site-footer .fine { font-size: 0.9rem; color: #cdbf9f; }
.site-footer a { color: var(--field); }

/* 390 — same brand, narrower. Hero slab pins to the bottom third. */
@media (max-width: 760px) {
  section { padding: 3.5rem 5vw; }

  .site-header { gap: 0.75rem; padding: 0.7rem 5vw; }
  .site-header nav { display: none; }
  .brand { font-size: 0.98rem; }
  .site-header .btn-fill { font-size: 0.82rem; padding: 0.55rem 0.85rem; }

  .river .row,
  .river .row:nth-child(even) figure { grid-template-columns: 1fr; }
  .river .row { gap: 1.25rem; padding: 2rem 0; }
  .river .row:nth-child(even) figure { order: 0; }

  .plates { grid-template-columns: 1fr; }
  .about, .contact { grid-template-columns: 1fr; gap: 2rem; }
  #quote-form { grid-template-columns: 1fr; }
  .map iframe { min-height: 18rem; }
}

@media (max-width: 640px) {
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100dvh;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(28, 22, 13, 0) 40%, rgba(28, 22, 13, 0.55) 66%, rgba(28, 22, 13, 0.82) 100%);
  }

  .hero-copy {
    margin: 0 1rem calc(1rem + env(safe-area-inset-bottom));
    padding: 1.15rem 1.1rem 1.05rem;
    max-width: none;
    background: rgba(28, 22, 13, 0.55);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(246, 241, 231, 0.25);
  }

  .hero-copy h1 { font-size: 1.9rem; }
  /* Bottom third only: the body stays in the DOM, off the narrow fold. */
  .hero-copy p:not(.kicker):not(.hero-actions) { display: none; }
  .hero-copy p { font-size: 0.98rem; }
  .hero-actions .btn { padding: 0.7rem 1.1rem; font-size: 0.95rem; }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4em;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--field);
  padding: 0.5rem 1rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out-circ), color var(--dur-fast) var(--ease-out-circ), transform var(--dur-fast) var(--ease-out-circ);
}
.btn:hover {
  transform: translate3d(0, -2px, 0);
}
.btn-fill {
  background: var(--call);
  color: var(--field);
}
.btn-ghost {
  border: 1px solid currentColor;
  color: var(--ghost);
}
.call-nowrap {
  white-space: nowrap;
}

/* Signature flourish: underline grows from the left. */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform var(--dur-hover) var(--ease-out-expo-alt);
}
.link-underline:hover::after {
  transform: scaleX(1);
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 50px, 0);
  transition:
    opacity var(--dur-enter) var(--ease-out-expo),
    transform var(--dur-enter) var(--ease-out-expo);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* A block of copy that belongs together: the container holds still and its
   children come in one after another, top first. motion.js sets the delays. */
[data-reveal="cascade"] {
  opacity: 1;
  transform: none;
  transition: none;
}
[data-reveal="cascade"] > * {
  opacity: 0;
  transform: translate3d(0, 50px, 0);
  transition:
    opacity var(--dur-enter) var(--ease-out-expo),
    transform var(--dur-enter) var(--ease-out-expo);
}
[data-reveal="cascade"].is-in > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
}
.hero-img {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-hero) var(--ease-out-expo);
}
.hero.is-in .hero-img,
.hero-img.is-in {
  opacity: 1;
}
.hero-copy {
  position: relative;
  z-index: 1;
}

/* 390: image occupies the first screen; type overlaps only the bottom third
   so a face in the upper two-thirds stays visible. */
@media (max-width: 640px) {
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100dvh;
  }

  .hero-img {
    object-position: 68% 10%;
  }

  .hero-copy {
    width: auto;
    margin: 0 1rem calc(1rem + env(safe-area-inset-bottom));
    padding: 1.15rem 1.1rem 1.05rem;
  }
}

.reviews,
.faq {
  padding: 5rem 6vw;
}

.reviews .section-head,
.faq .section-head {
  max-width: 36rem;
  margin-bottom: 2rem;
}

.review-carousel .review-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem;
}

.review-slide blockquote {
  margin: 0;
  max-width: 40rem;
}

.review-slide p {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 1rem;
}

.review-slide footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.92rem;
}

.review-slide cite {
  font-style: normal;
  font-weight: 600;
}

.review-nav {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.review-prev,
.review-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out-circ);
}

.review-prev:hover,
.review-next:hover {
  transform: translate3d(0, -2px, 0);
}

.review-dots {
  display: flex;
  gap: 0.45rem;
}

.review-dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.28;
  cursor: pointer;
}

.review-dots button[aria-current="true"] {
  opacity: 1;
}

.review-carousel.is-carousel .review-viewport {
  overflow: hidden;
}

.review-carousel.is-carousel .review-track {
  display: flex;
  gap: 0;
  transition: transform var(--dur-enter) var(--ease-out-expo);
}

.review-carousel.is-carousel .review-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.review-carousel.is-carousel .review-nav {
  display: flex;
}

.faq-list {
  max-width: 40rem;
}

.faq-list details {
  border-top: 1px solid currentColor;
}

.faq-list details:last-child {
  border-bottom: 1px solid currentColor;
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  font-weight: 600;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list details p {
  margin: 0 0 1.15rem;
  max-width: 42ch;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal="cascade"] > *,
  .hero-img {
    opacity: 1;
    transform: none !important;
    transition: none;
  }
  .btn:hover,
  .review-prev:hover,
  .review-next:hover {
    transform: none;
  }

  .review-carousel.is-carousel .review-track {
    transition: none;
  }
}
