/*
 * Custom stylesheet for Waypoint Engineering.
 * This file defines the core layout, typography and color palette for the site.
 */

/* CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background-color: #f8fafc;
}

/* Color palette */
:root {
  --primary: #1d4ed8; /* Blue accent */
  --primary-dark: #1e40af;
  --secondary: #f59e0b; /* Amber accent */
  --text-dark: #1f2937;
  --text-light: #f8fafc;
  --muted: #6b7280;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.05);
}

/* Global containers */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Navigation */
nav {
  background-color: var(--primary);
  padding: 1rem 0;
  /* Stick the navigation to the top of the viewport so it remains visible when
     scrolling. This improves usability on long pages and mirrors the feel of
     larger engineering firm websites. */
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  /* Adjust font size and spacing for longer company name */
  font-size: 1.25rem;
  color: var(--text-light);
  font-weight: bold;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}

nav ul li a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

nav ul li a:hover {
  opacity: 0.8;
}

/* Hero Section */
.hero {
  position: relative;
  height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-light);
  text-align: center;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero h1 {
  font-size: 3rem;
  z-index: 1;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  z-index: 1;
  margin-bottom: 2rem;
}

.hero .cta-button {
  z-index: 1;
  padding: 0.75rem 1.5rem;
  background-color: var(--secondary);
  color: var(--text-dark);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s;
}

.hero .cta-button:hover {
  background-color: #d97706;
}

/* Hero video section for the home page */
.hero-video {
  position: relative;
  height: 70vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-light);
  text-align: center;
}

.hero-video video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-video::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.hero-video h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-video p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.hero-video .cta-button {
  padding: 0.75rem 1.5rem;
  background-color: var(--secondary);
  color: var(--text-dark);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s;
}

.hero-video .cta-button:hover {
  background-color: #d97706;
}

/* Section styles */
section {
  padding: 4rem 0;
}

section h2 {
  margin-bottom: 2rem;
  font-size: 2.25rem;
  color: var(--primary-dark);
  text-align: center;
}

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

.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--card-shadow);
  padding: 2rem;
  text-align: center;
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--primary);
  font-size: 1.5rem;
}

.card p {
  color: var(--muted);
}

/* Footer */
footer {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 2rem 0;
  text-align: center;
}

footer p {
  margin-bottom: 0.5rem;
}

footer .footer-links {
  margin-top: 1rem;
}

footer .footer-links a {
  color: var(--text-light);
  margin: 0 0.5rem;
  text-decoration: none;
  font-weight: 500;
}

footer .footer-links a:hover {
  text-decoration: underline;
}

/* Service Details */
.service-list {
  margin: 0 auto;
  max-width: 900px;
}

.service-item {
  margin-bottom: 2rem;
}

.service-item h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.service-item p {
  color: var(--muted);
}

/* Portfolio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.portfolio-item {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--card-shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-item img {
  max-width: 100%;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.portfolio-item h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.portfolio-item p {
  color: var(--muted);
  flex-grow: 1;
}

/* About page */
.about-content {
  max-width: 900px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.8;
}

.about-content h3 {
  color: var(--primary);
  margin-top: 1.5rem;
}

/* Contact page */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  font-weight: bold;
  color: var(--primary-dark);
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 1rem;
}

.contact-form textarea {
  resize: vertical;
  height: 150px;
}

.contact-form button {
  align-self: flex-start;
  background-color: var(--primary);
  color: var(--text-light);
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.contact-form button:hover {
  background-color: var(--primary-dark);
}