/* Providence Custom Carpentry: public site styles */

:root {
  --charcoal: #343434;
  --tan: #a77d55;          /* decorative only, never text on light backgrounds */
  --bronze: #8a5a2b;       /* buttons and accent text */
  --bronze-dark: #74491f;  /* button hover */
  --bg: #f5f2ec;
  --card: #ffffff;
  --text-body: #4a4a46;
  --text-muted: #5a5a55;
  --line: #e4dfd5;
  --line-strong: #d9d3c7;
  --hatch-a: #e4dfd5;
  --hatch-b: #ddd7cb;

  --r-control: 12px;
  --r-tile: 14px;
  --r-card: 20px;
  --r-panel: 24px;
  --r-panel-lg: 28px;

  --wrap: 1240px;
  --gutter: 32px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

/* Author display rules (e.g. .btn { display: inline-flex }) would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--charcoal);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 600; margin: 0; }

:focus-visible {
  outline: 3px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--charcoal); color: #fff; padding: 12px 18px; border-radius: var(--r-control); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 13px 22px;
  font-weight: 600; font-size: 15px; line-height: 1.2;
  border-radius: var(--r-control); border: 2px solid transparent;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--bronze); color: #fff; border-color: var(--bronze); }
.btn-primary:hover { background: var(--bronze-dark); border-color: var(--bronze-dark); }
.btn-outline { border-color: var(--charcoal); color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: var(--bg); }
.btn-light { background: #fff; color: var(--charcoal); border-color: #fff; }
.btn-light:hover { background: var(--bg); border-color: var(--bg); }
.btn-lg { padding: 15px 28px; font-size: 17px; }
.btn-link { padding: 15px 6px; font-weight: 600; font-size: 17px; min-height: 44px; display: inline-flex; align-items: center; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Header ---------- */
.site-header .wrap {
  padding-top: 22px; padding-bottom: 22px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; min-height: 44px; flex: none; }
.brand img { height: 44px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; font-size: 15px; font-weight: 500; }
.nav a:not(.btn) { min-height: 44px; display: inline-flex; align-items: center; }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .nav-phone { color: var(--text-muted); white-space: nowrap; }

/* ---------- Hero ---------- */
.hero {
  padding-top: 40px; padding-bottom: 72px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 56px; align-items: center;
}
.eyebrow { font-size: 15px; font-weight: 600; color: var(--bronze); margin: 0 0 14px; }
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(34px, 9vw, 58px); line-height: 1.08; letter-spacing: -0.025em;
}
.hero-lede { margin: 0 0 32px; font-size: 19px; line-height: 1.55; color: var(--text-body); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.start-card {
  background: var(--card); padding: 32px; border-radius: var(--r-panel);
  box-shadow: 0 1px 0 var(--line-strong), 0 24px 48px -24px rgba(28, 30, 29, 0.25);
}
.start-card h2 { font-size: 26px; letter-spacing: -0.01em; margin-bottom: 6px; }
.start-card p { font-size: 15px; color: var(--text-muted); margin: 0 0 20px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tile {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 18px;
  border: 2px solid var(--charcoal); border-radius: var(--r-tile);
  font-weight: 600; font-size: 16px;
  transition: background-color .15s, color .15s;
}
.tile:hover { background: var(--charcoal); color: var(--bg); }
.tile span { font-size: 22px; line-height: 1; }

/* ---------- Trust strip ---------- */
.trust { background: var(--charcoal); color: var(--bg); }
.trust ul {
  list-style: none; margin: 0 auto; padding-top: 26px; padding-bottom: 26px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px;
  font-size: 15px; font-weight: 500;
}
.trust li { display: flex; align-items: center; gap: 12px; }
.trust svg { flex: none; }

/* ---------- Sections ---------- */
.section { padding-top: 88px; padding-bottom: 24px; }
.section-tight { padding-top: 72px; }
.section h2 {
  font-size: clamp(30px, 7vw, 44px); letter-spacing: -0.02em; line-height: 1.08;
  margin: 0 0 40px; max-width: 680px;
}

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.service {
  background: var(--card); padding: 28px; border-radius: var(--r-card);
  display: grid; gap: 12px; align-content: start;
}
.service h3 { font-size: 22px; }
.service p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-body); }

/* Recent work: cards are rendered by the Worker (src/routes/home.ts) */
.work-head h2 { margin-bottom: 32px; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.job { margin: 0; }
.job-photo {
  aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--hatch-a) 0 14px, var(--hatch-b) 14px 28px);
}
.job-photo { display: block; position: relative; }
.job-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.job-photo:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .job-photo img { transition: none; } .job-photo:hover img { transform: none; } }
.job-count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(52, 52, 52, .85); color: #fff;
  font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
}

/* Large-view slideshow (public/js/site.js) */
.lightbox { border: none; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100dvh; background: #1c1c1b; color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox-figure { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; }
.lightbox-img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lightbox-caption { padding: 14px 72px calc(18px + env(safe-area-inset-bottom)) 20px; font-size: 15px; line-height: 1.45; }
.lightbox-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--charcoal); font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-count { position: absolute; top: calc(22px + env(safe-area-inset-top)); left: 20px; margin: 0; font-size: 14px; font-weight: 600; }
.job figcaption { padding-top: 12px; }
.job-title { display: block; font-weight: 600; }
.job-meta { display: block; font-size: 14px; color: var(--text-muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.steps li { border-top: 3px solid var(--charcoal); padding-top: 18px; }
.step-num { font-weight: 600; font-size: 15px; color: var(--bronze); }
.steps h3 { font-size: 24px; margin: 6px 0 8px; }
.steps p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--text-body); }

.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.review { background: var(--card); padding: 30px; border-radius: var(--r-card); margin: 0; }
.review blockquote { margin: 0 0 18px; font-size: 18px; line-height: 1.55; }
.review blockquote p { margin: 0; }
.review figcaption { font-size: 14px; font-weight: 600; }

/* ---------- Final call to action ---------- */
.cta-wrap { margin-top: 72px; }
.cta {
  background: var(--bronze); color: #fff; padding: 56px 48px; border-radius: var(--r-panel-lg);
  display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between;
}
.cta-text { max-width: 620px; }
.cta h2 { font-size: clamp(28px, 7vw, 40px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 10px; max-width: none; }
.cta p { margin: 0; font-size: 18px; line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer .wrap {
  padding-top: 56px; padding-bottom: 40px;
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between;
  font-size: 14px; color: var(--text-body);
}
.footer-col { display: grid; gap: 6px; align-content: start; }
.footer-name { font-weight: 600; font-size: 18px; color: var(--charcoal); }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.site-footer a:hover { text-decoration-color: currentColor; }
.footer-contact a, .footer-link { display: inline-block; padding: 12px 0; }

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav a.nav-section { display: none; }  /* must outrank .nav a:not(.btn) */
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .site-header .wrap { padding-top: 16px; padding-bottom: 16px; flex-wrap: nowrap; }
  .brand img { height: 36px; }
  .nav { gap: 0; }
  .nav .btn { display: none; }               /* the call bar carries "Start your project" */
  .hero { padding-top: 16px; padding-bottom: 56px; gap: 40px; }
  .hero-lede { font-size: 17px; }
  .start-card { padding: 24px 20px; }
  .section { padding-top: 64px; }
  .section-tight { padding-top: 56px; }
  .cta { padding: 36px 24px; }
  .cta .btn { width: 100%; }
  .footer-contact { display: grid; justify-items: start; }
  .footer-contact .sep { display: none; }

  body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .callbar {
    display: flex; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
    background: var(--bg); box-shadow: 0 -1px 0 var(--line);
  }
  .callbar .btn { flex: 1; padding: 13px 8px; font-size: 16px; }
}
@media (max-width: 380px) {
  .brand img { height: 30px; }
  .nav .nav-phone { font-size: 14px; }
}

/* ---------- Plain content pages (privacy, 404) ---------- */
.page { padding-top: 24px; padding-bottom: 72px; }
.prose { max-width: 720px; background: var(--card); border-radius: var(--r-panel); padding: 40px; }
.prose h1 { font-size: clamp(30px, 7vw, 40px); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 12px; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; }
.prose p, .prose li { font-size: 16px; line-height: 1.6; color: var(--text-body); }
.prose ul { padding-left: 22px; }
.prose a { color: var(--bronze); text-decoration: underline; text-underline-offset: 3px; }
.prose .updated { color: var(--text-muted); font-size: 14px; margin-top: 0; }
@media (max-width: 640px) { .prose { padding: 28px 20px; } }
