/* ==== APEX Roofing — shared styles ==== */
:root {
  --white: #ffffff;
  --black: #171a20;
  --ink: #393c41;
  --mute: #5c5e62;
  --hairline: #d0d1d2;
  --panel: #f4f4f4;
  --panel-warm: #fafaf9;
  --accent: #3457dc;
  --accent-hover: #2a48c4;
  --danger: #d02b3f;
  --success: #1a8754;
  --nav-h: 56px;
  --ease: cubic-bezier(.5,.15,.25,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  color: var(--black);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==== Navigation ==== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  transition: background-color .3s var(--ease), color .3s var(--ease);
  color: var(--white);
}
.nav.solid { background: var(--white); color: var(--black); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.nav.always-solid { background: var(--white); color: var(--black); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.nav-logo { font-weight: 700; font-size: 20px; letter-spacing: .5px; }
.nav-logo a { color: inherit; }
.nav-links { display: none; gap: 4px; }
.nav-links a {
  padding: 6px 12px; font-size: 14px; font-weight: 500; border-radius: 6px;
  transition: background-color .2s var(--ease);
}
.nav-links a:hover { background: rgba(255,255,255,.1); }
.nav.solid .nav-links a:hover, .nav.always-solid .nav-links a:hover { background: rgba(0,0,0,.05); }
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-right a { padding: 6px 12px; font-size: 14px; font-weight: 500; border-radius: 6px; }
.nav-menu-btn { padding: 6px 12px; font-size: 14px; font-weight: 500; border-radius: 6px; }
.nav-menu-btn:hover { background: rgba(255,255,255,.1); }
.nav.solid .nav-menu-btn:hover, .nav.always-solid .nav-menu-btn:hover { background: rgba(0,0,0,.05); }
@media (min-width: 1100px) {
  .nav-links { display: flex; }
  .nav-menu-btn { display: none; }
}

/* ==== Drawer ==== */
.drawer {
  position: fixed; inset: 0;
  background: var(--white); color: var(--black);
  z-index: 200;
  transform: translateY(-100%);
  transition: transform .3s var(--ease);
  display: flex; flex-direction: column;
  padding: 0 20px;
}
.drawer.open { transform: translateY(0); }
.drawer-head { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { padding-top: 20px; overflow-y: auto; }
.drawer-body a {
  display: block; padding: 14px 0;
  font-size: 18px; font-weight: 500;
  border-bottom: 1px solid var(--hairline);
}

/* ==== Buttons ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 24px;
  border-radius: 20px;
  font-size: 14px; font-weight: 500; letter-spacing: .3px;
  min-width: 200px;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: rgba(23,26,32,.8); color: var(--white); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-primary:hover { background: rgba(23,26,32,.95); }
.btn-secondary { background: rgba(244,244,244,.65); color: var(--black); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-secondary:hover { background: rgba(244,244,244,.85); }
.btn-solid { background: var(--black); color: var(--white); }
.btn-solid:hover { background: #000; }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-hover); }

/* ==== Hero ==== */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: center;
  padding: calc(var(--nav-h) + 40px) 20px 40px;
  text-align: center; color: var(--white);
  overflow: hidden;
}
.hero.short { min-height: 70vh; min-height: 70dvh; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: -2;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.4) 0%, rgba(0,0,0,.1) 30%, rgba(0,0,0,.1) 70%, rgba(0,0,0,.4) 100%);
  z-index: -1;
}
.hero-top { max-width: 800px; margin-top: 20px; }
.hero-eyebrow { font-size: 13px; font-weight: 500; opacity: .9; margin-bottom: 12px; }
.hero-eyebrow a { text-decoration: underline; text-underline-offset: 3px; }
.hero h1 {
  font-size: clamp(34px, 6.5vw, 56px);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.05;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 400; opacity: .95;
  max-width: 560px; margin: 0 auto;
}
.hero-sub a { text-decoration: underline; text-underline-offset: 3px; }
.hero-bottom { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
@media (min-width: 700px) { .hero-bottom { flex-direction: row; max-width: none; justify-content: center; } }

/* ==== Full-bleed panels ==== */
.panel {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: center;
  padding: 80px 20px 40px;
  text-align: center; overflow: hidden;
}
.panel-light { background: var(--white); color: var(--black); }
.panel-dark { color: var(--white); }
.panel-dark::before {
  content: ''; position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: -2;
}
.panel-dark::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.3) 0%, transparent 30%, transparent 70%, rgba(0,0,0,.35) 100%);
  z-index: -1;
}
.panel h2 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 500; letter-spacing: -0.015em; line-height: 1.1;
  max-width: 800px;
}
.panel-sub {
  font-size: clamp(15px, 2vw, 17px);
  max-width: 600px; margin-top: 14px; opacity: .95;
}
.panel-top { max-width: 900px; }
.panel-bottom { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
@media (min-width: 700px) { .panel-bottom { flex-direction: row; max-width: none; justify-content: center; } }

/* ==== Content blocks (for interior pages) ==== */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px;
}
.content-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}
.content h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 500; letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.content h3 {
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 600;
  margin-top: 32px; margin-bottom: 12px;
}
.content p { color: var(--ink); margin-bottom: 16px; max-width: 65ch; }
.content ul, .content ol { margin: 12px 0 20px 24px; }
.content li { margin-bottom: 8px; color: var(--ink); }

.grid-3 {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  margin: 32px 0;
}
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.grid-2 {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  margin: 32px 0;
}
@media (min-width: 800px) { .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 48px; } }

.card {
  padding: 24px 0;
}
.card h4 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 15px; color: var(--mute); }

/* ==== Stats strip ==== */
.stats {
  background: var(--white);
  padding: 80px 20px;
  border-bottom: 1px solid var(--hairline);
}
.stats-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 40px;
  text-align: center;
}
@media (min-width: 700px) { .stats-inner { grid-template-columns: repeat(3, 1fr); } }
.stat-num {
  font-size: clamp(44px, 8vw, 64px);
  font-weight: 500; letter-spacing: -0.03em;
  line-height: 1; margin-bottom: 8px;
}
.stat-label { font-size: 15px; color: var(--mute); font-weight: 500; max-width: 260px; margin: 0 auto; }

/* ==== Split section (image + text side by side) ==== */
.split {
  display: grid; grid-template-columns: 1fr; gap: 0;
  min-height: 480px;
}
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.split-media {
  min-height: 320px;
  background-size: cover; background-position: center;
  background-color: var(--black);
  background-image: linear-gradient(135deg, #2a2d33 0%, #171a20 100%);
}
.split-media[style] {
  /* When an inline style sets a real background-image, use black as under-color */
  background-blend-mode: normal;
}
.split-body {
  padding: 60px 24px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--panel-warm);
}
.split-body h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 500; letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.split-body p { color: var(--ink); font-size: 16px; margin-bottom: 12px; max-width: 52ch; }
.split-body ul { margin: 16px 0 20px 20px; }
.split-body li { color: var(--ink); margin-bottom: 6px; }

/* ==== Forms ==== */
.form {
  max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.form label { font-size: 13px; font-weight: 500; color: var(--mute); margin-bottom: 4px; display: block; }
.form input, .form select, .form textarea {
  width: 100%;
  min-height: 48px; padding: 12px 20px;
  border: 1px solid var(--hairline); border-radius: 24px;
  background: var(--white); font: inherit; font-size: 15px;
  color: var(--black); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form textarea { min-height: 120px; border-radius: 16px; resize: vertical; font-family: inherit; }
.form select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235c5e62' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 20px center; padding-right: 44px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52,87,220,.15);
}
.form button[type=submit] {
  height: 48px; padding: 0 32px;
  background: var(--accent); color: var(--white);
  border-radius: 24px; font-size: 15px; font-weight: 500;
  transition: background-color .2s var(--ease);
  margin-top: 8px;
}
.form button[type=submit]:hover:not(:disabled) { background: var(--accent-hover); }
.form button[type=submit]:disabled { opacity: .6; cursor: wait; }
.form-msg { padding: 14px 20px; border-radius: 12px; font-size: 14px; }
.form-msg.success { background: #e8f5ed; color: var(--success); border: 1px solid #c8e6d0; }
.form-msg.error { background: #fdecee; color: var(--danger); border: 1px solid #f5c8ce; }

/* ==== Quote calculator ==== */
.calc {
  background: var(--panel-warm);
  padding: 60px 20px;
}
.calc-inner {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 40px;
}
@media (min-width: 900px) { .calc-inner { grid-template-columns: 1fr 1fr; gap: 60px; } }
.calc-form { display: flex; flex-direction: column; gap: 16px; }
.calc-form .field { display: flex; flex-direction: column; gap: 6px; }
.calc-form label { font-size: 13px; font-weight: 500; color: var(--mute); }
.calc-form input, .calc-form select {
  width: 100%; height: 48px; padding: 0 20px;
  border: 1px solid var(--hairline); border-radius: 24px;
  background: var(--white); font: inherit; font-size: 15px;
}
.calc-form select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235c5e62' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 20px center; padding-right: 44px; }
.calc-form input:focus, .calc-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,87,220,.15); }
.calc-check { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.calc-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.calc-check label { font-size: 14px; color: var(--ink); }

.calc-result {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  padding: 32px 28px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 320px;
}
.calc-range {
  font-size: clamp(30px, 5vw, 42px); font-weight: 500;
  letter-spacing: -0.02em; margin-bottom: 6px;
  color: var(--black);
}
.calc-per { font-size: 14px; color: var(--mute); margin-bottom: 24px; }
.calc-breakdown { border-top: 1px solid var(--hairline); padding-top: 20px; }
.calc-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--ink); }
.calc-line span:last-child { color: var(--mute); }
.calc-disclaimer { font-size: 12px; color: var(--mute); margin-top: 20px; line-height: 1.5; }

/* ==== FAQ ==== */
.faq-item {
  border-bottom: 1px solid var(--hairline);
  padding: 20px 0;
}
.faq-item summary {
  font-size: 17px; font-weight: 500;
  cursor: pointer; list-style: none;
  padding-right: 40px; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 0; top: 0;
  font-size: 24px; font-weight: 300; color: var(--mute);
  transition: transform .2s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 12px; color: var(--ink); }

/* ==== Big CTA section ==== */
.cta-band {
  background: var(--black); color: var(--white);
  padding: 80px 20px; text-align: center;
}
.cta-band h2 {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 500; letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.cta-band p { opacity: .8; margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-band .btn { display: inline-flex; }
.cta-band .btn-solid { background: var(--white); color: var(--black); }
.cta-band .btn-solid:hover { background: var(--panel); }

/* ==== Footer ==== */
footer {
  background: var(--white);
  padding: 60px 20px 100px;
  border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--mute);
}
@media (min-width: 900px) { footer { padding-bottom: 40px; } }
.footer-cols {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 24px;
  margin-bottom: 40px;
}
@media (min-width: 700px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--black); margin-bottom: 12px; }
.footer-col a { display: block; padding: 4px 0; transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--black); }
.footer-legal {
  max-width: 1200px; margin: 0 auto;
  padding-top: 20px; border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  font-size: 12px;
}

/* ==== Sticky mobile CTA ==== */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  display: flex; gap: 8px; z-index: 90;
}
.sticky-cta a {
  flex: 1; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; border-radius: 20px;
}
.sticky-cta .primary { background: var(--black); color: var(--white); }
.sticky-cta .secondary { background: var(--panel); color: var(--black); }
@media (min-width: 900px) { .sticky-cta { display: none; } }

/* ==== Simple text page (privacy, terms) ==== */
.doc { max-width: 720px; margin: 0 auto; padding: calc(var(--nav-h) + 40px) 20px 60px; }
.doc h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 500; margin-bottom: 8px; letter-spacing: -0.015em; }
.doc .doc-meta { color: var(--mute); font-size: 14px; margin-bottom: 32px; }
.doc h2 { font-size: 20px; font-weight: 600; margin-top: 32px; margin-bottom: 12px; }
.doc p { color: var(--ink); margin-bottom: 14px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
