/* ==========================================================================
   1. MODERN BROWSER RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   2. CSS VARIABLES (Base 10px Rem System)
   ========================================================================== */
:root {
  /* Colors */
  --clr-primary: #2a9cbe;
  --clr-primary-dark: #258ba9;
  --clr-dark: #212529;
  --clr-light: #ffffff;
  --clr-muted: #6c757d;
  --clr-border: rgba(33, 37, 41, 0.1);
  --clr-faded: rgba(255, 255, 255, 0.7);
  --clr-light-hover: #f8f9fa;
  --clr-dark-hover: #1b2127;
  
  /* Typography */
  --font-heading: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Merriweather', 'Helvetica Neue', Arial, sans-serif;
  
  /* Spacing */
  --space-xs: 0.8rem;       /* 8px */
  --space-sm: 1.6rem;       /* 16px */
  --space-md: 2.4rem;       /* 24px */
  --space-lg: 3.2rem;       /* 32px */
  --space-xl: 4.8rem;       /* 48px */
  --space-xxl: 6.4rem;      /* 64px */
  --space-section: 12.8rem; /* 128px */
  
  /* Dimensions */
  --max-w-container: 114rem; /* 1140px */
  --max-w-hero: 80rem;       /* 800px */
  --max-nav-w: 76.8rem;      /* 768px */
  
  /* Borders & Radius */
  --border-thin: 0.1rem;     /* 1px */
  --border-thick: 0.3rem;    /* 3px */
  --radius-sm: 0.3rem;       /* 3px */
  --radius-pill: 999rem;     /* Fully rounded */
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease-in-out;
}

/* ==========================================================================
   3. BASE TYPOGRAPHY & SETUP
   ========================================================================== */
html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.6rem; /* 16px */
  color: var(--clr-dark);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
}

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--transition-fast);

  &:hover {
    color: var(--clr-primary-dark);
  }
}

/* ==========================================================================
   4. LAYOUT & UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-w-container);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

section {
  padding-block: var(--space-section);
}

.text-center { text-align: center; }
.text-muted { color: var(--clr-muted); }
.text-faded { color: var(--clr-faded); }
.text-primary { color: var(--clr-primary); }

p.bottom-space {
  margin-bottom: var(--space-md);
}
.bg-primary { 
  background-color: var(--clr-primary); 
  color: var(--clr-light); 
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-150%);
  background-color: var(--clr-dark);
  color: var(--clr-light);
  padding: var(--space-xs) var(--space-sm);
  z-index: 2000;
  transition: transform var(--transition-fast);
  text-decoration: none;

  &:focus {
    transform: translateY(0);
  }
}

/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */
.divider {
  max-width: 5rem; /* 50px */
  border: 0;
  border-top: var(--border-thick) solid var(--clr-primary);
  margin: var(--space-lg) auto;

  &.light {
    border-color: var(--clr-light);
  }
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;

  &.btn-primary {
    background-color: var(--clr-primary);
    color: var(--clr-light);

    &:hover {
      background-color: var(--clr-primary-dark);
    }
  }

  &.btn-light {
    background-color: var(--clr-light);
    color: var(--clr-dark);

    &:hover {
      background-color: var(--clr-light-hover);
    }
  }
}

/* ==========================================================================
   6. NAVIGATION (Fixed + Container Queries)
   ========================================================================== */
.navbar {  
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  padding-block: var(--space-sm);
  background-color: rgba(255, 255, 255, 0);
  backdrop-filter: none;
  border-bottom: var(--border-thin) solid rgba(33, 37, 41, 0);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);

  a {
    color: var(--clr-light);
    opacity: 0.8;
    &:hover {
      color: var(--clr-dark-hover);
    }
  }

  &.scrolled {
    background-color: var(--clr-light);
    color: var(--clr-dark);
    backdrop-filter: blur(1rem);
    border-bottom-color: var(--clr-border);

    a {
      color: var(--clr-dark);
      opacity: 1;
      &:hover {
        color: var(--clr-primary);
      }
    }
  }

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

    .navbar-brand {
      font-weight: 700;
      font-family: var(--font-heading);
      text-transform: uppercase;
      font-size: 2rem; /* 20px */
      transition: none;
    }

    .nav-menu {
      display: flex;
      gap: var(--space-md);

      a {
        font-family: var(--font-heading);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 1.44rem; /* 14.4px */
        transition: none;
      }
    }
  }
}

/* ==========================================================================
   7. HERO SECTION
   ========================================================================== */
.masthead {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--clr-light);
  background: url('header.jpg') center center / cover no-repeat fixed;
  padding: calc(var(--space-xxl) * 1.5) var(--space-sm);

  .hero-content {
    max-width: var(--max-w-hero);

    h1 {
      font-size: clamp(3.2rem, 5vw, 6.3rem); /* 32px to 64px */
      text-transform: uppercase;
    }

    p {
      font-size: 1.84rem; /* 18.4px */
      font-weight: 300;
      color: var(--clr-faded);
      margin-bottom: var(--space-xl);
    }
  }
}

/* ==========================================================================
   8. SERVICES GRID
   ========================================================================== */
#services {
  .services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);

    .service-box {
      flex: 0 1 28rem; /* Shrinks if needed, centers correctly, starts at 280px */
      padding: var(--space-sm);

      h3 {
        margin-bottom: var(--space-sm);
      }

      .icon {
        width: 6.4rem;  /* 64px */
        height: 6.4rem; /* 64px */
        margin-bottom: var(--space-sm);
        margin-inline: auto; /* Ensures icons are perfectly centered */
      }
    }
  }
}
