/* =========================================================
   Sandia Septic Solutions — Design System
   Signature: topographic contour-line motifs + soil-strata
   banding, drawn from site-survey drafting and perc-test
   soil profiles — the actual technical world this business
   lives in, not a generic desert-brochure look.
   ========================================================= */

:root{
  /* Color */
  --navy:        #1E2A22; /* basalt / night piñon-juniper — header, footer, dark sections */
  --navy-2:      #283A2E;
  --paper:       #F0EAD9; /* chalky caliche paper */
  --paper-2:     #E7DEC7;
  --ink:         #262019; /* warm near-black text */
  --ink-soft:    #5B5346;
  --brick:       #A8451E; /* fired adobe brick — primary accent / CTA */
  --brick-dark:  #7C3315;
  --brick-tint:  #F3DED3;
  --juniper:     #5B6B4C; /* sage-juniper — secondary accent */
  --juniper-dark:#42502F;
  --sand-line:   #C9B896; /* contour-line / divider tone */
  --white:       #FFFFFF;
  --line:        #DCD0B4;

  /* Type */
  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Scale */
  --radius: 4px;
  --shadow: 0 1px 2px rgba(38,32,25,.06), 0 6px 20px -8px rgba(38,32,25,.18);
  --container: 1180px;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 17px;
}
img{ max-width:100%; display:block; }
a{ color: var(--brick); text-decoration: none; }
a:hover{ text-decoration: underline; }
h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1{ font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h2{ font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3{ font-size: 1.3rem; }
p{ margin: 0 0 1em; }
ul,ol{ padding-left: 1.25em; }
.container{ max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section{ padding: 64px 0; }
.section-tight{ padding: 40px 0; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline: 3px solid var(--brick);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior:auto !important; }
}

/* ---------- Eyebrow / labels ---------- */
.eyebrow{
  display:inline-block;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brick);
  margin-bottom: .6em;
}
.eyebrow.on-dark{ color: #E8B99A; }

/* ---------- Header ---------- */
.site-header{
  background: var(--navy);
  position: sticky; top:0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .container{
  display:flex; align-items:center; justify-content:space-between;
  height: 72px;
}
.logo{
  display:flex; align-items:center; gap:10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.15rem;
  color: #fff; letter-spacing: -0.01em;
}
.logo .mark{ width:26px; height:26px; flex-shrink:0; }
.logo .sub{ display:block; font-family: var(--font-body); font-weight:500; font-size:.62rem; letter-spacing:.08em; text-transform:uppercase; color:#B9C4B4; }

.main-nav{ display:flex; align-items:center; gap: 28px; }
.main-nav a{ color:#E9E4D6; font-weight:500; font-size:.95rem; }
.main-nav a:hover{ color:#fff; text-decoration:none; }
.main-nav .has-drop{ position:relative; padding-bottom: 14px; margin-bottom: -14px; }
.dropdown{
  position:absolute; top:100%; left:0; background:#fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding:10px; min-width:240px; display:none; margin-top:0;
}
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown{ display:block; }
.dropdown a{ display:block; color:var(--ink); padding:8px 10px; border-radius:3px; font-size:.92rem; }
.dropdown a:hover{ background: var(--paper); text-decoration:none; }

.nav-cta{
  background: var(--brick); color:#fff !important; padding:10px 18px; border-radius: var(--radius);
  font-weight:600; font-size:.9rem;
}
.nav-cta:hover{ background: var(--brick-dark); text-decoration:none; }

.mobile-toggle{ display:none; background:none; border:0; color:#fff; font-size:1.6rem; cursor:pointer; }

@media (max-width: 940px){
  .main-nav{
    position:fixed; inset: 72px 0 0 0; background: var(--navy);
    flex-direction:column; align-items:flex-start; padding: 24px; gap: 4px;
    transform: translateX(100%); transition: transform .25s ease; overflow-y:auto;
  }
  .main-nav.open{ transform: translateX(0); }
  .main-nav a{ width:100%; padding: 14px 4px; border-bottom:1px solid rgba(255,255,255,.08); }
  .has-drop{ padding-bottom:0; margin-bottom:0; }
  .has-drop > a{ border-bottom:none; opacity:.8; font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; padding-bottom:6px; }
  .has-drop .dropdown{ position:static; display:block; background:none; box-shadow:none; padding: 4px 0 16px 6px; margin:0; border-bottom:1px solid rgba(255,255,255,.08); }
  .has-drop .dropdown a{ color:#fff; border-bottom:none; padding:11px 4px; font-size:1rem; }
  .nav-cta{ margin-top:12px; text-align:center; width:100%; }
  .mobile-toggle{ display:block; }
}

/* ---------- Contour-line divider (signature element) ---------- */
.contour{
  display:block; width:100%; height:34px; line-height:0;
}
.contour path{ fill: none; }
.contour.into-paper path{ stroke: var(--paper); }
.contour.into-white path{ stroke: var(--white); }
.contour.into-navy path{ stroke: var(--navy); }
.contour-fill-paper{ background: var(--paper); }
.contour-fill-white{ background: var(--white); }
.contour-fill-navy{ background: var(--navy); }

/* ---------- Soil-strata band (signature element) ---------- */
.strata{
  display:flex; height:14px; width:100%; border-radius:3px; overflow:hidden;
  box-shadow: inset 0 0 0 1px rgba(38,32,25,.08);
}
.strata span{ display:block; height:100%; }
.strata .s1{ background:#D8C79E; flex:1.4; } /* sandy topsoil */
.strata .s2{ background:#C7A96B; flex:1; }   /* transitional */
.strata .s3{ background:#E7DEC2; flex:2; }   /* caliche */
.strata .s4{ background:#8B6F4B; flex:0.8; } /* clay/hardpan */

/* ---------- Hero (split layout) ---------- */
.hero{
  background: var(--navy);
  color: #fff;
  display:grid; grid-template-columns: 1fr 1.05fr; align-items:stretch;
  min-height: 560px;
}
.hero-copy{ display:flex; flex-direction:column; justify-content:center; padding: 56px 48px; }
.hero-copy h1{ color:#fff; }
.hero-copy .lede{ color:#D6DCCF; font-size:1.12rem; max-width: 46ch; }
.hero-media{ position:relative; overflow:hidden; }
.hero-media img{ width:100%; height:100%; object-fit:cover; min-height:340px; }
.trust-row{ display:flex; flex-wrap:wrap; gap: 18px 28px; margin-top: 28px; }
.trust-row .item{ display:flex; align-items:center; gap:8px; font-size:.88rem; color:#C9D1C4; font-weight:500; }
.trust-row svg{ width:16px; height:16px; flex-shrink:0; color:#E8B99A; }

@media (max-width: 860px){
  .hero{ grid-template-columns: 1fr; min-height:auto; }
  .hero-copy{ padding: 40px 24px; order:2; }
  .hero-media img{ min-height:260px; }
}

/* Simple page hero (non-home pages) */
.page-hero{
  background: var(--navy); color:#fff; padding: 0; display:grid; grid-template-columns: 1fr 1fr; min-height: 320px;
}
.page-hero-copy{ display:flex; flex-direction:column; justify-content:center; padding: 44px 48px; }
.page-hero-copy h1{ color:#fff; font-size: clamp(1.7rem,3.2vw,2.4rem); }
.page-hero-copy p{ color:#D6DCCF; max-width:52ch; }
.page-hero-media{ overflow:hidden; }
.page-hero-media img{ width:100%; height:100%; object-fit:cover; min-height: 260px; }
@media (max-width: 860px){
  .page-hero{ grid-template-columns:1fr; }
  .page-hero-copy{ padding: 32px 24px; order:2; }
  .page-hero-media img{ min-height:200px; }
}

/* ---------- Media frame (bulletproof, never-distort image wrapper) ----------
   Any inline content image (not a hero) should be wrapped in one of these
   instead of a raw <img>. Explicit aspect-ratio on the wrapper + object-fit:
   cover on the img means the image cannot be squashed/stretched no matter
   what the surrounding grid/flex row does to the wrapper's box. Relying on
   the HTML width/height attributes alone to imply aspect ratio is NOT
   sufficient once an image sits in a CSS Grid cell next to taller content —
   the browser can resolve width and height independently in that case and
   silently distort the image. Always use .media-frame for content images. */
.media-frame{ position:relative; width:100%; overflow:hidden; border-radius:6px; display:block; }
.media-frame img{ width:100%; height:100%; object-fit:cover; display:block; }
.media-frame.ratio-16-9{ aspect-ratio: 16 / 9; }
.media-frame.ratio-3-2{ aspect-ratio: 3 / 2; }
.media-frame.ratio-4-3{ aspect-ratio: 4 / 3; }
.media-frame.ratio-4-5{ aspect-ratio: 4 / 5; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-display); font-weight:600; font-size:.98rem;
  padding: 14px 26px; border-radius: var(--radius); border: 2px solid transparent;
  cursor:pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary{ background: var(--brick); color:#fff; }
.btn-primary:hover{ background: var(--brick-dark); text-decoration:none; }
.btn-outline{ background:transparent; border-color: currentColor; color:#fff; }
.btn-outline:hover{ background: rgba(255,255,255,.1); text-decoration:none; }
.btn-outline-ink{ background:transparent; border-color: var(--ink); color:var(--ink); }
.btn-outline-ink:hover{ background: var(--ink); color:#fff; text-decoration:none; }
.btn-block{ width:100%; }

/* ---------- Cards / grids ---------- */
.grid{ display:grid; gap: 24px; }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px){ .grid-3, .grid-2{ grid-template-columns: 1fr; } }

.card{
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; border-top: 3px solid var(--brick);
}
.card h3{ margin-bottom:.4em; }
.card p{ color: var(--ink-soft); margin-bottom: 1em; font-size:.96rem; }
.card .learn{ font-weight:600; font-size:.9rem; }

.icon-badge{
  width:44px; height:44px; border-radius:50%; background: var(--brick-tint); color:var(--brick);
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
}
.icon-badge svg{ width:22px; height:22px; }

/* Location cards use juniper top border to visually distinguish from service cards */
.card.location{ border-top-color: var(--juniper); }
.card.location .icon-badge{ background:#E3E7DC; color: var(--juniper-dark); }

/* ---------- Process / steps (real sequence => numbered) ---------- */
.steps{ counter-reset: step; display:grid; gap: 28px; grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .steps{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .steps{ grid-template-columns: 1fr; } }
.step{ position:relative; padding-top: 8px; }
.step .num{
  font-family: var(--font-display); font-weight:700; font-size: 2.1rem; color: var(--sand-line);
  -webkit-text-stroke: 1px var(--brick); display:block; margin-bottom:6px;
}
.step h4{ font-family: var(--font-display); font-size:1.05rem; margin-bottom:.35em; }
.step p{ color: var(--ink-soft); font-size:.92rem; }

/* ---------- Sections on dark ---------- */
.section-dark{ background: var(--navy); color:#fff; }
.section-dark h2{ color:#fff; }
.section-dark p{ color:#D6DCCF; }

/* ---------- Permit/document styled box (thematic device) ---------- */
.doc-box{
  background:#fff; border:1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; position:relative;
}
.doc-box::before{
  content:'';
  position:absolute; top:0; left:24px; right:24px; height:1px; background: repeating-linear-gradient(90deg, var(--sand-line) 0 6px, transparent 6px 12px);
  top:auto; bottom:0;
}
.doc-box .tag{
  display:inline-block; font-family: var(--font-display); font-size:.72rem; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; background: var(--paper-2); color: var(--ink-soft);
  padding:4px 10px; border-radius:3px; margin-bottom:14px;
}
.doc-box + .doc-box{ margin-top:16px; }

/* ---------- Cost table ---------- */
table.cost-table{ width:100%; border-collapse: collapse; background:#fff; border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); }
table.cost-table th, table.cost-table td{ padding: 14px 18px; text-align:left; border-bottom:1px solid var(--line); font-size:.95rem; }
table.cost-table th{ background: var(--navy); color:#fff; font-family:var(--font-display); font-weight:600; font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; }
table.cost-table tr:last-child td{ border-bottom:none; }
table.cost-table td.range{ font-weight:700; color: var(--brick); white-space:nowrap; }
.table-note{ font-size:.85rem; color: var(--ink-soft); margin-top:10px; }

/* ---------- FAQ accordion ---------- */
.faq-item{ border-bottom:1px solid var(--line); }
.faq-item:first-child{ border-top:1px solid var(--line); }
.faq-q{
  width:100%; text-align:left; background:none; border:0; padding: 18px 4px; cursor:pointer;
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  font-family: var(--font-display); font-weight:600; font-size: 1.02rem; color: var(--ink);
}
.faq-q .plus{ flex-shrink:0; width:22px; height:22px; position:relative; }
.faq-q .plus::before, .faq-q .plus::after{ content:''; position:absolute; background: var(--brick); }
.faq-q .plus::before{ width:14px; height:2px; top:10px; left:4px; }
.faq-q .plus::after{ width:2px; height:14px; top:4px; left:10px; transition: transform .18s ease; }
.faq-item.open .plus::after{ transform: rotate(90deg); }
.faq-a{ max-height:0; overflow:hidden; transition: max-height .22s ease; }
.faq-item.open .faq-a{ max-height: 800px; }
.faq-a-inner{ padding: 0 4px 20px; color: var(--ink-soft); }

/* ---------- Form ---------- */
.form-card{ background:#fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
@media (max-width:600px){ .form-row{ grid-template-columns:1fr; } }
.field{ margin-bottom: 16px; }
.field label{ display:block; font-weight:600; font-size:.88rem; margin-bottom:6px; }
.field input, .field select, .field textarea{
  width:100%; padding: 12px 14px; border:1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: .98rem; background:#fefdfb;
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--brick); outline:none; }
.field-note{ font-size:.78rem; color: var(--ink-soft); margin-top:4px; }
.form-success{ display:none; text-align:center; padding: 40px 20px; }
.form-success.show{ display:block; }
.form-success svg{ width:48px; height:48px; color: var(--juniper); margin:0 auto 14px; }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta{
  position:fixed; left:0; right:0; bottom:0; z-index:60; background: var(--navy);
  padding: 12px 16px; display:none; box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}
.sticky-cta a{ display:block; }
@media (max-width: 760px){ .sticky-cta{ display:block; } body{ padding-bottom: 68px; } }

/* ---------- Footer ---------- */
.site-footer{ background: var(--navy-2); color:#C9D1C4; padding: 56px 0 28px; }
.footer-grid{ display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
.site-footer h4{ color:#fff; font-size:.85rem; text-transform:uppercase; letter-spacing:.06em; margin-bottom: 14px; }
.site-footer a{ color:#C9D1C4; display:block; padding: 5px 0; font-size:.92rem; }
.site-footer a:hover{ color:#fff; text-decoration:none; }
.footer-bottom{ margin-top: 44px; padding-top: 22px; border-top:1px solid rgba(255,255,255,.1); display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; font-size:.82rem; color:#93A08C; }

/* ---------- Utility ---------- */
.text-center{ text-align:center; }
.mt-0{ margin-top:0; } .mb-0{ margin-bottom:0; }
.max-prose{ max-width: 68ch; }
.center-col{ max-width: 780px; margin:0 auto; }
.badge-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.badge-list li{ display:flex; gap:10px; align-items:flex-start; font-size:.95rem; }
.badge-list svg{ width:18px; height:18px; flex-shrink:0; margin-top:3px; color: var(--juniper); }
.pill-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.pill{ background: var(--paper-2); border-radius: 20px; padding:5px 12px; font-size:.8rem; font-weight:600; color: var(--ink-soft); }
.callout{ background: var(--brick-tint); border-left:4px solid var(--brick); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; }
.callout p:last-child{ margin-bottom:0; }
.skip-link{ position:absolute; left:-999px; top:0; background:#fff; padding:10px 16px; z-index:100; }
.skip-link:focus{ left: 10px; top:10px; }
