/*
  Knox Paving & Surface Solutions
  Custom stylesheet for the updated site.  The palette is inspired by
  deep blues and asphalt greys with bright accents.  Typography and
  spacing are tuned for readability across desktops and phones.
*/

/* Reset and base rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background-color: #0a1a2d;
  color: #f5faff;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Utility classes */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary {
  background-color: #3a64ff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #2f55d4;
  box-shadow: 0 4px 12px rgba(58, 100, 255, 0.3);
}

.btn-outline {
  border: 2px solid #3a64ff;
  color: #3a64ff;
}

.btn-outline:hover {
  background-color: #3a64ff;
  color: #fff;
}

/* Hero section */
.hero {
  position: relative;
  min-height: 100vh;
  background-image: url('images/asphalt_paving.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(6, 15, 30, 0.8), rgba(6, 15, 30, 0.8));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 0 1.5rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

@media (min-width: 600px) {
  .hero-content h1 {
    font-size: 3.5rem;
  }
}

.hero-content .subtitle {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #d2dcf0;
  font-weight: 300;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Navigation */
.main-nav {
  position: sticky;
  top: 0;
  background-color: #0c223f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.main-nav ul {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0.5rem;
}

.main-nav li {
  margin: 0 1rem;
}

.main-nav a {
  font-weight: 500;
  color: #d2dcf0;
  padding: 0.5rem;
  transition: color 0.3s;
}

.main-nav a:hover {
  color: #fff;
}

/* Section layout */
.section {
  padding: 4rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.section-intro {
  font-size: 1rem;
  color: #a9b9d1;
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Services cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.service-card {
  position: relative;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* Use CSS variable for background image */
  background-image: var(--bg);
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(10, 26, 45, 0.9), rgba(10, 26, 45, 0.3));
  transition: opacity 0.3s ease;
  z-index: 0;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.service-card:hover::before {
  opacity: 0.7;
}

.service-card h3 {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.service-card p {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  color: #c7d6ed;
}

/* Timeline */
.process-section .timeline {
  position: relative;
  margin-left: 2rem;
  border-left: 2px solid #3a64ff;
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-step .circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3a64ff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  margin-right: 1rem;
  box-shadow: 0 0 0 4px #0a1a2d;
}

.timeline-step .step-content h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #dbe5fa;
}

.timeline-step .step-content ul {
  list-style: disc;
  padding-left: 1rem;
  color: #a9b9d1;
  font-size: 0.9rem;
}

/* Contact section */
.contact-section {
  background-image: url('images/striping.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(10, 26, 45, 0.9);
}

.contact-section .section-title,
.contact-section .section-intro,
.contact-section .contact-form {
  position: relative;
  z-index: 1;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group.full {
  width: 100%;
}

.contact-form label {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: #c7d6ed;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  padding: 0.75rem;
  border: 1px solid #37568f;
  border-radius: 4px;
  background: #12284c;
  color: #dbe5fa;
  font-size: 0.95rem;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: #3a64ff;
  box-shadow: 0 0 0 3px rgba(58, 100, 255, 0.3);
}

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

/* Footer */
.footer {
  background-color: #0c223f;
  color: #8fa6c6;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .timeline-step .circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}