/*
 * JB Drywall LLC
 *
 * The design argument in one line: a drywall finisher sells an absence — no
 * seams, no shadows, no ripples — so a busy website argues against the
 * service. Everything here is flat, calm and mostly photograph.
 *
 * Colour: warm plaster neutrals taken from the material itself (joint compound
 * and primed board are warm off-whites, never blue-whites). The green the
 * client likes survives as a deep, desaturated sage with exactly one job per
 * screen — the primary button — plus the small rule under the active nav item.
 * The original #007000 was a saturated safety green; at that chroma it fights
 * the photographs and reads cheap against warm white.
 *
 * The one motif: a soft directional gradient on section backgrounds, the way
 * daylight falls across a finished wall. Nobody should be able to name it.
 */

:root {
  --plaster:   #F7F6F3;  /* finished board in daylight            */
  --plaster-2: #EFEDE8;  /* the shaded side of the same wall      */
  --plaster-3: #E4E1DA;  /* rules and edges                       */
  --ink:       #1C1C1A;  /* warm near-black, never pure #000      */
  --ink-2:     #4A4945;  /* body copy                             */
  --ink-3:     #7A7871;  /* captions, quiet labels                */
  --sage:      #3D5A46;  /* the accent, used sparingly            */
  --sage-dark: #2F4638;  /* its pressed state                     */

  --shell: min(1180px, 100% - 2.4rem);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--plaster);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: var(--shell); margin-inline: auto; }
.narrow { max-width: 720px; }

h1, h2, h3 { color: var(--ink); line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; }

a { color: var(--sage); }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 100; background: var(--ink); color: #fff;
  padding: .6rem 1rem; border-radius: 4px;
}

/* ── header ──────────────────────────────────────────────────────────────── */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--plaster) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--plaster-3);
}
.head-inner { display: flex; align-items: center; gap: 1.5rem; height: 66px; }

/* The wordmark is set in type. The original logo exists only at 208x125px,
   which cannot survive a modern display; this stays sharp at any size. */
.brand { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; }
.brand-mark {
  font-weight: 800; font-size: 1.28rem; letter-spacing: -0.03em; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 4px; padding: .05em .3em; line-height: 1;
}
.brand-name { font-weight: 700; font-size: 1.1rem; color: var(--ink); letter-spacing: -0.01em; }
.brand-llc {
  font-size: .62rem; font-weight: 600; color: var(--ink-3);
  letter-spacing: .12em; margin-left: .35rem; vertical-align: .35em;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--ink); }
.nav a.is-here { color: var(--ink); box-shadow: inset 0 -2px 0 var(--sage); }
.nav-cta {
  color: var(--ink) !important; border: 1px solid var(--plaster-3);
  padding: .45rem .9rem; border-radius: 999px; background: #fff;
}
.nav-cta:hover { border-color: var(--ink-3); }
.head-phone { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }

/* ── mobile menu ──────────────────────────────────────────────────────────
   The section links used to be simply hidden below 860px, which left no way
   to reach Work, Services or How it goes on a phone. A drawer slides down
   from under the sticky header — light, to match the plaster palette. */
.menu-btn {
  display: none; width: 42px; height: 38px; padding: 0; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px;
  background: #fff; border: 1px solid var(--plaster-3); border-radius: 9px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease;
}
.menu-btn:hover { border-color: var(--ink-3); }
.menu-btn span {
  display: block; height: 2px; width: 20px; margin-inline: auto;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.drawer {
  position: fixed; left: 0; right: 0; top: 66px; z-index: 35;
  background: color-mix(in srgb, var(--plaster) 97%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--plaster-3);
  box-shadow: 0 18px 34px rgba(28,28,26,.10);
  transform: translateY(-130%);
  transition: transform .28s ease;
}
.drawer.is-open { transform: translateY(0); }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a {
  color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 500;
  padding: .95rem 1.2rem; border-bottom: 1px solid var(--plaster-3);
}
.drawer nav a:active { background: var(--plaster-2); }
/* On a phone, calling is the thing most people actually want to do. */
.drawer .drawer-call {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.2rem;
}
.drawer .drawer-call a {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem;
}
.drawer .drawer-call span {
  color: var(--ink-3); font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
}
body.menu-open { overflow: hidden; }

@media (max-width: 860px) {
  .nav a:not(.nav-cta) { display: none; }
  .head-phone { display: none; }
  .nav { gap: .8rem; }
  .menu-btn { display: flex; }
}
@media (max-width: 560px) {
  /* The wordmark alone takes most of a phone's width, so the pill wrapped onto
     two lines and doubled the header height. The drawer carries the estimate
     link instead, and the hero's own button is a thumb-length below. */
  .nav-cta { display: none; }
  .head-inner { gap: 1rem; }
  .menu-btn { margin-left: auto; }
}

/* ── hero ────────────────────────────────────────────────────────────────── */

.hero { position: relative; background: var(--ink); }
.hero-img { position: absolute; inset: 0; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Warm scrim, heavier at the left where the words sit, so the photograph keeps
   its detail on the right rather than being flattened everywhere. */
.hero-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(20,20,18,.86) 0%, rgba(20,20,18,.72) 38%, rgba(20,20,18,.30) 72%, rgba(20,20,18,.12) 100%);
}
.hero-body { position: relative; padding: clamp(4.5rem, 15vh, 9rem) 0 clamp(4rem, 12vh, 7rem); }
.hero-body .eyebrow {
  color: #C9CFC7; font-size: .78rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 1rem;
}
.hero h1 {
  color: #fff; font-size: clamp(2.1rem, 6.2vw, 4.1rem); max-width: 15ch;
  letter-spacing: -0.03em;
}
.hero .lede {
  color: #DCDBD5; font-size: clamp(1.02rem, 2.4vw, 1.22rem);
  max-width: 46ch; margin-top: 1.3rem; line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: .85rem 1.6rem; border-radius: 6px; transition: background .15s, border-color .15s;
}
/* The sage's single job. */
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:hover { background: var(--sage-dark); }
.btn-quiet {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45);
}
.btn-quiet:hover { border-color: #fff; }
.section .btn-quiet { color: var(--ink); border-color: var(--plaster-3); background: #fff; }
.section .btn-quiet:hover { border-color: var(--ink-3); }
.btn:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }

/* ── sections ────────────────────────────────────────────────────────────── */

.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
/* The header is sticky, so an anchor jump must stop short of it or the heading
   lands underneath and the visitor sees the middle of a paragraph. */
section[id] { scroll-margin-top: 82px; }
/* The motif: light falling across a wall. */
.section:nth-of-type(even) {
  background: linear-gradient(105deg, #FBFAF8 0%, var(--plaster-2) 62%, #E9E6E0 100%);
}
.section-title { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.section-lede { max-width: 58ch; margin-top: .8rem; color: var(--ink-2); }

.quote-section { text-align: center; }
.pull {
  font-family: var(--serif); font-size: clamp(1.35rem, 3.6vw, 2.05rem);
  line-height: 1.35; color: var(--ink); font-style: italic; letter-spacing: -0.01em;
}
.quote-after { margin-top: 1.6rem; color: var(--ink-2); }

/* ── services ────────────────────────────────────────────────────────────── */

.services {
  margin-top: 2.4rem; display: grid; gap: 1px; background: var(--plaster-3);
  border: 1px solid var(--plaster-3); border-radius: 10px; overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.svc { background: var(--plaster); padding: 1.7rem 1.5rem; }
.svc h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.svc p { font-size: .95rem; color: var(--ink-2); }

/* ── the gallery ─────────────────────────────────────────────────────────── */

.grid {
  margin-top: 2.2rem; display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
}
.grid button {
  border: 0; padding: 0; background: var(--plaster-2); cursor: pointer;
  border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; display: block;
}
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.grid button:hover img { transform: scale(1.035); }
.grid button:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.grid button[hidden] { display: none; }
.grid-more { margin-top: 1.6rem; text-align: center; }

/* ── steps ───────────────────────────────────────────────────────────────── */

.steps {
  margin-top: 2.4rem; list-style: none; display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.step-n {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1.5px solid var(--sage); color: var(--sage);
  font-weight: 700; font-size: .95rem; margin-bottom: .9rem;
}
.steps h3 { font-size: 1.08rem; margin-bottom: .4rem; }
.steps p { font-size: .95rem; }

/* ── the form ────────────────────────────────────────────────────────────── */

.form { margin-top: 2rem; display: grid; gap: 1rem; }
.row2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .row2 { grid-template-columns: 1fr; } }
.form label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); }
.form input, .form textarea {
  width: 100%; margin-top: .4rem; font-family: inherit; font-size: 1rem;
  color: var(--ink); background: #fff;
  border: 1px solid var(--plaster-3); border-radius: 6px; padding: .75rem .85rem;
}
.form input:focus, .form textarea:focus {
  outline: 0; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(61,90,70,.13);
}
.form textarea { resize: vertical; }
.req { color: #A2402F; font-weight: 700; }
/* Kept in the layout but off-screen, so a screen reader can skip it and a bot fills it. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 1.6rem; margin-top: .4rem;
}
.assurance { font-size: .84rem; color: var(--ink-2); line-height: 1.45; }
.lic { color: var(--ink-3); }
.lic strong { color: var(--ink-2); font-weight: 600; letter-spacing: .02em; }
.form-msg { font-size: .95rem; min-height: 1.2em; }
.form-msg.ok { color: var(--sage); font-weight: 600; }
.form-msg.bad { color: #A2402F; font-weight: 600; }
.or-call { margin-top: 1.6rem; font-size: .95rem; color: var(--ink-2); }

/* ── footer ──────────────────────────────────────────────────────────────── */

.site-foot { background: var(--ink); color: #B9B7B0; padding: 3rem 0 2rem; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 1.6rem; justify-content: space-between; }
.foot-brand { color: #fff; font-weight: 700; font-size: 1.15rem; }
.foot-brand span { font-size: .62rem; letter-spacing: .12em; color: #8B8982; margin-left: .3rem; vertical-align: .35em; }
.foot-lic { font-size: .84rem; margin-top: .4rem; }
.foot-contact { text-align: right; font-size: .95rem; }
.foot-contact a { color: #E4E1DA; text-decoration: none; }
.foot-contact a:hover { text-decoration: underline; }
@media (max-width: 620px) { .foot-contact { text-align: left; } }
.copyright {
  width: var(--shell); margin: 2.4rem auto 0; padding-top: 1.4rem;
  border-top: 1px solid #2E2E2A; font-size: .8rem; color: #8B8982;
}

/* ── lightbox ────────────────────────────────────────────────────────────── */

.lb {
  position: fixed; inset: 0; z-index: 90; background: rgba(16,16,15,.94);
  display: grid; place-items: center; padding: 0;
}
.lb[hidden] { display: none; }
/*
 * Size the photo against the VIEWPORT, not against the box it sits in.
 *
 * The obvious version — max-width/max-height of 100% — does not work here: the
 * image is a grid item, and a grid item's automatic minimum size is its own
 * intrinsic size, so a 2200px-wide photo refuses to shrink and simply overflows
 * the fixed container. Clipped at the viewport edge, that reads as a severe
 * crop. min-width/min-height of 0 lifts that floor, and the viewport units then
 * give the constraint something real to resolve against at any window size.
 *
 * The reserved space accounts for the close button above and the counter below,
 * so neither ever sits on top of the picture.
 */
.lb img {
  min-width: 0; min-height: 0; width: auto; height: auto;
  max-width: calc(100vw - 6.5rem);
  max-height: calc(100dvh - 6rem);
  object-fit: contain; border-radius: 4px; display: block;
}
/* A short window (a laptop in landscape) has height to spare sideways but not
   vertically, so give the picture back the horizontal margin. */
@media (max-height: 620px) {
  .lb img { max-width: calc(100vw - 7.5rem); max-height: calc(100dvh - 3.5rem); }
  .lb-count { display: none; }
}
/* On a phone the arrows sit over the picture rather than beside it. */
@media (max-width: 560px) {
  .lb img { max-width: calc(100vw - 1.5rem); max-height: calc(100dvh - 5rem); }
}
.lb-close, .lb-nav {
  position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0;
  cursor: pointer; border-radius: 50%; width: 2.9rem; height: 2.9rem;
  font-size: 1.7rem; line-height: 1; display: grid; place-items: center;
}
.lb-close { top: 1rem; right: 1rem; font-size: 1.5rem; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-count { position: absolute; bottom: 1.1rem; left: 0; right: 0; text-align: center; color: #9A9891; font-size: .85rem; }
