/* DIY Project Calc — Design System */
/* Matches Dakota Contractor Pros identity */
:root {
  --primary: #111827;
  --primary-hover: #0f172a;
  --accent: #c9a66b;
  --accent-hover: #b8954f;
  --accent-soft: #f4ead8;
  --surface: #ffffff;
  --surface-alt: #f7f4ee;
  --border: #ded8cc;
  --text-primary: #111827;
  --text-secondary: #5f6470;
  --background: #ffffff;
  --foreground: #111827;
  --muted-foreground: #5f6470;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.06);
  --container: 1100px;
  --container-sm: 800px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --hero-start: #111827;
  --hero-end: #17365d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--surface-alt);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* Header */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  height: 64px;
  box-shadow: 0 1px 8px rgba(15,23,42,0.06);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.logo .logo-brand, .logo span:first-child { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 0.25rem; }

.nav a {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav a:hover { color: var(--primary); background: var(--surface-alt); }

.nav-toggle {
  display: none;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  border-radius: var(--radius);
}

.nav-toggle:hover { background: var(--surface-alt); }

/* Main */
main { flex: 1; padding-top: 64px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--accent); }

.hero .subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 0.75rem;
}

.hero .desc {
  font-size: 1rem;
  opacity: 0.8;
  max-width: 42rem;
  margin: 0 auto;
}

/* Calculator Grid */
.calc-grid-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calc-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.calc-card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.2s;
}

.calc-card:hover h2 { color: var(--primary); }

.calc-card p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.625;
  flex: 1;
}

.calc-card .btn {
  margin-top: 1rem;
  align-self: flex-start;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-accent {
  background: var(--accent);
  color: var(--primary);
}

.btn-accent:hover { background: var(--accent-hover); }

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--accent-soft); }

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

/* Calculator Page Layout */
.calc-page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.calc-page h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.calc-page h1 span { color: var(--primary); }

.calc-page .page-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 42rem;
  font-size: 1.05rem;
}

/* Calculator Form */
.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.calc-form h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group .unit {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

/* Results — now outside the calc form, appears below products */
.results {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.results h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.result-item .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.result-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Result Bar */
.results-bar {
  margin-top: 2.5rem;
}
.result-bar-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.result-bar-grid .result-item {
  flex: 1;
  min-width: 160px;
  max-width: 250px;
}

/* CTA Bar */
.cta-bar {
  margin-top: 2.5rem;
  padding: 2rem 2rem;
  background: var(--primary);
  border-radius: var(--radius-lg);
}
.cta-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cta-bar-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.25rem;
}
.cta-bar-content p {
  color: rgba(255,255,255,0.8);
  font-size: 0.9375rem;
}
.cta-bar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cta-bar-actions .btn-secondary {
  background: white;
  color: var(--primary);
  border: none;
}

/* Product Section — positioned between calculator and results */
.product-section {
  margin-top: 1.5rem;
}

.product-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.product-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.product-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.product-card .product-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.product-card .btn {
  width: 100%;
  margin-top: 0.25rem;
}

.affiliate-line {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
}

/* CTA Section */
.cta-section {
  background: var(--primary);
  color: white;
  padding: 3.5rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
}

.cta-inner { max-width: var(--container-sm); margin: 0 auto; }

.cta-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cta-section p {
  opacity: 0.85;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.cta-section .btn-secondary {
  background: white;
  color: var(--primary);
  border: none;
}

.cta-section .btn-secondary:hover { background: var(--accent-soft); }

/* Content Callouts */
.content-callouts {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.content-callouts h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.callout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.callout-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.callout-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.callout-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.625;
  margin-bottom: 0.75rem;
}

.callout-card .read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.callout-card .read-more:hover { color: var(--accent-hover); }

/* Affiliate disclaimer */
.affiliate-disclaimer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Footer */
.footer {
  background: var(--primary);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer p, .footer a {
  color: rgba(255,255,255,0.7);
  font-size: 0.8125rem;
}

.footer a { text-decoration: none; margin: 0 0.5rem; }
.footer a:hover { color: white; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-primary); }

/* Responsive */
@media (min-width: 640px) {
  .calc-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .calc-card { padding: 1.5rem; }
  .hero { padding: 5rem 1.5rem; }
  .calc-form { padding: 2rem; }
}

@media (min-width: 768px) {
  .calc-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .calc-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .nav-toggle { display: none; }
  .nav { display: flex !important; }
}

@media (max-width: 1023px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
    box-shadow: var(--shadow);
  }
  .nav a {
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 639px) {
  .calc-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .calc-page { padding: 1.5rem 1rem; }
  .header { height: 56px; }
  main { padding-top: 56px; }
}
