/* Color & typography setup */
:root {
  --beige: #f5f0e6;
  --brown: #3e2f23;
  --green: #5a7d5a;
  --text: #2f261c;
  --muted: #8e8073;
  --bg: #fff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* Page-specific hero bindings */
.hero.hero-home {
  /* Hardcoded background (no CSS var) */
  /* Path is relative to this CSS file */
  background-image: url(../images/hero-carpenter.webp);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  /* Remove diagonal wood-grain stripes overlay on home hero */
  --wood-grain: none;
}
/* Prevent pseudo-element from competing on home hero */
.hero.hero-home::after { background: none; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, h4 { font-family: "Inter", "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--brown); margin: 0 0 .6rem; line-height: 1.2; }
p { margin: 0 0 1rem; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92vw); margin: 0 auto; }
.section { padding: clamp(2rem, 6vw, 4rem) 0; }
.lead { color: var(--muted); font-size: 1.1rem; }

/* Header / Nav */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(245, 240, 230, 0.88); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid #e6ded4; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--brown); }
.logo-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--green); color: #fff; font-weight: 800; }
.logo-text { letter-spacing: .4px; }

.site-nav { display: flex; gap: 1rem; align-items: center; }
.site-nav a { color: var(--brown); padding: .4rem .6rem; border-radius: 8px; font-weight: 600; }
.site-nav a.active, .site-nav a:hover { background: #efe8de; text-decoration: none; }

.nav-toggle { display: none; background: transparent; border: 0; width: 40px; height: 32px; gap: 4px; align-items: center; justify-content: center; flex-direction: column; }
.nav-toggle .bar { width: 24px; height: 2px; background: var(--brown); display: block; }

/* Hero */
.hero {
  position: relative;
  color: #fff;
  background: var(--brown);
  /* Fallback: paint hero image on the section in case ::after is unsupported */
  background-image: var(--hero-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  /* Adjust hero visual height on home */
  min-height: clamp(48vh, 62vh, 72vh);
  display: grid;
  place-items: center;
  isolation: isolate;
  /* subtle grain texture layered under gradient */
  --wood-grain: repeating-linear-gradient(-12deg, rgba(255,255,255,.06) 0 14px, rgba(255,255,255,0) 14px 28px);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(62,47,35,.6), rgba(62,47,35,.5)), var(--wood-grain, transparent);
  z-index: 1;
}
.hero::after {
  /* background image layer */
  content: "";
  position: absolute; inset: 0;
  background-image: var(--hero-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 0;
  filter: saturate(0.9) contrast(1.05);
}
.hero-inner { padding: clamp(2rem, 6vw, 5rem) 0; }
.hero-inner, .hero-copy { position: relative; z-index: 2; }
.hero-copy { max-width: 720px; }
.hero-copy img { width: 100%; height: auto; max-width: 520px; border-radius: 14px; box-shadow: var(--shadow); display: block; margin-top: 1rem; }
.hero h1 { color: #fff; font-size: clamp(2rem, 3.2vw, 3rem); }
.hero .sub { color: #f1ebe4; margin-bottom: 1.2rem; font-size: 1.05rem; }

/* Wood texture utility (pure CSS) */
.wood-texture { position: relative; background: var(--beige); }
.wood-texture::before {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background:
    repeating-linear-gradient( 15deg, rgba(62,47,35,.09) 0 12px, transparent 12px 24px ),
    radial-gradient(1000px 200px at 15% 10%, rgba(90,125,90,.06), transparent 60%),
    radial-gradient(800px 240px at 80% 30%, rgba(62,47,35,.08), transparent 60%);
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1rem; border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; box-shadow: var(--shadow); }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-accent { background: var(--green); color: #fff; }
.btn-accent:hover { box-shadow: 0 12px 26px rgba(90,125,90,.28); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1rem; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: grid; }
.card-media img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 1rem; }

/* About / Team */
.cols-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: start; }
.bullets { padding-left: 1rem; line-height: 1.9; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.team-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.team-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.team-card figcaption { padding: .7rem 1rem; color: var(--brown); font-weight: 600; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.work { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.work img { width: 100%; height: 260px; object-fit: cover; transition: transform .4s ease, filter .4s ease; display: block; }
.work:hover img { transform: scale(1.08); filter: contrast(1.05) saturate(1.05); }
.work figcaption { position: absolute; left: .8rem; bottom: .6rem; background: rgba(0,0,0,.45); color: #fff; padding: .35rem .6rem; border-radius: 8px; font-size: .9rem; }

/* Contact */
.contact-form { background: #fff; padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--brown); }
.field input, .field textarea { width: 100%; padding: .8rem .9rem; border: 1px solid #e3dbcf; border-radius: 12px; font: inherit; outline: none; background: #fff; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(90,125,90,.12); }
.err { color: #b44545; font-size: .9rem; }
.form-note { color: var(--muted); font-size: .95rem; }
.contact-info .info { list-style: none; padding: 0; margin: 0 0 1rem; }
.contact-info .info li { margin: .4rem 0; }
.map-placeholder { height: 260px; border-radius: var(--radius); border: 1px dashed #ccbfb1; display: grid; place-items: center; color: var(--muted); background: repeating-linear-gradient(45deg, #f7f3ec 0 10px, #f0e8dd 10px 20px); }

/* Footer */
.site-footer { background: var(--beige); position: relative; padding-top: 1.2rem; border-top: 1px solid #e6ded4; }
.site-footer::before { content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none; background:
  repeating-linear-gradient( -10deg, rgba(62,47,35,.06) 0 14px, transparent 14px 28px ),
  radial-gradient(900px 200px at 10% 50%, rgba(90,125,90,.05), transparent 60%),
  radial-gradient(700px 220px at 90% 20%, rgba(62,47,35,.07), transparent 60%);
}
.footer-grid { display: grid; grid-template-columns: 1.1fr .8fr .6fr; gap: 2rem; position: relative; z-index: 1; }
.logo-footer .logo-mark { width: 30px; height: 30px; border-radius: 8px; }
.footnote { padding: .8rem 0 1.2rem; color: var(--muted); position: relative; z-index: 1; }

/* Responsive */
@media (max-width: 920px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .site-nav { position: absolute; right: 4vw; top: 64px; background: #fff; box-shadow: var(--shadow); border-radius: 12px; padding: .6rem; display: none; flex-direction: column; }
  .site-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .work img { height: 220px; }
}
