/* === TOKENS === */
:root {
  --navy:    #1e3a5f;
  --sky:     #2b7cb5;
  --amber:   #d97706;
  --caliche: #c8b99a;
  --text:    #1c1c1c;
  --bg:      #f7f5f2;
  --max-w:   880px;
  --radius:  4px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); }
a:hover { color: var(--navy); }

/* === TYPOGRAPHY === */
h1, h2, h3 {
  font-family: 'Barlow Semi Condensed', sans-serif;
  line-height: 1.25; color: var(--navy);
}
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.4rem; color: var(--navy); }
p  { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; }
strong { font-weight: 600; }

/* === LAYOUT === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.content-area { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }

/* === SIGNATURE DEVICE: soil-layer section divider === */
.section-divider {
  border: none; height: 10px; margin: 2.5rem 0 2rem;
  background: linear-gradient(
    to bottom,
    #d97706 0%,   #d97706 40%,
    #c8b99a 40%,  #c8b99a 70%,
    #1e3a5f 70%,  #1e3a5f 100%
  );
}

/* === HEADER === */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem; max-width: var(--max-w); margin: 0 auto;
}
.logo {
  color: white; font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 1.2rem; font-weight: 700; text-decoration: none; line-height: 1.2;
}
.logo span { display: block; font-size: 0.7rem; font-weight: 400; opacity: .7; letter-spacing: .05em; }
.header-phone { color: var(--amber); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.header-phone:hover { color: white; }
.nav-toggle { display: none; background: none; border: none; color: white; font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 0 0.25rem; }

/* === NAV === */
.site-nav { background: rgba(0,0,0,.22); }
.nav-list { display: flex; list-style: none; max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; flex-wrap: wrap; }
.nav-list > li > a { display: block; padding: 0.55rem 0.9rem; color: rgba(255,255,255,.85); text-decoration: none; font-size: 0.88rem; white-space: nowrap; }
.nav-list > li > a:hover { color: white; }
.nav-cta > a { background: var(--amber); color: white !important; border-radius: var(--radius); margin: 0.3rem 0.4rem; padding: 0.4rem 1rem !important; }
.nav-cta > a:hover { background: #b45309 !important; }

/* === HERO === */
.hero { position: relative; height: 480px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(30,58,95,.88) 0%, rgba(30,58,95,.55) 55%, rgba(30,58,95,.15) 100%);
  display: flex; align-items: center;
}
.hero-content { padding: 0 2rem; max-width: 580px; }
.hero h1 { color: white; margin-bottom: 0.5rem; }
.hero-sub { color: rgba(255,255,255,.85); margin-bottom: 1.25rem; font-size: 1.05rem; }
.btn-cta {
  display: inline-block; background: var(--amber); color: white;
  padding: 0.8rem 1.75rem; border-radius: var(--radius);
  font-family: 'Barlow Semi Condensed', sans-serif; font-size: 1.1rem; font-weight: 700;
  text-decoration: none;
}
.btn-cta:hover { background: #b45309; color: white; }

/* === PAGE HEADER (non-home) === */
.page-header { background: var(--navy); padding: 2.75rem 1.25rem 2.25rem; }
.page-header h1 { color: white; max-width: var(--max-w); margin: 0 auto; }

/* === SUPPORTING IMAGE === */
.page-image { width: 100%; max-height: 360px; object-fit: cover; object-position: center; }

/* === SECTION SUBHEAD (bold heading within body) === */
p.subhead { font-weight: 700; color: var(--navy); margin-bottom: 0.25rem; font-size: 1rem; }

/* === TABLE === */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th { background: var(--navy); color: white; padding: 0.6rem 0.85rem; text-align: left; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 0.95rem; }
td { padding: 0.6rem 0.85rem; border-bottom: 1px solid #ddd; }
tr:nth-child(even) td { background: #edeae5; }

/* === FAQ ACCORDION === */
.faq-section { margin-top: 0.5rem; }
.faq-item { border-bottom: 1px solid #d4cfc8; }
.faq-item summary {
  padding: 1rem 0; cursor: pointer; font-weight: 600; color: var(--navy);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; color: var(--amber); flex-shrink: 0; }
.faq-item[open] summary::after { content: '2'; }
.faq-item p { padding: 0 0 1rem; }

/* === GAUGE === */
.gauge-wrapper { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 1.75rem; margin: 1.5rem 0; }
.gauge-controls { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.gauge-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 0.35rem; }
.gauge-field select, .gauge-field input[type=range] { width: 100%; }
.gauge-field select { padding: 0.5rem; border: 1px solid #ccc; border-radius: var(--radius); font-family: 'Barlow', sans-serif; }
.gauge-field input[type=range] { accent-color: var(--amber); }
.gauge-svg-wrap { display: flex; justify-content: center; }
.gauge-svg-wrap svg { max-width: 220px; }
.gauge-verdict {
  border-left: 4px solid var(--amber); padding: 0.75rem 1rem;
  background: var(--bg); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem; margin-top: 0.75rem;
}
.gauge-cta { text-align: center; margin-top: 1.25rem; }

/* === QUOTE FORM === */
.quote-form { background: white; border: 1px solid #ddd; border-radius: 6px; padding: 2rem; margin-top: 1.5rem; }
.quote-form .form-title { font-family: 'Barlow Semi Condensed', sans-serif; font-size: 1.35rem; color: var(--navy); margin-bottom: 1.25rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.3rem; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid #bbb; border-radius: var(--radius);
  font-family: 'Barlow', sans-serif; font-size: 1rem;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-submit {
  width: 100%; padding: 0.8rem; border: none; border-radius: var(--radius); cursor: pointer;
  background: var(--amber); color: white;
  font-family: 'Barlow Semi Condensed', sans-serif; font-size: 1.1rem; font-weight: 700;
}
.form-submit:hover { background: #b45309; }
.form-submit:disabled { opacity: .65; cursor: not-allowed; }
.form-msg { margin-top: 0.85rem; padding: 0.75rem; border-radius: var(--radius); display: none; font-size: 0.95rem; }
.form-msg.success { background: #d1fae5; color: #065f46; display: block; }
.form-msg.error   { background: #fee2e2; color: #991b1b; display: block; }

/* === FOOTER === */
.site-footer { background: var(--navy); color: rgba(255,255,255,.8); padding: 3rem 1.25rem 1rem; margin-top: 3rem; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 2rem; max-width: var(--max-w); margin: 0 auto 2rem;
}
.footer-col strong { color: white; display: block; margin-bottom: 0.6rem; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.3rem; }
.footer-col a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 0.875rem; }
.footer-col a:hover { color: white; }
.footer-col p { font-size: 0.875rem; margin-bottom: 0.4rem; }
.footer-phone { color: var(--amber) !important; font-weight: 700 !important; font-size: 1rem !important; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.1rem;
  text-align: center; font-size: 0.8rem; color: rgba(255,255,255,.45);
  max-width: var(--max-w); margin: 0 auto;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; padding: 0.5rem 0; }
  .nav-list > li > a { padding: 0.7rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-cta > a { margin: 0.5rem 1.5rem; display: block; text-align: center; }
  .hero { height: 340px; }
  .hero-content { padding: 0 1.25rem; }
  .gauge-controls { grid-template-columns: 1fr; }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
  :root { --bg: #111827; --text: #e5e7eb; }
  .quote-form, .gauge-wrapper { background: #1f2937; border-color: #374151; }
  .gauge-field label { color: white; }
  .form-row input, .form-row select, .form-row textarea { background: #111827; border-color: #374151; color: var(--text); }
  td { border-color: #374151; }
  tr:nth-child(even) td { background: #1f2937; }
  .faq-item { border-color: #374151; }
  .gauge-verdict { background: #1f2937; }
  h2, h3 { color: #93c5fd; }
  .page-header h1, .hero h1, .footer-col strong { color: white; }
  .faq-item summary { color: #93c5fd; }
}
