/* ============================================
   MAINE PROROOFING — Design Tokens & Styles
   Dark Slate + Bold Green
   ============================================ */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ========== LIGHT MODE (Dark Slate + Bold Green) ========== */
:root, [data-theme="light"] {
  /* Surfaces — cool slate-tinted whites */
  --color-bg:             #f5f6f7;
  --color-surface:        #ffffff;
  --color-surface-2:      #f0f2f4;
  --color-surface-offset: #e8ebed;
  --color-divider:        #d1d5db;
  --color-border:         #c4c9d0;

  /* Text — dark slate tones */
  --color-text:           #1e2a36;
  --color-text-muted:     #5a6a78;
  --color-text-faint:     #94a3b3;
  --color-text-inverse:   #f5f6f7;

  /* Primary — Bold Green */
  --color-primary:        #1a8b3f;
  --color-primary-hover:  #157032;
  --color-primary-active: #0f5726;
  --color-primary-light:  #e6f5ec;

  /* Dark Slate (for hero/sections) */
  --color-slate:          #1e2a36;
  --color-slate-light:    #2c3e50;
  --color-slate-dark:     #141d26;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(30,42,54,0.06);
  --shadow-md: 0 4px 12px rgba(30,42,54,0.08);
  --shadow-lg: 0 12px 32px rgba(30,42,54,0.12);
}

/* ========== DARK MODE ========== */
[data-theme="dark"] {
  --color-bg:             #0f1519;
  --color-surface:        #1a2330;
  --color-surface-2:      #1e2937;
  --color-surface-offset: #16202b;
  --color-divider:        #2a3644;
  --color-border:         #344252;

  --color-text:           #d8dee6;
  --color-text-muted:     #8899aa;
  --color-text-faint:     #566778;
  --color-text-inverse:   #0f1519;

  --color-primary:        #3bb564;
  --color-primary-hover:  #2fa055;
  --color-primary-active: #249647;
  --color-primary-light:  rgba(59,181,100,0.12);

  --color-slate:          #0f1519;
  --color-slate-light:    #1a2330;
  --color-slate-dark:     #0a0f13;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0f1519;
    --color-surface:        #1a2330;
    --color-surface-2:      #1e2937;
    --color-surface-offset: #16202b;
    --color-divider:        #2a3644;
    --color-border:         #344252;
    --color-text:           #d8dee6;
    --color-text-muted:     #8899aa;
    --color-text-faint:     #566778;
    --color-text-inverse:   #0f1519;
    --color-primary:        #3bb564;
    --color-primary-hover:  #2fa055;
    --color-primary-active: #249647;
    --color-primary-light:  rgba(59,181,100,0.12);
    --color-slate:          #0f1519;
    --color-slate-light:    #1a2330;
    --color-slate-dark:     #0a0f13;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
  }
}

/* ========== LAYOUT ========== */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section-padding {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

/* ========== HEADER / NAV ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-slate) 95%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: box-shadow 0.3s ease;
}

.header--scrolled {
  box-shadow: var(--shadow-md);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  gap: var(--space-4);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: #ffffff;
  flex-shrink: 0;
}

.logo svg {
  width: 42px;
  height: 42px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--color-primary);
}

[data-theme="dark"] .logo-text span,
:root:not([data-theme]) .logo-text span {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition-interactive);
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: #ffffff !important;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background var(--transition-interactive), transform var(--transition-interactive);
}

.nav-cta:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.theme-toggle {
  color: rgba(255,255,255,0.7);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
}

/* Mobile nav */
.mobile-menu-btn {
  display: none;
  color: #ffffff;
  padding: var(--space-2);
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-slate);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-cta { width: 100%; justify-content: center; }
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--color-slate-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(20,29,38,0.92) 0%,
    rgba(30,42,54,0.75) 50%,
    rgba(20,29,38,0.6) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding-block: var(--space-20);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background: rgba(26,139,63,0.15);
  border: 1px solid rgba(26,139,63,0.3);
  border-radius: var(--radius-full);
  color: #3bb564;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-6);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}

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

[data-theme="dark"] .hero h1 .accent {
  color: #3bb564;
}

.hero-description {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.75);
  margin-bottom: var(--space-8);
  max-width: 560px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: all var(--transition-interactive);
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(26,139,63,0.3);
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: #ffffff;
  background: rgba(255,255,255,0.08);
}

/* ========== TRUST BAR ========== */
.trust-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}

.trust-bar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(var(--space-6), 4vw, var(--space-16));
  padding-block: var(--space-6);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.trust-item svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ========== SERVICES ========== */
.services {
  background: var(--color-bg);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-inline: auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  color: var(--color-primary);
}

.service-icon svg {
  width: 26px;
  height: 26px;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.service-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ========== ABOUT / SPLIT SECTION ========== */
.about {
  background: var(--color-surface-2);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: center;
}

.split-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.split-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.split-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.split-content p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

.stats-row {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.stat {
  text-align: left;
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split-image { order: -1; }
  .stats-row { gap: var(--space-6); }
}

/* ========== GALLERY / FULL BLEED ========== */
.gallery {
  position: relative;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(20,29,38,0.85) 0%,
    rgba(20,29,38,0.4) 50%,
    transparent 100%
  );
  display: flex;
  align-items: center;
}

.gallery-content {
  padding-inline: clamp(var(--space-6), 6vw, var(--space-16));
  max-width: 560px;
}

.gallery-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.gallery-content p {
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* ========== WHY CHOOSE US ========== */
.why-us {
  background: var(--color-slate);
  color: #ffffff;
}

.why-us .section-label {
  color: #3bb564;
}

.why-us .section-header h2 {
  color: #ffffff;
}

.why-us .section-header p {
  color: rgba(255,255,255,0.65);
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.reason-card {
  padding: var(--space-6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  transition: background var(--transition-interactive);
}

.reason-card:hover {
  background: rgba(255,255,255,0.08);
}

.reason-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: rgba(59,181,100,0.25);
  line-height: 1;
  margin-bottom: var(--space-3);
}

.reason-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.reason-card p {
  color: rgba(255,255,255,0.6);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ========== TESTIMONIALS ========== */
.testimonials {
  background: var(--color-bg);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
}

.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-4);
  color: #f59e0b;
}

.testimonial-stars svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.testimonial-card blockquote {
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  font-style: italic;
}

.testimonial-author {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.testimonial-location {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ========== CTA SECTION ========== */
.cta-section {
  background: linear-gradient(135deg, var(--color-primary-active) 0%, var(--color-primary) 100%);
  text-align: center;
  color: #ffffff;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.cta-section p {
  color: rgba(255,255,255,0.85);
  margin-inline: auto;
  margin-bottom: var(--space-8);
  max-width: 480px;
}

.cta-phone {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  transition: transform var(--transition-interactive);
}

.cta-phone:hover {
  transform: scale(1.03);
}

.cta-phone svg {
  width: 28px;
  height: 28px;
}

.cta-subtext {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
}

/* ========== FOOTER ========== */
.footer {
  background: var(--color-slate-dark);
  color: rgba(255,255,255,0.6);
  padding-block: var(--space-12) var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.footer-brand p {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.7;
  max-width: 320px;
}

.footer h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: #ffffff;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--transition-interactive);
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-contact-item a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.footer-contact-item a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
}

.footer-bottom a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.footer-bottom a:hover {
  color: rgba(255,255,255,0.8);
}

.footer-credits {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}

.footer-credits span {
  color: rgba(255,255,255,0.25);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }
  .footer-credits {
    justify-content: center;
  }
}

/* ========== ANIMATIONS ========== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
