/* =====================================================
   BUILDERS OF HAMPTON ROADS — Design Tokens & Styles
   Bold & Modern / Dark-dominant / Amber accent
   ===================================================== */

/* --- Type Scale (Fluid) --- */
:root {
  --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 (4px system) --- */
  --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;

  /* --- Fonts --- */
  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  /* --- 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);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

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

/* --- Color: Dark Mode Default (Bold & Modern) --- */
:root, [data-theme="dark"] {
  --color-bg:             #0f0e0d;
  --color-surface:        #1a1816;
  --color-surface-2:      #211e1b;
  --color-surface-offset: #1c1917;
  --color-surface-dynamic: #282420;
  --color-divider:        #302b26;
  --color-border:         #3a3530;

  --color-text:           #ededed;
  --color-text-muted:     #8a8580;
  --color-text-faint:     #5a5550;
  --color-text-inverse:   #0f0e0d;

  /* Rust Red/Copper accent — from logo */
  --color-primary:        #a63c2e;
  --color-primary-hover:  #c04838;
  --color-primary-active: #8a3025;
  --color-primary-highlight: #2d1c18;

  --color-error:          #d44040;
  --color-success:        #4aa040;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

/* --- Light Mode --- */
[data-theme="light"] {
  --color-bg:             #f5f2ef;
  --color-surface:        #ffffff;
  --color-surface-2:      #faf9f7;
  --color-surface-offset: #ede9e4;
  --color-surface-dynamic: #e0dbd5;
  --color-divider:        #d5d0ca;
  --color-border:         #c5c0b8;

  --color-text:           #1a1614;
  --color-text-muted:     #6b6560;
  --color-text-faint:     #a8a29e;
  --color-text-inverse:   #f5f2ef;

  /* Rust Red/Copper accent — from logo */
  --color-primary:        #8b3325;
  --color-primary-hover:  #722a1e;
  --color-primary-active: #5e2118;
  --color-primary-highlight: #f0ddd6;

  --color-error:          #c03030;
  --color-success:        #3a8a30;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 40 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 40 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 40 / 0.12);
}

/* =====================================================
   LAYOUT & COMPONENTS
   ===================================================== */

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

/* --- Header / Nav --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--space-4) var(--space-6);
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.header--scrolled {
  box-shadow: 0 1px 0 oklch(from var(--color-text) l c h / 0.08);
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.logo-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.logo-text span {
  color: var(--color-primary);
}

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.nav a:hover { color: var(--color-text); }

.nav-cta {
  background: var(--color-primary) !important;
  color: var(--color-text-inverse) !important;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: background var(--transition-interactive), transform var(--transition-interactive) !important;
}
.nav-cta:hover {
  background: var(--color-primary-hover) !important;
  transform: translateY(-1px);
}
.nav-cta:active { transform: translateY(0); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: var(--space-32) var(--space-6) var(--space-16);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    oklch(0.05 0 0 / 0.95) 0%,
    oklch(0.05 0 0 / 0.7) 40%,
    oklch(0.05 0 0 / 0.3) 100%
  );
}
[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    to top,
    oklch(0.95 0 0 / 0.92) 0%,
    oklch(0.95 0 0 / 0.6) 40%,
    oklch(0.95 0 0 / 0.15) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-wide);
  margin: 0 auto;
  width: 100%;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
}
.hero-tag::before {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--color-primary);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.95;
  max-width: 14ch;
  margin-bottom: var(--space-6);
}
.hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-bottom: var(--space-8);
}
.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              transform var(--transition-interactive),
              box-shadow var(--transition-interactive);
}
.btn:active { transform: translateY(0) !important; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

/* --- Section shared --- */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-32)) var(--space-6);
}
.section-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-bottom: var(--space-12);
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-10) var(--space-6);
}
.stats-grid {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* --- Services --- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
.service-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  display: flex;
  align-items: flex-end;
}
.service-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.service-card:hover img {
  transform: scale(1.04);
}
.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    oklch(0.05 0 0 / 0.9) 0%,
    oklch(0.05 0 0 / 0.2) 70%,
    transparent 100%
  );
}
.service-card-content {
  position: relative;
  z-index: 1;
  padding: var(--space-6);
  width: 100%;
}
.service-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: #ededed;
  margin-bottom: var(--space-2);
}
.service-card p {
  font-size: var(--text-sm);
  color: #aaaaaa;
  max-width: 40ch;
}

/* --- About / Split Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}
.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-text h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}
.about-text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.about-text p:last-of-type {
  margin-bottom: var(--space-6);
}
.values-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.values-list li {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.values-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* --- Process --- */
.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  counter-reset: process;
}
.process-step {
  counter-increment: process;
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}
.process-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  flex-shrink: 0;
  min-width: 60px;
}
.process-step h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.process-step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 50ch;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
.testimonial-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}
.testimonial-stars {
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  font-size: var(--text-lg);
  letter-spacing: 0.1em;
}
.testimonial-card blockquote {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  font-style: italic;
}
.testimonial-author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.testimonial-location {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- CTA Section --- */
.cta-section {
  background: var(--color-surface);
  text-align: left;
}
.cta-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}
.cta-section .section-title {
  margin-bottom: var(--space-3);
}
.cta-section .section-subtitle {
  margin-bottom: var(--space-6);
}
.cta-contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cta-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.cta-contact-item i {
  color: var(--color-primary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.form-group label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-12) var(--space-6) var(--space-8);
}
.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}
.footer-brand .logo {
  margin-bottom: var(--space-4);
}
.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 35ch;
}
.footer-links h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-links a:hover { color: var(--color-text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}
.footer-bottom p, .footer-bottom a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-bottom a {
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-bottom a:hover { color: var(--color-text-muted); }

/* --- Scroll Animations --- */
.fade-in { opacity: 1; }

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    transition: opacity 0.6s var(--ease-out);
  }
  .fade-in.is-visible {
    opacity: 1;
  }
}

/* =====================================================
   RESPONSIVE BREAKPOINTS
   ===================================================== */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .services-grid .service-card:first-child {
    grid-column: span 2;
    aspect-ratio: 21/9;
  }
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cta-inner {
    grid-template-columns: 1fr 1fr;
  }
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  .footer-top {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .services-grid .service-card:first-child {
    grid-column: span 2;
    aspect-ratio: auto;
  }
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .process-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .process-step {
    flex-direction: column;
    gap: var(--space-4);
  }
}

/* Mobile-only (below 768px) */
@media (max-width: 767px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }

  .nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 60;
    justify-content: center;
    align-items: center;
    gap: var(--space-8);
  }
  .nav.is-open a {
    font-size: var(--text-xl);
    color: var(--color-text);
  }
  .nav.is-open .nav-cta {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-8);
  }
  .nav-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-6);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
  }

  .hero h1 { font-size: var(--text-3xl); }
  .hero p { font-size: var(--text-base); }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}
