/*
 * Custom stylesheet for the Stay Ready website.
 * Designed to evoke a high‑end, trustworthy feel with organic colours that
 * complement the Stay Ready logo. The layout is responsive and aims
 * to deliver a clean, Scandinavian aesthetic inspired by sites like
 * polestar.com and sectoralarm.no. Elements such as cards, hero
 * banners and forms are tailored for clarity and ease of use.
 */

/* CSS custom properties for colour palette and typography */
:root {
  /* Refreshed colour palette: deep blues paired with warm tan, inspired by high‑end interiors */
  --primary-color: #0e3241;      /* dark blue for headings and primary elements */
  --secondary-color: #6b94b3;    /* cool grey‑blue for secondary accents */
  --accent-color: #c19a6b;       /* warm tan for buttons and highlights */
  --background-color: #f5f1ea;   /* light beige for page background */
  --surface-color: #ffffff;      /* pure white for cards and sections */
  --text-color: #2a2a2a;         /* almost black for main text */
  --muted-text: #666666;         /* muted grey for secondary text */
  --border-radius: 12px;         /* increased radius for softer edges */
  --transition-speed: 0.3s;
  --font-family: "Inter", "Segoe UI", "Roboto", sans-serif;

  /* Section backgrounds for subtle alternation */
  --section-alt-bg: #efeae3;    /* gentle beige for alternating sections */

  /* Card shadow for deeper depth */
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Reset and box sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
}

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

/* Header and navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--surface-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

nav .logo img {
  height: 36px;
  width: auto;
}

nav .logo span {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

/* Toggle button for mobile navigation */
nav .nav-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.6rem;
  color: var(--primary-color);
  cursor: pointer;
}

nav ul li a {
  text-decoration: none;
  font-weight: 500;
  color: var(--primary-color);
  transition: color var(--transition-speed);
}

nav ul li a.active {
  color: var(--accent-color);
  font-weight: 600;
}

nav ul li a:hover,
nav ul li a:focus {
  color: var(--accent-color);
}

/* Utility classes for buttons */
.btn {
  display: inline-block;
  background-color: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: background-color var(--transition-speed);
}

.btn:hover,
.btn:focus {
  /* slightly darker tone of the accent colour for hover state */
  background-color: #987856;
}

/* Hero section */
.hero {
  position: relative;
  width: 100%;
  min-height: 65vh;
  /* Use a bright, inviting living room as hero backdrop */
  background-image: url("img/living-room.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Lighter gradient for hero overlay: allows more of the underlying image to show through */
  background: linear-gradient(180deg,
    rgba(31, 60, 107, 0.4) 0%,
    rgba(31, 60, 107, 0.5) 50%,
    rgba(31, 60, 107, 0.6) 100%);
  z-index: 0;
}

/* Customisation for about page hero */
.about-hero::after {
  /* lighter overlay for sub‑pages */
  background: linear-gradient(180deg,
    rgba(31, 60, 107, 0.3) 0%,
    rgba(31, 60, 107, 0.4) 50%,
    rgba(31, 60, 107, 0.5) 100%);
}

.hero .content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 2rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  max-width: 90%;
}

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

/* Section styles */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5.5rem 1rem 3rem; /* leave space for fixed header */
}

section {
  margin-bottom: 3rem;
}

/* Alternate section background */
.section-alt {
  background-color: var(--section-alt-bg);
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-radius: 0;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-weight: 600;
}

section p.lead {
  font-size: 1.1rem;
  color: var(--muted-text);
  margin-bottom: 2rem;
}

/* About page sections */
.about-section {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border-top: 4px solid var(--accent-color);
  margin-bottom: 2rem;
}

.about-section ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.about-section li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.2rem;
}
.about-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: 700;
}

/* Services section */
.services {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.service-item {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  flex: 1 1 calc(33.333% - 2rem);
  min-width: 250px;
  border-top: 4px solid var(--accent-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.service-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.service-item h3 {
  margin: 1rem 1rem 0.5rem;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.service-item p {
  margin: 0 1rem 1.5rem;
  color: var(--text-color);
}

.service-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* How it works section */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.step {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  position: relative;
  border-top: 4px solid var(--accent-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.step::before {
  content: attr(data-step);
  position: absolute;
  top: -1rem;
  left: -1rem;
  background-color: var(--primary-color);
  color: #fff;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.step h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.step p {
  color: var(--text-color);
  margin-bottom: 0;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Quote/contact form */
.quote-form {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  border-top: 4px solid var(--accent-color);
}

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

.quote-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.quote-form input,
.quote-form select,
.quote-form textarea {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: #fafafa;
  color: var(--text-color);
  resize: vertical;
}

.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(90, 124, 174, 0.2);
}

.quote-form .consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.quote-form button {
  grid-column: 1 / -1;
  justify-self: start;
  background-color: var(--accent-color);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.quote-form button:hover,
.quote-form button:focus {
  background-color: #987856;
}

/* FAQ section */
.faq {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border-top: 4px solid var(--accent-color);
}

.faq h3 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-top: 1.5rem;
}

.faq p {
  margin: 0.5rem 0 1rem;
  color: var(--text-color);
}

/* Contact section */
.contact {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border-top: 4px solid var(--accent-color);
}

.contact ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact li {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.contact a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

.contact a:hover,
.contact a:focus {
  color: var(--accent-color);
}

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

footer p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

footer a {
  color: #fff;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .services {
    flex-direction: column;
  }
  .service-item {
    flex: 1 1 100%;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .quote-form form {
    grid-template-columns: 1fr;
  }

  /* Responsive navigation */
  nav ul {
    display: none;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0;
  }
  nav ul.open {
    display: flex;
  }
  nav .nav-toggle {
    display: block;
  }
}