/* ==========================================================================
   Pine Rock Construction & Remodeling — Design System
   Visual Tone: Rustic | Photo Density: Balanced | Rhythm: Standard
   ========================================================================== */

:root {
  /* --- Color System (from spec, exact hex) --- */
  --color-primary: #3e6b57;        /* deep sage green, matched to logo */
  --color-primary-light: #5e8a75;  /* exact logo green */
  --color-primary-dark: #2c4e3f;
  --color-accent: #0e0a01;         /* near-black earth brown */
  --color-neutral: #f2ecdd;        /* warm cream (was near-white, now visibly warm) */
  --color-neutral-dark: #e8e5dc;
  --color-white: #ffffff;
  --color-text: #1c1a15;
  --color-text-muted: #5b574c;
  --color-border: #ddd2ba;

  /* --- Derived earthy tones (mixed only from the three spec colors above) --- */
  --color-page-bg: #e9e1c9;        /* deeper sand/beige base, replaces near-white page background */
  --color-sand: #cfc9ba;           /* accent + neutral, warm stone tan */
  --color-sand-light: #ddd3b4;     /* alt-section beige, clearly warmer than page bg */
  --color-stone: #97928a;          /* deeper accent + neutral, muted taupe */
  --color-sage: #d7dcc9;           /* primary + neutral, soft sage tint */
  --color-moss: #304e3d;           /* primary + accent, deep mossy shadow */
  --color-terracotta: #b5674a;     /* warm clay accent */
  --color-terracotta-dark: #8f4e37;

  /* --- Typography --- */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  --fs-xs: 0.875rem;
  --fs-sm: 1rem;
  --fs-base: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;
  --fs-4xl: 3.75rem;

  /* --- Spacing scale --- */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4rem;
  --sp-7: 6rem;
  --sp-8: 8rem;

  /* --- Layout --- */
  --container-max: 1200px;
  --container-pad: 1.5rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-soft: 0 8px 30px rgba(14, 10, 1, 0.08);
  --shadow-strong: 0 16px 48px rgba(14, 10, 1, 0.18);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-page-bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Subtle procedural grain texture, tiled over the whole page for a tactile, non-digital feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-accent);
  margin: 0 0 var(--sp-2) 0;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-2) 0; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--sp-7) 0;
}
.section--tight { padding: var(--sp-5) 0; }
.section--dark {
  background: var(--color-accent);
  color: var(--color-neutral);
}
.section--dark h2, .section--dark h3 { color: var(--color-neutral); }
.section--alt { background: var(--color-sand-light); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--sp-1);
}

.section-head {
  max-width: 640px;
  margin: 0 0 var(--sp-5) 0;
}
.section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn--primary:hover { background: var(--color-primary-light); box-shadow: var(--shadow-soft); }
.btn--outline {
  background: transparent;
  border-color: var(--color-neutral);
  color: var(--color-neutral);
}
.btn--outline:hover { background: var(--color-neutral); color: var(--color-accent); }
.btn--outline-dark {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn--outline-dark:hover { background: var(--color-accent); color: var(--color-neutral); }
.btn--block { display: block; text-align: center; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-neutral);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 84px;
  max-width: 1320px;
}
.site-logo img { height: 48px; width: auto; }
.logo-lockup { display: flex; align-items: center; gap: 0.65rem; }
.logo-lockup img { height: 46px; width: 46px; }
.logo-lockup .logo-word {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-accent);
  line-height: 1;
}
.logo-lockup .logo-word small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-top: 0.15rem;
}

.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav > ul { display: flex; align-items: center; gap: 1.5rem; }
.main-nav > ul > li { position: relative; }
.nav-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-accent);
  padding: var(--sp-1) 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.nav-link:hover { color: var(--color-primary); }
.caret { font-size: 0.65em; transform: translateY(1px); }

.header-cta { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }
.header-cta .btn { padding: 0.75rem 1.25rem; font-size: 0.9rem; white-space: nowrap; }
.header-phone {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-accent);
  white-space: nowrap;
}

/* Mega dropdown */
.mega-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
  padding: var(--sp-4);
  display: none;
  z-index: 50;
}
.mega-dropdown.services-dropdown { width: 940px; }
.mega-dropdown.locations-dropdown { width: 320px; }
.main-nav > ul > li:hover .mega-dropdown,
.main-nav > ul > li:focus-within .mega-dropdown { display: block; }

.mega-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.mega-col h4 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin: 0 0 0.6rem 0;
  font-weight: 700;
}
.mega-col ul li { margin-bottom: 0.4rem; }
.mega-col ul li a {
  font-size: var(--fs-sm);
  color: var(--color-text);
}
.mega-col ul li a:hover { color: var(--color-primary); text-decoration: underline; }

.locations-list li { margin-bottom: 0.4rem; }
.locations-list li a { font-size: var(--fs-sm); color: var(--color-text); }
.locations-list li a:hover { color: var(--color-primary); text-decoration: underline; }

/* Mobile nav */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  position: relative;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--color-accent);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle span { top: 19px; }
.menu-toggle span::before { top: -8px; }
.menu-toggle span::after { top: 8px; }
.menu-toggle.is-open span { opacity: 0; }
.menu-toggle.is-open span::before { transform: translateY(8px) rotate(45deg); }
.menu-toggle.is-open span::after { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    inset: 84px 0 0 0;
    background: var(--color-neutral);
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-3) var(--container-pad);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    gap: 0;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .main-nav > ul > li { border-bottom: 1px solid var(--color-border); }
  .nav-link { padding: var(--sp-2) 0; width: 100%; justify-content: space-between; }
  .mega-dropdown {
    display: none;
    position: static;
    transform: none;
    width: 100% !important;
    box-shadow: none;
    border: none;
    padding: 0 0 var(--sp-2) 0;
  }
  .mega-dropdown.force-open { display: block; }
  .mega-cols { grid-template-columns: 1fr 1fr; }
  .header-cta .btn { display: none; }
  .menu-toggle { display: block; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-6);
  background:
    linear-gradient(to bottom, rgba(14,10,1,0) 0%, rgba(14,10,1,0) 48%, rgba(14,10,1,0.35) 68%, rgba(14,10,1,0.8) 100%),
    url('photos/hero-sedona-pool-view.jpg') center 14% / cover no-repeat;
  color: var(--color-white);
  overflow: hidden;
}
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 720px; }
.hero h1 {
  color: var(--color-white);
  font-size: var(--fs-4xl);
  margin-bottom: var(--sp-3);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero-support {
  font-size: var(--fs-lg);
  color: var(--color-neutral);
  margin-bottom: var(--sp-4);
  max-width: 560px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.45);
}
.hero-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

@media (max-width: 700px) {
  .hero { min-height: 600px; padding-bottom: var(--sp-4); }
  .hero h1 { font-size: var(--fs-3xl); }
}

/* ==========================================================================
   Trust strip
   ========================================================================== */
.trust-strip {
  background: var(--color-sand-light);
  border-bottom: 1px solid var(--color-border);
}
.trust-strip .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  padding-bottom: var(--sp-5);
}
.trust-item { text-align: center; }
.trust-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}
.trust-item span { display: block; font-size: var(--fs-xs); color: var(--color-text-muted); }
@media (max-width: 800px) {
  .trust-strip .container { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Services grid
   ========================================================================== */
.services-category { margin-bottom: var(--sp-5); }
.services-category:last-child { margin-bottom: 0; }
.services-category-title {
  font-size: var(--fs-base);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  position: relative;
}
.services-category-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='10' viewBox='0 0 72 10'><path d='M1 6 C 8 1, 14 1, 20 6 S 32 11, 38 6 S 50 1, 56 6 S 68 11, 71 5' fill='none' stroke='%233e6b57' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
}
.services-category-photo {
  margin-bottom: var(--sp-3);
  border-radius: 38px 8px 38px 8px;
  overflow: hidden;
  height: 420px;
  box-shadow: var(--shadow-soft);
}
.services-category-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 900px) {
  .services-category-photo { height: 320px; }
}
@media (max-width: 600px) {
  .services-category-photo { height: 240px; }
}
.services-category-note {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0 0 var(--sp-2) 0;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.service-card {
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: 22px 6px 22px 6px;
  padding: var(--sp-3);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-radius 0.2s ease;
}
.service-card:nth-child(3n+2) { border-radius: 6px 22px 6px 22px; }
.service-card:nth-child(3n+3) { border-radius: 22px 22px 6px 6px; }
.service-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-3px) rotate(-0.3deg);
  border-radius: 28px 10px 28px 10px;
}
.service-card h3 { font-size: var(--fs-base); margin-bottom: 0.4rem; }
.service-card h3 a:hover { color: var(--color-primary); }
.service-card p { font-size: var(--fs-sm); color: var(--color-text-muted); margin: 0; }

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Case study preview
   ========================================================================== */
.case-preview {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sp-4);
  align-items: center;
}
.case-preview-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.case-preview-photos img {
  border-radius: 36px 8px 36px 8px;
  height: 260px;
  object-fit: cover;
  box-shadow: var(--shadow-strong);
}
.case-preview-photos img:first-child { height: 400px; grid-row: span 2; border-radius: 8px 36px 8px 36px; }
.case-preview-copy .eyebrow { color: var(--color-terracotta); opacity: 1; }
.case-preview-copy h2 { color: var(--color-neutral); }
.case-preview-copy p { color: var(--color-neutral); opacity: 0.9; }
.case-feature-list { margin: var(--sp-3) 0; }
.case-feature-list li {
  padding-left: 1.4rem;
  position: relative;
  margin-bottom: 0.5rem;
  color: var(--color-neutral);
  opacity: 0.9;
}
.case-feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--color-primary-light);
  border-radius: 50%;
}
@media (max-width: 900px) {
  .case-preview { grid-template-columns: 1fr; }
  .case-preview-photos img:first-child { height: 260px; }
}

/* ==========================================================================
   Testimonials
   ========================================================================== */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.testimonial-card {
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: 34px 10px 34px 10px;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
}
.testimonial-card:nth-child(2n) { border-radius: 10px 34px 10px 34px; }
.testimonial-stars {
  color: var(--color-terracotta);
  letter-spacing: 0.15em;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-2);
}
.testimonial-text {
  font-size: 0.95rem;
  color: var(--color-text);
  flex-grow: 1;
  margin-bottom: var(--sp-3);
}
.testimonial-meta {
  border-top: 1px solid var(--color-border);
  padding-top: var(--sp-2);
}
.testimonial-meta strong {
  display: block;
  font-family: var(--font-heading);
  color: var(--color-accent);
  font-size: var(--fs-base);
}
.testimonial-meta span {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .testimonial-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Process
   ========================================================================== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.process-step { text-align: left; }
.process-num {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--sp-2);
  background: var(--color-primary);
  border-radius: 65% 35% 55% 45% / 50% 60% 40% 50%;
}
.process-step:nth-child(even) .process-num { border-radius: 40% 60% 45% 55% / 55% 45% 60% 40%; background: var(--color-terracotta); }
@media (max-width: 900px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .process-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   FAQ (details/summary)
   ========================================================================== */
.faq-list details {
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: 18px 4px 18px 4px;
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-2);
}
.faq-list summary {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  cursor: pointer;
  color: var(--color-accent);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font-size: 1.4em; color: var(--color-primary); }
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list details p { margin-top: var(--sp-2); color: var(--color-text-muted); }
.faq-more { margin-top: var(--sp-3); }

/* ==========================================================================
   CTA section
   ========================================================================== */
.cta-section { background: var(--color-primary); color: var(--color-white); }
.cta-section h2 { color: var(--color-white); }
.cta-section .section-head p { color: var(--color-neutral); opacity: 0.9; }
.cta-form-wrap {
  background: var(--color-neutral);
  border-radius: 36px 10px 36px 10px;
  padding: var(--sp-4);
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-text);
}
.form-placeholder {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  text-align: center;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-accent);
  color: var(--color-neutral);
  padding: var(--sp-6) 0 var(--sp-3) 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.footer-logo img { height: 40px; margin-bottom: var(--sp-2); }
.footer-tagline { color: var(--color-neutral); opacity: 0.75; font-size: var(--fs-sm); }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-neutral);
  opacity: 0.6;
  margin-bottom: var(--sp-2);
  font-weight: 700;
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: var(--color-neutral); opacity: 0.85; font-size: var(--fs-sm); }
.footer-col ul li a:hover { opacity: 1; text-decoration: underline; }
.footer-nap p { color: var(--color-neutral); opacity: 0.85; font-size: var(--fs-sm); margin-bottom: 0.3rem; }
.footer-nap a { text-decoration: underline; }
.footer-map { margin-top: var(--sp-3); border-radius: 28px 8px 28px 8px; overflow: hidden; border: 1px solid rgba(245,244,240,0.15); }
.footer-map iframe { width: 100%; height: 220px; border: 0; display: block; }
.map-placeholder {
  height: 220px;
  border: 2px dashed rgba(245,244,240,0.3);
  border-radius: 28px 8px 28px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-neutral);
  opacity: 0.6;
  font-size: var(--fs-xs);
  padding: var(--sp-2);
}
.footer-bottom {
  border-top: 1px solid rgba(245,244,240,0.15);
  padding-top: var(--sp-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--color-neutral);
  opacity: 0.65;
}
.footer-bottom ul { display: flex; gap: var(--sp-3); }
.footer-bottom ul a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Utility
   ========================================================================== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
