/* =========================================================
   Carpenthree — greige / charcoal editorial style
   ========================================================= */
:root {
  --ink: #2a2623;
  --charcoal: #3b3633;
  --charcoal-2: #4a4440;
  --greige: #c9c3bb;
  --stone: #dedad4;
  --paper: #efedea;
  --white: #ffffff;
  --muted: #6f6862;
  --line: #b9b2a9;
  --accent: #8a6a4f;
  --max: 1180px;
  --head: "Josefin Sans", "Futura", "Century Gothic", system-ui, sans-serif;
  --body: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--body); color: var(--ink); background: var(--white);
  line-height: 1.7; font-size: 15px;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--head); font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; line-height: 1.2; margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: .08em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--muted); }

.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.section { padding: 90px 0; }
.bg-greige { background: var(--greige); }
.bg-stone { background: var(--stone); }
.bg-paper { background: var(--paper); }
.bg-dark { background: var(--charcoal); color: var(--white); }
.bg-dark p { color: #d6d0c9; }

/* Thin rule used throughout, like the reference */
.rule { display: block; height: 1px; background: var(--charcoal); width: 100%; margin: 18px 0 30px; opacity: .55; }
.rule.short { width: 90px; }
.rule.light { background: var(--white); }
.title-ruled { display: grid; gap: 0; }

/* ---------- Photos (drop files into /images) ---------- */
.photo {
  position: relative; overflow: hidden;
  background-color: var(--fallback, #8f877e);
  background-image:
    var(--img, none),
    repeating-linear-gradient(100deg, rgba(255,255,255,.05) 0 5px, transparent 5px 16px);
  background-size: cover; background-position: center;
  min-height: 200px;
}
.photo::after {
  content: attr(data-label); position: absolute; left: 12px; bottom: 10px;
  font: 600 .72rem/1 var(--head); text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255,255,255,.75);
}
.photo.loaded::after { display: none; }
.photo.dark { --fallback: #4b443e; }
.photo.mid { --fallback: #9c9389; }
.photo.light { --fallback: #b9b0a5; }
.photo.wood { --fallback: #8a6a4f; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border: 1px solid var(--charcoal); background: transparent; color: var(--charcoal);
  font: 600 .78rem/1 var(--head); text-transform: uppercase; letter-spacing: .16em;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s;
}
.btn:hover { background: var(--charcoal); color: var(--white); }
.btn-solid { background: var(--charcoal); color: var(--white); }
.btn-solid:hover { background: var(--ink); }
.btn-light { border-color: var(--white); color: var(--white); }
.btn-light:hover { background: var(--white); color: var(--charcoal); }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn-wa:hover { background: #1da851; border-color: #1da851; color: #fff; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 50; color: var(--white); }
.site-header.solid { position: sticky; background: var(--charcoal); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid currentColor;
  display: grid; place-items: center; font: 600 1rem/1 var(--head);
}
.logo-text { font: 600 .82rem/1.15 var(--head); text-transform: uppercase; letter-spacing: .14em; }
.logo-text small { display: block; font-size: .58rem; letter-spacing: .2em; opacity: .75; }
.nav-links { display: flex; gap: 34px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font: 600 .7rem/1 var(--head); text-transform: uppercase; letter-spacing: .18em;
  opacity: .85;
}
.nav-links a:hover, .nav-links a.active { opacity: 1; }
.nav-icons { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid currentColor;
  background: none; color: inherit; display: grid; place-items: center; cursor: pointer; text-decoration: none;
}
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.cart-count {
  position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font: 700 .65rem/18px var(--body); text-align: center;
}
.cart-count:empty, .cart-count[data-n="0"] { display: none; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .nav-links {
    display: none; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--charcoal); padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 16px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 640px; display: grid; place-items: center; text-align: center; color: var(--white);
}
.hero .photo { position: absolute; inset: 0; min-height: 0; }
.hero .photo::before { content: ""; position: absolute; inset: 0; background: rgba(25, 22, 20, .45); }
.hero-inner { position: relative; z-index: 1; padding: 120px 16px 80px; }
.hero h1 { margin-bottom: .3em; }
.hero p { color: #eee8e2; font-size: 1.1rem; letter-spacing: .04em; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero.short { min-height: 380px; }

/* ---------- Intro (image overlaps hero) ---------- */
.intro .container { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: end; }
.intro-text { padding: 70px 0 60px; }
.intro-photo { margin-top: -140px; aspect-ratio: 4/3; position: relative; z-index: 2; }
@media (max-width: 860px) {
  .intro .container { grid-template-columns: 1fr; gap: 0; }
  .intro-photo { margin-top: -60px; order: -1; aspect-ratio: 4/3; }
  .intro-text { padding: 40px 0 10px; }
}

/* ---------- Projects (staggered) ---------- */
.projects .head { max-width: 560px; }
.proj { display: grid; grid-template-columns: 1fr 1fr; align-items: center; position: relative; margin-top: 50px; }
.proj .photo { aspect-ratio: 4/3; }
.proj-text { padding: 10px 50px 10px 0; }
.proj.reverse .photo { order: 0; }
.proj.reverse .proj-box {
  background: var(--stone); padding: 40px; margin-left: -60px; position: relative; z-index: 2;
}
@media (max-width: 860px) {
  .proj { grid-template-columns: 1fr; }
  .proj-text { padding: 24px 0 0; order: 2; }
  .proj.reverse .proj-box { margin: -40px 16px 0; }
}

/* ---------- Benefits ---------- */
.benefits-title { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; margin-bottom: 50px; }
.benefits-title .rule { margin: 0; }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.benefit { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.benefit svg { width: 28px; height: 28px; stroke: var(--charcoal); fill: none; stroke-width: 1.5; }
.benefit h3 { font-size: .9rem; margin-bottom: .4em; }
.benefit p { font-size: .9rem; margin: 0; }
@media (max-width: 760px) {
  .benefits { grid-template-columns: 1fr; }
  .benefits-title { grid-template-columns: 1fr; }
  .benefits-title .rule { display: none; }
}

/* ---------- Mosaic grids ---------- */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(260px, auto); }
.mosaic > * { min-height: 260px; }
.tile { padding: 40px 34px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.tile h3 { margin-bottom: .2em; }
.tile .rule { margin: 12px auto 18px; width: 70px; }
.tile p { font-size: .88rem; }
.tile.inset { margin: 40px; padding: 30px 20px; }
.span-2 { grid-column: span 2; }
.span-row-2 { grid-row: span 2; }
@media (max-width: 860px) {
  .mosaic { grid-template-columns: 1fr 1fr; }
  .tile.inset { margin: 20px; }
}
@media (max-width: 560px) {
  .mosaic { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

/* ---------- What we do ---------- */
.wwd { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.wwd-photos { position: relative; height: 520px; }
.wwd-photos .photo { position: absolute; }
.wwd-photos .p1 { top: 0; left: 0; width: 62%; height: 72%; }
.wwd-photos .p2 { bottom: 0; right: 6%; width: 58%; height: 70%; border: 10px solid var(--white); }
.wwd ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.wwd li { font: 600 .78rem/1.4 var(--head); text-transform: uppercase; letter-spacing: .1em; color: var(--charcoal); }
.wwd li::before { content: "•"; margin-right: 12px; color: var(--accent); }
.link-ruled { display: flex; align-items: center; gap: 14px; margin-top: 30px; font-size: .85rem; text-decoration: none; color: var(--muted); }
.link-ruled::before { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 860px) {
  .wwd { grid-template-columns: 1fr; gap: 40px; }
  .wwd-photos { height: 380px; }
}

/* ---------- Shop strip / product cards ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px; }
.product { display: flex; flex-direction: column; background: var(--white); }
.product .photo { aspect-ratio: 1; min-height: 0; }
.product-body { padding: 18px 2px 4px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-cat { font: 600 .66rem/1 var(--head); text-transform: uppercase; letter-spacing: .18em; color: var(--accent); }
.product h3 { font-size: .92rem; margin: 6px 0 2px; }
.product-desc { font-size: .87rem; margin: 0; flex: 1; }
.product-meta { font-size: .78rem; color: var(--muted); }
.product-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.price { font: 600 1rem/1 var(--head); letter-spacing: .04em; }
.product .btn { padding: 10px 16px; }
.tag {
  position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--charcoal); color: #fff;
  font: 600 .62rem/1 var(--head); text-transform: uppercase; letter-spacing: .14em; padding: 6px 10px;
}

.shop-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 36px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: transparent; padding: 9px 16px; cursor: pointer; color: var(--charcoal);
  font: 600 .7rem/1 var(--head); text-transform: uppercase; letter-spacing: .14em;
}
.chip.active, .chip:hover { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
label { font: 600 .7rem/1 var(--head); text-transform: uppercase; letter-spacing: .14em; color: var(--charcoal); }
input, select, textarea {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
  width: 100%; border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--charcoal); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.quote { display: grid; grid-template-columns: 1fr 1.3fr; gap: 60px; }
@media (max-width: 860px) { .quote { grid-template-columns: 1fr; gap: 30px; } }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--muted); }
.contact-list strong { color: var(--charcoal); font: 600 .72rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 2px; }

/* ---------- Cart drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20,18,16,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 100%); background: var(--paper); z-index: 100;
  transform: translateX(100%); transition: transform .3s; display: flex; flex-direction: column;
}
body.cart-open .drawer { transform: none; }
body.cart-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-head button { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px 22px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item .photo { aspect-ratio: 1; min-height: 0; }
.cart-item .photo::after { display: none; }
.cart-item h4 { margin: 0; font-size: .78rem; }
.cart-item small { color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.remove { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: .78rem; }
.sum-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); padding: 4px 0; }
.sum-row.total { font: 600 1rem/1.4 var(--head); color: var(--ink); letter-spacing: .06em; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.checkout { margin-top: 20px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.note { font-size: .78rem; color: var(--muted); margin-top: 10px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--charcoal); color: #fff;
  padding: 12px 22px; opacity: 0; transition: .25s; z-index: 120; pointer-events: none;
  font: 600 .72rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px 14px 18px; border-radius: 999px;
  background: #25d366; color: #fff; text-decoration: none;
  font: 700 1rem/1 var(--body); letter-spacing: .01em;
  box-shadow: 0 10px 28px rgba(37, 211, 102, .45), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .2s, background .2s, box-shadow .2s;
}
.wa-float:hover { background: #1fbe5b; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37, 211, 102, .55); }
.wa-float svg { width: 24px; height: 24px; fill: #fff; flex: none; }
@media (max-width: 520px) { .wa-float { right: 14px; bottom: 14px; padding: 12px 18px 12px 14px; font-size: .92rem; } }
body.cart-open .wa-float { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: #cfc8c0; padding: 60px 0 30px; text-align: center; }
.site-footer .logo { justify-content: center; color: #fff; margin-bottom: 26px; flex-direction: column; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; list-style: none; padding: 0; margin: 0 0 28px; }
.footer-links a { text-decoration: none; font: 600 .68rem/1 var(--head); text-transform: uppercase; letter-spacing: .18em; }
.footer-links a:hover { color: #fff; }
.site-footer small { opacity: .7; }
.footer-company { display: grid; gap: 4px; justify-items: center; padding: 26px 0; margin-bottom: 22px; border-top: 1px solid #514a45; border-bottom: 1px solid #514a45; font-size: .9rem; }
.footer-company strong { color: #fff; font: 600 .82rem/1.4 var(--head); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 4px; }
.footer-company a { color: #cfc8c0; }

/* Inspiration placeholder badge (shows which file to replace) */
.photo.placeholder::before {
  content: "Placeholder · " attr(data-file);
  position: absolute; right: 10px; bottom: 10px; z-index: 1;
  background: rgba(20, 18, 16, .72); color: #fff; padding: 5px 9px;
  font: 600 .6rem/1 var(--head); letter-spacing: .12em; text-transform: uppercase;
}
.hero .photo.placeholder::before { content: ""; inset: 0; right: 0; bottom: 0; padding: 0; background: rgba(25, 22, 20, .45); } /* hero keeps its dark overlay */
.hero .photo.placeholder + .hero-inner::after {
  content: "Placeholder photo"; display: block; margin-top: 26px; font: 600 .6rem/1 var(--head);
  letter-spacing: .16em; text-transform: uppercase; opacity: .6;
}
.cart-item .photo.placeholder::before { display: none; }

/* ---------- Performance ---------- */
/* Skip rendering work for off-screen sections until they're near the viewport */
.section, .mosaic, .site-footer { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.photo { transition: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---------- Brands ---------- */
.brands-intro { max-width: 560px; margin: 0 auto 40px; }
.brand-group { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.brand-group:last-of-type { border-bottom: 1px solid var(--line); }
.brand-group h3 { margin: 0; font-size: .74rem; letter-spacing: .18em; color: var(--muted); }
.brand-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 34px; }
.brand-list li { font: 600 1.15rem/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--charcoal); }
.brand-note { text-align: center; font-size: .72rem; margin: 18px 0 0; }
@media (max-width: 640px) {
  .brand-group { grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .brand-list { justify-content: center; gap: 12px 28px; }
  .brand-list li { font-size: 1.1rem; }
}

.center { text-align: center; }

/* ---------- Carpentry types marquee ---------- */
.marquee { background: var(--charcoal); color: #e9e4de; overflow: hidden; padding: 20px 0; }
.marquee-track {
  list-style: none; margin: 0; padding: 0; display: flex; width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li {
  font: 600 .82rem/1 var(--head); text-transform: uppercase; letter-spacing: .2em; white-space: nowrap;
  padding: 0 28px; display: flex; align-items: center;
}
.marquee-track li::after { content: "•"; margin-left: 56px; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (max-width: 640px) { .marquee { padding: 16px 0; } .marquee-track { animation-duration: 30s; } .marquee-track li { font-size: .74rem; padding: 0 18px; } .marquee-track li::after { margin-left: 36px; } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; row-gap: 14px; }
  .marquee-track li[aria-hidden] { display: none; }
}
