/* ============================================================
   Canopy Maintenance & Repairs
   Built on the same UI/UX system as willsledge.com and the DPP
   showcase — dark ground, grain overlay, preloader, Lenis +
   GSAP/ScrollTrigger reveals — with its own sage/moss identity
   (echoing the real Canopy tree mark) and its own signature
   interaction: a growing branch/checklist reveal instead of DPP's
   pinned pillar cycling.
   ============================================================ */

:root {
  --bg: #0a0c09;
  --bg-elevated: #131711;
  --bg-card: #181d15;
  --fg: #f3f5ef;
  --fg-muted: #b3bba9;
  --fg-faint: #6d7566;
  --accent: #8fae6a;
  --accent-strong: #a9c584;
  --accent-soft: rgba(143, 174, 106, 0.16);
  --line: rgba(243, 245, 239, 0.10);
  --line-strong: rgba(243, 245, 239, 0.22);
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --maxw: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
section { scroll-margin-top: 90px; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- texture ---------- */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 200;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; background: var(--bg);
  animation: preloader-failsafe 0s 6s forwards;
}
.preloader-mark img { width: clamp(110px, 18vw, 170px); height: auto; display: block; opacity: 0.92; }
.preloader-bar {
  width: clamp(140px, 20vw, 200px); height: 1px; background: var(--line);
  overflow: hidden; position: relative;
}
.preloader-bar-fill { position: absolute; inset: 0; width: 0%; background: var(--accent); }
@keyframes preloader-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .preloader { display: none; } }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem var(--pad);
  background: linear-gradient(to bottom, rgba(10,12,9,0.92), rgba(10,12,9,0));
  backdrop-filter: blur(6px);
}
.brand img { height: 38px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a { font-size: 0.92rem; color: var(--fg-muted); transition: color 0.2s ease; }
.main-nav a:hover { color: var(--fg); }
.main-nav a.nav-cta {
  color: #0e1108; background: var(--accent);
  padding: 0.5rem 1.15rem; border-radius: 999px; font-weight: 600;
}
.main-nav a.nav-cta:hover { background: var(--accent-strong); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { width: 22px; height: 2px; background: var(--fg); display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.7rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn-primary { background: var(--accent); color: #0e1108; }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- reveal-up ---------- */
.reveal-up { opacity: 1; transform: none; }
.js-motion .reveal-up { opacity: 0; transform: translateY(28px); }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 7rem var(--pad) 4rem; position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(143,174,106,0.10), transparent 60%),
    var(--bg);
}
.hero-watermark {
  position: absolute; top: 50%; left: 50%; width: min(56vw, 620px); height: auto;
  transform: translate(-50%, -50%); opacity: 0.05; pointer-events: none; z-index: 0;
}
.hero-inner { max-width: 900px; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.hero-kicker {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.78rem; color: var(--accent); margin: 0 0 1.5rem;
}
.hero-title {
  font-family: var(--font-display); font-weight: 700; margin: 0;
  font-size: clamp(2.8rem, 9vw, 6.2rem); line-height: 1.02; letter-spacing: -0.01em;
}
.hero-title .line { display: block; }
.hero-sub {
  font-family: var(--font-body); font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--fg-muted); margin: 1.6rem 0 0; max-width: 620px;
}
.hero-actions { margin-top: 2.6rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-phone { margin-top: 1.6rem; font-family: var(--font-display); font-size: 0.95rem; color: var(--fg-muted); border-bottom: 1px solid transparent; }
.hero-phone:hover { color: var(--accent); border-color: var(--accent); }
.hero-scroll-cue {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  width: 1px; height: 46px; background: var(--line-strong); overflow: hidden;
}
.hero-scroll-cue span {
  position: absolute; top: -100%; left: 0; width: 100%; height: 100%; background: var(--accent);
}
.js-motion .hero-scroll-cue span { animation: cue-drop 2.2s ease-in-out infinite; }
@keyframes cue-drop { 0% { top: -100%; } 60% { top: 100%; } 100% { top: 100%; } }

/* ---------- section basics ---------- */
.section-kicker {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 0.78rem; color: var(--accent); margin: 0 0 1rem;
}

/* ---------- about ---------- */
.about { position: relative; overflow: hidden; padding: 8rem var(--pad); background: var(--bg-elevated); }
.about-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem 4rem; }
.about-headline {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15; margin: 0; grid-column: 1; align-self: start;
}
.about-copy { grid-column: 2; align-self: start; }
.about-copy p { color: var(--fg-muted); margin: 0 0 1.3rem; font-size: 1.05rem; }
.about-copy p:last-child { margin-bottom: 0; }
.about-stats { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.stat { display: flex; align-items: baseline; gap: 0.3rem; flex-wrap: wrap; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 700; color: var(--accent); }
.stat-suffix { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.92rem; color: var(--fg-muted); max-width: 220px; margin-left: 0.6rem; }
.stat-values { display: flex; gap: 1.8rem; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.04em; color: var(--fg-muted); flex-wrap: wrap; }

/* ---------- services: growing branch reveal ----------
   Default markup is a plain, fully-visible two-column checklist
   (real fallback). JS adds .branch-pinned only once it has set up
   the pinned/scrubbed ScrollTrigger version on wide, motion-allowed
   viewports. */
.services { position: relative; background: var(--bg); padding: 6rem var(--pad) 2rem; }
.services-stage { max-width: var(--maxw); margin: 0 auto; position: relative; }
.services-kicker { text-align: center; max-width: 560px; margin: 0 auto 0.6rem; }
.services-headline {
  font-family: var(--font-display); font-weight: 600; text-align: center;
  font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 0 0 3.5rem;
}
.branch-wrap { position: absolute; left: 50%; top: 6.5rem; bottom: 0; width: 2px; transform: translateX(-50%); z-index: 0; }
.branch-svg { width: 100%; height: 100%; overflow: visible; }
#branchTrunk { fill: none; stroke: var(--line-strong); stroke-width: 2; vector-effect: non-scaling-stroke; }
.js-motion #branchTrunk { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 1; }

.services-columns { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 4rem; }
.services-col-label {
  display: block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.85rem; color: var(--accent); margin-bottom: 1.4rem;
}
.services-col-right { text-align: right; }
.branch-list li {
  font-family: var(--font-display); font-size: clamp(1rem, 1.6vw, 1.2rem); font-weight: 500;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line); color: var(--fg);
}
.branch-list li:last-child { border-bottom: none; }
.js-motion .branch-list li { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js-motion .branch-list li.is-in { opacity: 1; transform: translateY(0); }

.services-full { max-width: var(--maxw); margin: 5rem auto 0; padding-top: 3.5rem; border-top: 1px solid var(--line); }
.services-full-lede { color: var(--fg-muted); max-width: 720px; margin: 0 0 2.5rem; font-size: 1.02rem; }
.services-full-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.services-full-grid h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--accent); margin: 0 0 1rem; }
.services-full-grid ul { columns: 1; }
.services-full-grid li { color: var(--fg-muted); font-size: 0.92rem; padding: 0.4rem 0; border-bottom: 1px dashed var(--line); }
.services-full-grid li:last-child { border-bottom: none; }

/* ---------- pricing ---------- */
.pricing {
  padding: 8rem var(--pad); background: var(--bg-elevated);
  background-image:
    linear-gradient(rgba(243,245,239,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243,245,239,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.pricing-inner { max-width: var(--maxw); margin: 0 auto; }
.pricing-headline {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.2; margin: 0 0 1.2rem; max-width: 680px;
}
.pricing-copy { color: var(--fg-muted); max-width: 640px; margin: 0 0 3rem; font-size: 1.02rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px;
  padding: 2rem 1.8rem; transition: border-color 0.25s ease, transform 0.25s ease;
}
.pricing-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.pricing-mark { font-family: var(--font-display); color: var(--accent); font-size: 0.9rem; letter-spacing: 0.08em; }
.pricing-card h3 { font-family: var(--font-display); font-size: 1.25rem; margin: 0.9rem 0 0.6rem; }
.pricing-card p { color: var(--fg-muted); margin: 0; font-size: 0.98rem; }

/* ---------- our work ---------- */
.work { position: relative; padding: 8rem var(--pad); background: var(--bg); }
.work::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(143,174,106,0.06), transparent 62%);
}
.work-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto 2.5rem; }
.work-headline { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0; }
.work-grid { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.work-grid figure { margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; background: var(--bg-card); }
.work-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.work-grid figure:hover img { transform: scale(1.05); }

/* ---------- testimonials ---------- */
.testimonials { position: relative; overflow: hidden; padding: 7rem var(--pad); background: var(--bg-elevated); }
.testimonial-quote-mark {
  display: block; width: 46px; height: auto; margin: 0 auto 1.1rem;
  color: var(--accent); opacity: 0.8;
}
.testimonials-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; }
.testimonials-inner .section-kicker { text-align: center; }
.testimonial-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1rem; }
.testimonial-grid blockquote { margin: 0; background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; padding: 2.2rem; }
.testimonial-grid p { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.5; margin: 0 0 1.2rem; color: var(--fg); }
.testimonial-grid cite { font-style: normal; color: var(--accent); font-size: 0.9rem; letter-spacing: 0.04em; }

/* ---------- contact ---------- */
.contact { position: relative; overflow: hidden; padding: 8rem var(--pad); background: var(--bg); }
.contact-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem 4rem; }
.contact-info h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin: 0.4rem 0 1.6rem; }
.contact-phone { display: inline-block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--accent); margin-bottom: 1rem; }
.contact-phone:hover { color: var(--accent-strong); }
.contact-address { color: var(--fg-muted); font-size: 0.98rem; }
.contact-form { display: flex; flex-direction: column; gap: 0.9rem; }
.form-row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.form-row input { flex: 1 1 200px; min-width: 0; }
.contact-form input, .contact-form textarea {
  background: rgba(255,255,255,0.05); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 0.85rem 1.1rem; color: var(--fg); font-family: var(--font-body); font-size: 0.98rem;
  resize: vertical;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--fg-faint); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { align-self: flex-start; margin-top: 0.4rem; min-width: 200px; }
.form-status { min-height: 1.4em; font-size: 0.92rem; color: var(--fg-muted); margin: 0.6rem 0 0; }
.form-status.is-error { color: #e0876b; }
.form-status.is-success { color: var(--accent); }

/* ---------- procedural section motifs (leaf-spray, reused per section) ---------- */
.section-motif { position: absolute; color: var(--accent); pointer-events: none; z-index: 0; }
.about-motif {
  top: -8%; right: -9%; width: min(50vw, 600px); height: auto;
  opacity: 0.07; transform: rotate(18deg);
}
.contact-motif {
  bottom: -16%; left: -11%; width: min(44vw, 520px); height: auto;
  opacity: 0.06; transform: rotate(-160deg) scaleX(-1);
}

/* ---------- footer ---------- */
.site-footer {
  padding: 3.5rem var(--pad) 3rem; text-align: center; background: var(--bg);
  border-top: 1px solid var(--line);
}
.site-footer .brand-mark { height: 36px; width: auto; margin: 0 auto 1.2rem; opacity: 0.85; }
.footer-links { display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 1.4rem; flex-wrap: wrap; color: var(--fg-muted); font-size: 0.88rem; }
.footer-links a { color: var(--fg-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-sep { color: var(--fg-faint); }
.site-footer p { color: var(--fg-faint); font-size: 0.85rem; margin: 0.3rem 0; }
.footer-credit a { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-credit a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .about-inner { grid-template-columns: 1fr; }
  .about-copy, .about-headline { grid-column: 1; }
  .services-columns { grid-template-columns: 1fr; gap: 2rem; }
  .services-col-right { text-align: left; }
  .branch-wrap { display: none; }
  .services-full-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .form-row { flex-direction: column; }
  .about-stats { flex-direction: column; align-items: flex-start; }
}
