/* ============================================================
   Right as Rain Gutters — Azure Torrent design system
   Based on DESIGN.md
   ============================================================ */

:root {
  /* Colors (from DESIGN.md palette) */
  --primary: #0056b3;
  --primary-fixed-dim: #acc7ff;
  --secretary-sky: #76b4ea;
  --surface-wash: #f0f7ff;
  --ink: #1a1c1e;
  --on-surface-variant: #424752;
  --outline: #727784;
  --outline-variant: #c2c6d4;
  --surface-1: #ffffff;
  --surface-1-border: #d0e4f7;
  --error: #ba1a1a;

  /* Semantic aliases (swapped for dark mode) */
  --text-on-accent: #ffffff;
  --text-on-primary: #ffffff;
  --heading-color: #003f87;
  --primary-content: var(--primary);
  --link-color: var(--primary);
  --input-bg: #ffffff;
  --on-surface: var(--ink);

  color-scheme: light;

  /* Typography */
  --font-display: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Radii */
  --radius-sm: 0.125rem;
  --radius-default: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Spacing (8px unit) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;

  /* Elevation */
  --shadow-soft: 0px 4px 12px rgba(0, 86, 179, 0.08);

  /* Layout */
  --container-max: 1200px;
  --gutter: 24px;
  --margin-desktop: 80px;
  --margin-mobile: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px; /* body-md */
  line-height: 24px;
  color: var(--ink);
  background: var(--surface-wash);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  border: none;
  border-radius: var(--radius-default);
  font-family: var(--font-body);
  font-size: 16px; /* body-md */
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Primary: solid Primary Blue (#0056B3) with white text */
.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: #004491;
  box-shadow: 0 6px 16px rgba(0, 86, 179, 0.16);
}

/* Secondary: outlined with Primary Blue */
.btn-secondary {
  background: transparent;
  color: var(--primary-content);
  border: 1px solid var(--primary-content);
}

.btn-secondary:hover {
  background: rgba(0, 86, 179, 0.06);
}

/* Accent: solid Secondary Sky with navy text */
.btn-accent {
  background: var(--secretary-sky);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-soft);
}

.btn-accent:hover {
  background: #5ca0d6;
}

.btn-large {
  padding: 1.1rem 2.5rem;
  font-size: 18px; /* body-lg */
}

.btn-block {
  width: 100%;
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  background: var(--primary);
  color: var(--text-on-primary);
  padding: var(--space-1) 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 24px; /* headline-md */
  font-weight: 700;
  color: var(--text-on-primary);
  letter-spacing: 0.5px;
}

.site-nav {
  display: flex;
  gap: var(--space-3);
}

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-body);
  font-weight: 500;
}

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72vh;
  text-align: center;
  background: url("../images/hero-bg.jpg") center/cover no-repeat;
  color: #ffffff;
  padding: var(--space-10) 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 86, 179, 0.55),
    rgba(0, 68, 145, 0.82)
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 56px; /* display-lg */
  font-weight: 800;
  line-height: 64px;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 18px; /* body-lg */
  line-height: 28px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: var(--space-4);
}

.hero-phone {
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  color: rgba(255, 255, 255, 0.92);
}

.hero-phone a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
}

.hero-phone a:hover {
  color: var(--primary-fixed-dim);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: var(--space-10) 0;
}

.section-alt {
  background: var(--surface-1);
}

.section-title {
  font-family: var(--font-display);
  font-size: 32px; /* headline-lg */
  font-weight: 700;
  line-height: 40px;
  color: var(--heading-color);
  text-align: center;
  margin-bottom: var(--space-1);
}

.section-subtitle {
  text-align: center;
  color: var(--on-surface-variant);
  font-family: var(--font-body);
  font-size: 18px; /* body-lg */
  line-height: 28px;
  max-width: 680px;
  margin: 0 auto var(--space-4);
}

/* ============================================================
   Services / Cards
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.service-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-1-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 86, 179, 0.12);
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 24px; /* headline-md */
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: var(--space-1);
}

.service-card p {
  color: var(--ink);
  font-size: 16px; /* body-md */
  line-height: 24px;
}

.service-card .service-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--link-color);
}

.section-cta {
  text-align: center;
  margin-top: var(--space-6);
}

/* ============================================================
   Feature lists (water-droplet bullets)
   ============================================================ */
.feature-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
}

.feature-list li {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-2);
  font-size: 16px;
  line-height: 24px;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 10px;
  height: 14px;
  background: var(--primary-content);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(-8deg);
}

/* ============================================================
   Reliability Badge
   ============================================================ */
.reliability-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-4);
}

.reliability-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.5rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--surface-1-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-body);
  font-size: 14px; /* label-md */
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.05em;
  color: var(--primary-content);
  text-transform: uppercase;
}

.reliability-badge .badge-icon {
  color: var(--primary-content);
  display: inline-flex;
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3);
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--primary);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4) var(--space-2) var(--space-1);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.contact-info .section-title,
.contact-info .section-subtitle {
  text-align: left;
  margin-left: 0;
}

.contact-details {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-3);
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-family: var(--font-body);
  font-size: 14px; /* label-md */
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.contact-value {
  font-size: 18px; /* body-lg */
  line-height: 28px;
  color: var(--ink);
  font-weight: 500;
}

a.contact-value:hover {
  color: var(--link-color);
}

.contact-form {
  background: var(--surface-1);
  border: 1px solid var(--surface-1-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
}

.form-group {
  margin-bottom: var(--space-2);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-1);
  font-family: var(--font-body);
  font-size: 14px; /* label-md */
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-default);
  font-family: var(--font-body);
  font-size: 16px; /* body-md */
  line-height: 24px;
  color: var(--on-surface);
  background: var(--input-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--outline);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-soft);
}

/* ============================================================
   Trust / Footer
   ============================================================ */
.site-footer {
  background: #14293f;
  color: rgba(255, 255, 255, 0.82);
  padding: var(--space-3) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 14px;
  font-family: var(--font-body);
}

.site-footer a {
  color: var(--primary-fixed-dim);
  font-weight: 500;
}

/* ============================================================
   Responsive / Mobile
   ============================================================ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 28px; /* headline-lg-mobile */
    line-height: 36px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .section {
    padding: var(--space-8) 0;
  }

  .container {
    padding: 0 var(--margin-mobile);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .header-cta {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .hero {
    min-height: 60vh;
    padding: var(--space-6) 0;
  }

  .services-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /* Cards take full width minus 20px margins */
  .service-card {
    margin: 0 var(--margin-mobile);
  }

  .gallery-item {
    margin: 0 var(--margin-mobile);
  }

  .gallery-grid {
    gap: var(--space-3);
  }
}

/* ============================================================
   Dark theme — follows the user's system preference
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --primary: #4c9bdf;
    --primary-fixed-dim: #acc7ff;
    --secretary-sky: #578fbf;
    --surface-wash: #121417;
    --ink: #e6e9ec;
    --on-surface-variant: #b6bac3;
    --outline: #8a8f9a;
    --outline-variant: #3a3f47;
    --surface-1: #1c1f23;
    --surface-1-border: #30353d;
    --error: #ffb4ab;

    --text-on-accent: #0a0f14;
    --text-on-primary: #ffffff;
    --heading-color: #9cc4ec;
    --primary-content: #6aa7df;
    --link-color: #8ab9e8;
    --input-bg: #23272c;
    --on-surface: #e6e9ec;

    --shadow-soft: 0px 4px 12px rgba(0, 0, 0, 0.35);
  }

  /* Form inputs focus border uses light blue */
  .form-group input:focus,
  .form-group textarea:focus {
    border-color: var(--primary);
  }

  .btn-secondary:hover {
    background: rgba(140, 185, 232, 0.1);
  }
}
