/* Wynn Carpentry. Follows 1tradesman-DESIGN.md: flat charcoal, taupe buttons, 1px line grid. */

:root {
  --charcoal: #262626;
  --deep: #1E1F1C;
  --line: #5E5F59;
  --taupe: #9A8A76;
  --taupe-light: #A99A85;
  --taupe-text: #B5A690;
  --heading: #F6F2EA;
  --body: #E0DBD2;
  --muted: #9C9A97;
  --plaster: #EDE8E0;
  --plaster-ink: #2B2925;
  --plaster-muted: #6B655C;
  --plaster-line: #CFC7B8;

  --frame: 1320px;
  --gutter: 24px;
  --gap: 128px;
  --pad: 64px;
  --font-head: "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--body);
  font: 400 17px/1.65 var(--font-body);
}

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

h1, h2, h3 {
  margin: 0 0 16px;
  font-family: var(--font-head);
  font-weight: 500;
  font-variant-numeric: lining-nums;
  line-height: 1.2;
  color: var(--heading);
}
h1, h2 { text-wrap: balance; }
.nowrap { white-space: nowrap; }
h1 { font-size: 44px; line-height: 1.15; }
h2 { font-size: 32px; }
h3 { font-size: 21px; }

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--body);
  text-decoration: underline;
  text-decoration-color: var(--taupe-text);
  text-underline-offset: 3px;
}

:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 50;
  padding: 12px 16px; background: var(--taupe); color: var(--deep);
  font-weight: 600; text-decoration: none; border-radius: 2px;
}
.skip:focus { top: 16px; }

.wrap { width: min(var(--frame), 100% - var(--gutter) * 2); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 2px;
  font: 600 15px/1 var(--font-body); font-variant-numeric: lining-nums;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--taupe); color: var(--deep); }
.btn--primary:hover { background: var(--taupe-light); }
.btn--secondary { background: transparent; border-color: var(--line); color: #fff; }
.btn--secondary:hover { border-color: var(--taupe); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn svg { width: 18px; height: 18px; margin-right: 8px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Top bar */
.topbar { background: var(--deep); color: var(--muted); font-size: 13px; }
.topbar__in { display: flex; justify-content: flex-end; align-items: center; gap: 24px; height: 36px; font-variant-numeric: lining-nums; }
.topbar a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--body); }
.topbar svg { width: 13px; height: 13px; flex: none; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--charcoal);
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header__in { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 24px; }

.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.brand__name { font: 500 25px/1.15 var(--font-head); color: var(--heading); }
.brand__sub { font-size: 13px; color: var(--muted); }
.brand img { height: 48px; width: auto; }

.header__right { display: flex; align-items: center; gap: 28px; }
.nav { display: none; gap: 28px; font-size: 15px; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-decoration-color: var(--taupe-text); }
.header__phone { display: none; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--heading); }
.menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 4px;
  background: none; border: 0; cursor: pointer;
  font: 600 15px/1 var(--font-body); color: var(--heading); text-decoration: none;
}
.menu-btn svg { width: 22px; height: 22px; }

@media (min-width: 1100px) {
  .nav { display: flex; }
  .header__phone { display: inline; }
}

/* Slide-in menu */
dialog { color: var(--body); }
.menu {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: 420px; max-width: 100%; height: 100dvh; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--line);
  background: var(--deep);
}
.menu::backdrop { background: rgba(30, 31, 28, .4); }
.menu[open] { animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
.menu__in { display: flex; flex-direction: column; height: 100%; padding: 20px 32px 32px; }
.menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.menu__title { font: 500 21px/1 var(--font-head); color: var(--heading); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 2px;
  color: var(--heading); font-size: 26px; line-height: 1; cursor: pointer;
  transition: border-color .15s;
}
.icon-btn:hover { border-color: var(--taupe); }
.menu__links { list-style: none; margin: 0; padding: 0; }
.menu__links li { border-bottom: 1px solid var(--line); }
.menu__links li:first-child { border-top: 1px solid var(--line); }
.menu__links a {
  display: block; padding: 18px 0;
  font: 500 24px/1.2 var(--font-head); color: var(--heading); text-decoration: none;
}
.menu__links a:hover { color: var(--taupe-text); }
.menu__foot { margin-top: auto; padding-top: 24px; }
.menu__foot .btn { width: 100%; }
.menu__foot p { margin: 16px 0 0; font-size: 15px; color: var(--muted); }

/* Line grid */
.frame { width: min(var(--frame), 100% - var(--gutter) * 2); margin-inline: auto; border: 1px solid var(--line); }
.frame > * + * { border-top: 1px solid var(--line); }
.group { margin-top: var(--gap); }
.group--first { margin-top: 32px; }

.split { display: grid; grid-template-columns: 1fr 1fr; }
.split > * + * { border-left: 1px solid var(--line); }
.split__text { display: flex; flex-direction: column; justify-content: center; padding: var(--pad); }
.split__photo { position: relative; min-height: 480px; background: var(--deep); }
.split__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.label {
  display: block; margin: 0 0 16px;
  font: 600 13px/1.4 var(--font-body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--taupe-text);
}
.subtitle { color: var(--taupe-text); margin-top: -8px; }
.lede { font-size: 19px; }

.ticks { list-style: none; margin: 8px 0 24px; padding: 0; }
.ticks li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 10px; height: 1px; background: var(--taupe-text);
}
.services li { margin-bottom: 14px; }
.services strong { color: var(--heading); font-weight: 600; }

/* Facts row */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; }
.facts li { padding: 26px 32px; }
.facts li + li { border-left: 1px solid var(--line); }
.facts strong { display: block; font-weight: 600; color: var(--heading); font-variant-numeric: lining-nums; }
.facts span { font-size: 15px; color: var(--muted); }

/* Open sections */
.open { width: min(var(--frame), 100% - var(--gutter) * 2); margin: var(--gap) auto 0; }
.open__head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.open__head p { color: var(--muted); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: 40px 16px; margin: 0; padding: 0; list-style: none; }
.project { margin: 0; }
.shot { position: relative; display: block; border-radius: 4px; overflow: hidden; background: var(--deep); }
/* Before and after: one pair per row */
.ba { margin: 0 0 64px; }
.ba:last-of-type { margin-bottom: 0; }
.ba__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ba figcaption { margin-top: 16px; line-height: 1.4; }
.ba figcaption strong { display: block; font: 500 21px/1.3 var(--font-head); color: var(--heading); }
.ba figcaption span { color: var(--muted); }
.tag {
  position: absolute; left: 16px; top: 16px;
  padding: 6px 14px; border-radius: 2px;
  background: var(--deep); color: var(--heading); border: 1px solid var(--line);
  font: 600 14px/1.3 var(--font-body);
}
.tag--after { background: var(--taupe); color: var(--deep); border-color: var(--taupe); }
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.project figcaption { margin-top: 12px; line-height: 1.4; }
.project figcaption strong { display: block; font-weight: 600; color: var(--heading); }
.project figcaption span { font-size: 14px; color: var(--muted); font-variant-numeric: lining-nums; }

/* Plaster band */
.plaster { margin-top: var(--gap); padding: 96px 0; background: var(--plaster); color: var(--plaster-ink); }
.plaster h2, .plaster h3 { color: var(--plaster-ink); }
.plaster a { color: var(--plaster-ink); text-decoration-color: var(--plaster-muted); }
.plaster__head { max-width: 640px; margin-bottom: 40px; }
.plaster__head p { color: var(--plaster-muted); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--plaster-line); }
.steps li { padding: 28px 28px 0 0; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--plaster-line); }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--plaster-ink); }
.plaster__note { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--plaster-line); color: var(--plaster-muted); }
.plaster + .open, .plaster + .group { margin-top: var(--gap); }

/* Reviews, ready for when real ones exist (see comment in index.html) */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 40px; padding: 0; list-style: none; }
.reviews li { padding-right: 28px; }
.reviews li + li { padding-left: 28px; border-left: 1px solid var(--plaster-line); }
.reviews blockquote { margin: 0 0 12px; font-size: 19px; line-height: 1.5; }
.reviews cite { font-style: normal; font-size: 15px; color: var(--plaster-muted); }

/* Questions */
.faq { max-width: 800px; margin-inline: auto; border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  padding: 20px 0; cursor: pointer;
  font: 500 21px/1.3 var(--font-head); color: var(--heading);
}
.faq summary::marker { color: var(--taupe-text); }
.faq details p { margin: 0 0 24px; max-width: 680px; }

/* Form */
.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--heading); }
.form .hint { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--deep); color: var(--heading);
  border: 1px solid var(--line); border-radius: 2px;
  font: 400 17px/1.4 var(--font-body);
}
.form textarea { height: auto; min-height: 132px; padding: 12px 14px; resize: vertical; }
.form input[type="file"] { height: auto; padding: 11px 14px; font-size: 15px; color: var(--muted); }
.form input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 12px;
  background: transparent; color: var(--heading);
  border: 1px solid var(--line); border-radius: 2px;
  font: 600 14px/1.2 var(--font-body); cursor: pointer;
}
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }
.form .btn { justify-self: start; }
.contact__email { margin-top: 20px; font-size: 15px; color: var(--muted); }
.form__after { margin: 0; font-size: 15px; color: var(--muted); }
.form__status { margin: 0; font-size: 15px; color: var(--heading); }
.form__status:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.footer { margin-top: var(--gap); background: var(--deep); border-top: 1px solid var(--line); font-size: 15px; }
.footer__in { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1fr; gap: 40px; padding: 64px 0 48px; }
.footer h2 { margin-bottom: 12px; font: 600 13px/1.4 var(--font-body); color: var(--muted); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 6px; }
.contact-list li { margin-bottom: 10px; }
.contact-list a { display: inline-flex; align-items: center; gap: 10px; }
.contact-list svg { width: 17px; height: 17px; flex: none; color: var(--taupe-text); }
.footer .brand__name { display: block; margin-bottom: 8px; }
.footer p { color: var(--body); }
.footer__legal { padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer__legal a { color: var(--muted); }

/* Mobile call bar */
.callbar { display: none; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(30, 31, 28, .97);
}
.lightbox::backdrop { background: var(--deep); }
.lightbox__in { display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: 72px 1fr auto; align-items: center; justify-items: center; height: 100%; }
.lightbox__close { grid-column: 3; grid-row: 1; }
.lightbox__prev { grid-column: 1; grid-row: 2; }
.lightbox__next { grid-column: 3; grid-row: 2; }
.lightbox figure { grid-column: 2; grid-row: 2; margin: 0; min-height: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 180px); width: auto; border-radius: 4px; }
.lightbox p { grid-column: 1 / -1; grid-row: 3; margin: 0; padding: 16px 24px 28px; text-align: center; color: var(--body); }

/* Plain pages (privacy, thanks, 404) */
.page { width: min(760px, 100% - var(--gutter) * 2); margin: 72px auto 0; }
.page h1 { font-size: 36px; }
.page h2 { margin-top: 40px; font-size: 24px; }
.page ul { padding-left: 20px; }
.page li { margin-bottom: 6px; }
.page__meta { color: var(--muted); font-size: 15px; }

/* Tablet and phone */
@media (max-width: 900px) {
  :root { --pad: 40px; --gap: 96px; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li { padding: 28px 28px 28px 0; }
  .steps li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--plaster-line); }
  .footer__in { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  :root { --gap: 72px; --pad: 24px; }
  html { scroll-padding-top: 80px; }
  body { font-size: 16px; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .lede { font-size: 17px; }

  .topbar__in { justify-content: center; }
  .topbar .topbar__email { display: none; }
  .topbar a { min-height: 36px; }
  /* Finger-sized links in the footer */
  .footer li, .contact-list li { margin-bottom: 0; }
  .footer li a, .footer__legal a { display: inline-flex; align-items: center; min-height: 44px; }
  .header__in { height: 64px; }
  .brand__name { font-size: 21px; }
  .brand__sub { font-size: 12px; }

  .frame { width: 100%; border-left: 0; border-right: 0; }
  .group--first { margin-top: 0; }
  .split { grid-template-columns: 1fr; }
  .split > * + * { border-left: 0; border-top: 1px solid var(--line); }
  .split > .split__photo:last-child { order: -1; border-top: 0; border-bottom: 1px solid var(--line); }
  .split__text { padding: 40px 24px; }
  .split__photo { min-height: 0; aspect-ratio: 4 / 3; }

  .facts { grid-template-columns: 1fr 1fr; }
  .facts li { padding: 20px 24px; }
  .facts li:nth-child(odd) { border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--line); }

  .open__head { margin-bottom: 32px; text-align: left; }
  .plaster { padding: 64px 0; }
  .reviews { grid-template-columns: 1fr; }
  .reviews li, .reviews li + li { padding: 24px 0; border-left: 0; }
  .reviews li + li { border-top: 1px solid var(--plaster-line); }
  .faq summary { font-size: 19px; }
  .form__row { grid-template-columns: 1fr; }
  .form .btn { justify-self: stretch; }
  .btn-row .btn { flex: 1 1 auto; }

  .callbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; align-items: center;
    height: calc(56px + env(safe-area-inset-bottom));
    padding: 0 12px env(safe-area-inset-bottom);
    background: var(--deep); border-top: 1px solid var(--line);
  }
  .callbar .btn { height: 44px; padding: 0 8px; }
  .callbar .btn svg { width: 16px; height: 16px; margin-right: 6px; }
  .ba { margin-bottom: 48px; }
  .ba__pair { gap: 12px; }
  .tag { left: 10px; top: 10px; padding: 4px 10px; font-size: 13px; }

  .lightbox__in { grid-template-columns: 56px 1fr 56px; }
  .lightbox .icon-btn { width: 44px; height: 44px; }
  .page { margin-top: 48px; }
  .page h1 { font-size: 30px; }
}

@media (max-width: 560px) {
  .projects { grid-template-columns: 1fr; gap: 32px; }
  .ba__pair { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 24px 0; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--plaster-line); }
  .footer__in { grid-template-columns: 1fr; gap: 32px; padding: 48px 0 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .menu[open] { animation: none; }
  * { transition: none !important; }
}

@media print {
  .topbar, .header, .callbar, .menu, .lightbox, .form { display: none !important; }
  body { background: #fff; color: #000; }
  h1, h2, h3, .facts strong { color: #000; }
}
