/* ============================================
   A15 Carpentry - Post Frame Estimator
   Dark, modern-rustic, contractor-grade.
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-elev: #161616;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --border: #2a2a2a;
  --border-soft: #333333;
  --text: #f5f5f4;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #b91c1c;
  --accent-hi: #dc2626;
  --accent-dim: #7f1d1d;
  --gold: #d4a574;
  --success: #10b981;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-hi); }

img { max-width: 100%; display: block; }

/* ============ NAV ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.nav-brand img {
  height: 40px;
  width: auto;
  border-radius: 4px;
}
.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.nav-brand-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--accent-hi);
}
.nav-brand-tag {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-top: 3px;
}

.nav-links {
  margin-left: auto;
  display: none;
  gap: 28px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--accent-hi); }
.nav-links a.is-active {
  color: var(--accent-hi);
}

.nav-cta {
  display: none;
  background: var(--accent);
  color: #fff !important;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease;
}
.nav-cta:hover { background: var(--accent-hi); color: #fff !important; }

.nav-menu-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.mobile-nav-panel {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  background: var(--bg-2);
  flex-direction: column;
  gap: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
}
.mobile-nav-panel.is-open { display: flex; }
.mobile-nav-panel a { color: var(--text-muted); }
.mobile-nav-panel a.is-active { color: var(--accent-hi); }

@media (min-width: 900px) {
  .nav-menu-btn { display: none; }
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
}

/* ============ HERO ============ */
.hero {
  padding: 70px 20px 60px;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(185, 28, 28, 0.12), transparent 60%),
    radial-gradient(800px 400px at 90% 0%, rgba(212, 165, 116, 0.06), transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, #0f0f0f 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 18px;
  padding: 6px 14px;
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 999px;
  background: rgba(212, 165, 116, 0.05);
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
  margin-bottom: 18px;
  color: #fafaf9;
}
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-muted);
  margin: 0 auto 10px;
  max-width: 640px;
}
.hero-fine {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 28px;
}
.hero-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, background 0.15s ease;
}
.hero-cta:hover { background: var(--accent-hi); transform: translateY(-1px); color: #fff !important; }

/* ============ ESTIMATOR LAYOUT ============ */
.estimator-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 50px 20px;
}
.estimator-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .estimator-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 32px;
    align-items: start;
  }
  .results-col {
    position: sticky;
    top: 90px;
  }
}

/* ============ CARDS ============ */
.card {
  background: linear-gradient(180deg, #181818 0%, #141414 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.card-head {
  padding: 24px 26px 10px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.card-head p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ============ INPUTS ============ */
.inputs-card { padding-bottom: 14px; }

.est-section {
  border: 0;
  padding: 22px 26px 10px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.est-section:last-of-type { border-bottom: 0; }
.est-section legend {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0 0 14px;
}

.grid-2 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.grid-3 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  background: #0e0e0e;
  border: 1px solid var(--border-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.97rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field textarea { resize: vertical; min-height: 110px; }

.field select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%23a1a1aa' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.18);
}

.inputs-actions {
  display: flex;
  gap: 12px;
  padding: 22px 26px 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hi); color: #fff; transform: translateY(-1px); }
.btn-primary.full-width { width: 100%; margin-top: 18px; }
.btn-primary.btn-lg { padding: 16px 28px; font-size: 0.95rem; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

/* ============ RESULTS ============ */
.results-card {
  background: linear-gradient(180deg, #1b1b1b 0%, #141414 100%);
  border-color: var(--border-soft);
}
.results-head {
  text-align: center;
  padding: 28px 24px 22px;
  background: radial-gradient(600px 200px at 50% 0%, rgba(185, 28, 28, 0.15), transparent 70%);
}
.results-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 14px;
}
.results-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 900;
  color: #fafaf9;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.results-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 18px 24px 6px;
}
.results-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  gap: 14px;
}
.results-list li:last-child { border-bottom: 0; }
.results-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.results-value {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.results-disclaimer {
  margin: 12px 24px 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 14px 16px;
  background: #0e0e0e;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.results-card .full-width { margin: 18px 24px 24px; width: calc(100% - 48px); }

/* Subtle update pulse */
.results-value.pulse {
  animation: pulse 0.5s ease;
}
@keyframes pulse {
  0% { color: var(--gold); }
  100% { color: var(--text); }
}

/* ============ LEAD FORM ============ */
.lead-section {
  background: linear-gradient(180deg, #0c0c0c 0%, #0a0a0a 100%);
  padding: 70px 20px;
  border-top: 1px solid var(--border);
}
.lead-wrap {
  max-width: 880px;
  margin: 0 auto;
}
.lead-head { text-align: center; margin-bottom: 34px; }
.lead-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 12px;
}
.lead-head p {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.lead-form {
  background: linear-gradient(180deg, #181818 0%, #141414 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 18px;
}

.honeypot { position: absolute; left: -9999px; opacity: 0; }

.form-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.lead-fine {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  max-width: 420px;
  line-height: 1.5;
}

.lead-success {
  background: linear-gradient(180deg, #10241c 0%, #0d1a15 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.lead-success h3 { font-size: 1.4rem; color: #d1fae5; margin-bottom: 10px; }
.lead-success p { color: var(--text-muted); margin: 0; }
.lead-success a { color: var(--success); font-weight: 700; }

/* ============ SEO SECTION ============ */
.seo-section {
  padding: 70px 20px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.seo-wrap {
  max-width: 820px;
  margin: 0 auto;
}
.seo-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 20px;
  color: #fafaf9;
}
.seo-section p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 18px;
  font-size: 1rem;
}
.seo-section strong { color: var(--text); }
.seo-links {
  margin-top: 28px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.seo-links a { color: var(--gold); }
.seo-links a:hover { color: var(--accent-hi); }

/* ============ FOOTER ============ */
.site-footer {
  background: #050505;
  color: var(--text);
  padding: 56px 20px 44px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .footer-inner { grid-template-columns: 1.2fr 1fr 1.2fr; }
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.footer-brand img { height: 44px; width: auto; border-radius: 4px; }
.footer-brand h3 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-hi);
  margin: 0;
}
.site-footer p { color: var(--text-muted); line-height: 1.65; margin: 0 0 10px; }
.site-footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 14px;
  color: #fff;
}
.footer-stack { display: grid; gap: 10px; color: var(--text-muted); }
.footer-stack a:hover { color: var(--accent-hi); }
.footer-link {
  color: var(--accent-hi);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}
.footer-link:hover { color: #fca5a5; }
