/* ==========================================================
   Trades website template — one stylesheet for all 6 pages.
   To re-brand a site, change the colors in :root (or BRAND,
   BRAND_DARK and ACCENT in site.json).
   Rule of thumb: brand color = who you are, accent = the action.
   ========================================================== */

:root {
  --brand: #1d3f72;        /* main color: header text, headings, outline buttons */
  --brand-dark: #132b4f;   /* darker shade for hover */
  --accent: #c2561a;       /* action color: Call buttons, "After" labels, small lines */
  --accent-dark: #9e4414;  /* accent hover */
  --text: #1d232a;
  --muted: #5a6470;
  --bg: #ffffff;
  --bg-alt: #f4f6f8;
  --radius: 10px;
  --max: 1100px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

/* ---------- Basics ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
/* A short accent line under section headings gives each section a clear start. */
.section h2::after { content: ""; display: block; width: 48px; height: 4px; background: var(--accent); margin-top: 10px; border-radius: 2px; }
.center h2::after, .cta-band h2::after, .contact-box h2::after, .services-more h2::after { display: none; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--brand); color: #fff; padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--brand); color: #fff;
  padding: 12px 22px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
  border: 2px solid var(--brand);
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--brand); }
.btn-outline:hover { color: #fff; }
.btn-small { padding: 8px 14px; font-size: .95rem; }
.btn-big { padding: 15px 26px; font-size: 1.1rem; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid #e3e7eb; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { margin-right: auto; display: flex; align-items: center; flex: 1 1 0; min-width: 0; text-decoration: none; }
.logo img { height: 48px; width: auto; }
.logo-text { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--text); } /* long names wrap inside the logo */
.menu-toggle {
  display: none; background: none; border: 2px solid var(--brand);
  color: var(--brand); border-radius: var(--radius); padding: 6px 12px; font: inherit; font-weight: 600;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.site-nav a { text-decoration: none; color: var(--text); font-weight: 600; }
.site-nav a[aria-current="page"] { color: var(--brand); border-bottom: 2px solid var(--accent); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%); padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
.hero-grid:has(.hero-photo) { grid-template-columns: 1.05fr 1fr; } /* 2 columns only when there is a photo */
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .85rem; color: var(--accent-dark); margin-bottom: .6em; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); color: var(--brand); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: .95rem; color: var(--muted); }
.hero-photo { position: relative; margin: 0; }
.hero-photo > img:first-child { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; box-shadow: 0 18px 40px rgba(19, 43, 79, .18); }
.hero-inset { position: absolute; left: -24px; bottom: 36px; width: 38%; aspect-ratio: 4 / 3; object-fit: cover; border: 4px solid #fff; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.hero-photo figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; text-align: right; }

/* ---------- Sections ---------- */
.page-title { background: var(--bg-alt); padding: 40px 0 24px; }
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid #e3e7eb; border-radius: var(--radius); overflow: hidden; }
.card h3, .card p { padding: 0 18px; }
.card h3 { margin-top: 16px; font-size: 1.35rem; }

/* How it works: numbered steps */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.steps li { counter-increment: s; background: #fff; border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 10px; }
.steps strong { display: block; font-family: var(--font-head); font-size: 1.2rem; }

.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: center; }
.two-col img { border-radius: var(--radius); }

.gallery { display: grid; gap: 40px; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ba-pair img { border-radius: var(--radius); }
.before-after { margin: 0; }
.before-after figcaption { margin-top: 10px; color: var(--muted); }
.before-after figcaption strong { display: block; color: var(--text); font-family: var(--font-head); font-size: 1.25rem; }
.ba-item { position: relative; }
.ba-label {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0, 0, 0, .75); color: #fff;
  font-size: .85rem; font-weight: 700; padding: 2px 8px; border-radius: 6px;
}
.ba-label-after { background: var(--accent); }

.review-list { display: grid; gap: 20px; margin-bottom: 24px; }
.review { margin: 0; padding: 20px; background: var(--bg-alt); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.review cite { font-style: normal; font-weight: 600; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact-box { background: var(--bg-alt); padding: 24px; border-radius: var(--radius); }

.services-more { margin-top: 8px; }
.services-more p { font-size: 1.05rem; line-height: 1.8; }

.cta-band { background: var(--brand); color: #fff; padding: 48px 0; text-align: center; }

/* Tap-to-call bar: only shows on phones (see the phone section below). */
.call-bar { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: #1d232a; color: #cfd6dd; padding: 32px 0; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-name { font-weight: 700; color: #fff; }
.footer-copy { width: 100%; font-size: .9rem; margin: 0; }

/* ---------- Photos of any shape ---------- */
/* Phone photos are often tall. These rules crop them to the same shape, so cards line up. */
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: center 35%; }
.ba-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.two-col img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

/* ---------- Phones (screens under 760px wide) ---------- */
@media (max-width: 760px) {
  /* The menu only folds up when JavaScript works ("js" class on <html>).
     Without JavaScript, the links stay visible, so nobody gets stuck. */
  .js .menu-toggle { display: inline-block; }
  .header-call { display: none; }
  .logo img { height: 38px; }
  .site-nav { width: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li a { display: block; padding: 12px 0; border-top: 1px solid #e3e7eb; }
  .site-nav a[aria-current="page"] { border-bottom: 0; color: var(--accent-dark); }

  /* Call | Text bar fixed at the bottom */
  .call-bar {
    display: grid; grid-template-columns: 1fr 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--brand); box-shadow: 0 -2px 8px rgba(0, 0, 0, .15);
  }
  .call-bar a { color: #fff; text-align: center; padding: 14px 8px; font-weight: 700; text-decoration: none; }
  .call-bar a:first-child { background: var(--accent); }
  body { padding-bottom: 56px; } /* room so the bar never covers the footer */

  .hero { padding: 24px 0 40px; }
  .hero-grid:has(.hero-photo) { grid-template-columns: 1fr; gap: 24px; }
  .hero-photo { order: -1; }       /* photo first on phones */
  .hero-inset { left: 10px; bottom: 44px; width: 36%; }
  .hero-actions .btn { width: 100%; text-align: center; }

  .two-col, .contact-grid { grid-template-columns: 1fr; }
  .about-intro img { max-width: 280px; margin-inline: auto; }
  .section { padding: 40px 0; }
}

@media (max-width: 560px) {
  .ba-pair { grid-template-columns: 1fr; }   /* stack before/after so they are big enough to see */
  .card img { aspect-ratio: 16 / 9; }        /* shorter card photos, shorter page */
}

/* ---------- "More finished jobs": single photos without a before ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.job-photo { margin: 0; }
.job-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.job-photo figcaption { margin-top: 8px; font-weight: 600; }

/* ===== es-web-design pass (see DESIGN.md) ===== */
:root { --ease: cubic-bezier(.16, 1, .3, 1); }
html { scroll-padding-top: 96px; scroll-padding-bottom: 80px; }
a[href^="tel:"], .footer-inner { font-variant-numeric: tabular-nums; }

/* Signature: tape-measure strip under section headings (replaces the plain bar) */
.section h2::after {
  width: 96px; height: 10px; border-radius: 2px; margin-top: 12px;
  background:
    repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 12px) left bottom / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 6px) left bottom / 100% 5px no-repeat;
  opacity: .9;
}

/* Hero: Before / After tags and a slide-in for the small photo */
.hero-photo::before, .hero-photo::after {
  position: absolute; z-index: 2; font: 800 .75rem/1 var(--font-head); letter-spacing: .08em;
  text-transform: uppercase; padding: 7px 10px; border-radius: 6px; pointer-events: none;
}
.hero-photo::after { content: "After"; top: 14px; right: 14px; background: var(--accent); color: #fff; }
.hero-photo::before { content: "Before"; left: -16px; bottom: 44px; background: var(--text); color: #fff; }
.hero-inset { animation: inset-in .9s var(--ease) .35s both; }
@keyframes inset-in { from { opacity: 0; transform: translate(-18px, 18px) rotate(-3deg); } }

/* Cards: lift, and the photo zooms a little */
.card { transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card img { transition: transform .8s var(--ease); }
.card:hover { transform: translateY(-5px); box-shadow: 0 22px 44px -26px rgba(19, 43, 79, .45); }
.card:hover img { transform: scale(1.04); }

/* Steps: joined by a tape line that draws in */
.steps { position: relative; }
.steps li { position: relative; z-index: 1; }
.steps::before {
  content: ""; position: absolute; left: 38px; right: 38px; top: 37px; height: 6px; z-index: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 10px);
  opacity: .5; transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease) .2s;
}
.steps.in::before, .steps:not(.reveal-wait)::before { transform: scaleX(1); }
.steps li::before { box-shadow: 0 0 0 6px #fff; }

/* Buttons respond */
.btn { transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .2s, border-color .2s, color .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(19, 43, 79, .5); }

/* Footer: 3 columns on wider screens */
@media (min-width: 761px) {
  .footer-inner { display: grid; grid-template-columns: 2fr 1fr; gap: 12px 48px; align-items: start; }
  .footer-copy { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; margin-top: 8px; }
}

/* Scroll reveal (added by js/main.js only to things below the first screen) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .steps::before { display: none; }
  .hero-photo::before { left: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Text for screen readers only */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
