/* ==========================================================================
   221B Consultants — responsive stylesheet
   Layout: CSS Grid + Flexbox
   Breakpoints: 480 / 640 / 768 / 960 / 1200
   ========================================================================== */

:root {
  --navy: #2c3458;
  --navy-dark: #070f4b;
  --navy-deeper: #050c4d;
  --blue: #394fdf;
  --blue-mid: #1776cf;
  --ink: #181616;
  --text: #333333;
  --muted: #5a5a5a;
  --white: #ffffff;
  --off-white: #f6f7fb;
  --shadow: 0 12px 30px rgba(12, 18, 48, 0.18);
  --radius: 18px;
  --header-h: 76px;
  --max: 1120px;
  --pad: clamp(1rem, 4vw, 2rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  background: var(--white);
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

h1, h2, h3 {
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

/* ---------- Utilities ---------- */
.container {
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 2000;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

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

.btn-primary {
  background: var(--white);
  color: var(--navy);
}

.btn-primary:hover {
  background: #eef1ff;
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Header ---------- */
/* Sits on top of the hero so the blue field is one short band, not header + hero stacked. */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  color: var(--white);
  min-height: var(--header-h);
}

.site-header.is-stuck {
  position: fixed;
  background: rgba(7, 15, 75, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo img {
  height: 42px;
  width: auto;
}

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

.site-nav a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--white);
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px 8px;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle-bar {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--white);
  border-radius: 3px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(120deg, rgba(7, 15, 75, 0.55), rgba(44, 52, 88, 0.28)),
    url("images/banner2.jpg") center / cover no-repeat;
  color: var(--white);
  /* Header overlays this section; keep the blue band compact. */
  padding: calc(var(--header-h) + 0.6rem) 0 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: end;
  gap: clamp(1rem, 3vw, 2rem);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(1rem, 2vw, 1.125rem);
  max-width: 38rem;
}

.hero-copy {
  padding: 0.4rem 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.hero-media {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.hero-media img {
  width: min(100%, 340px);
  display: block;
}

/* ---------- Shared sections ---------- */
.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.section-head {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
}

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

/* ---------- Services ---------- */
.services {
  background: var(--white);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  text-align: center;
  padding: 0.5rem 0.75rem 1rem;
}

.service-icon {
  width: min(220px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(139deg, #2c3458 6%, #394fdf 96%);
  box-shadow: var(--shadow);
}

.service-icon img {
  width: 58%;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.service-card p {
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- About ---------- */
.about {
  background: linear-gradient(to left, #394fdf 4%, #2c3458 32%);
  color: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.about h2,
.about p {
  color: var(--white);
}

.about-media img {
  width: 100%;
  border-radius: 28px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

/* ---------- Certifications ---------- */
.certs {
  background: var(--off-white);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.cert-card {
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #394fdf 35%, #2c3458 60%);
  overflow: hidden;
  transition: transform 0.25s ease;
}

.cert-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.cert-card:hover,
.cert-card:focus-visible {
  transform: scale(1.03);
}

/* ---------- Quote ---------- */
.quote {
  background: linear-gradient(62deg, #14679a 12%, #144595 19%, #1525a0 30%, #2c3458 100%);
  color: var(--white);
}

.quote .section-head h2,
.quote .section-head p {
  color: var(--white);
}

.quote-card {
  background: var(--white);
  color: var(--ink);
  margin: 0 auto;
  max-width: 46rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 2.5rem;
  box-shadow: var(--shadow);
}

.quote-card p {
  margin: 0.75rem 0;
}

.quote-mark {
  width: 36px;
}

.quote-mark-right {
  margin-left: auto;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--white);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.contact-card {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  text-align: center;
}

.contact-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.contact-card a {
  color: var(--blue-mid);
  font-weight: 500;
  word-break: break-word;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  background: var(--navy-dark);
  color: var(--white);
  padding: 4.5rem 0 1.5rem;
  text-align: center;
}

.footer-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: -70px;
  height: 90px;
  background: url("images/footer.jpg") center / 100% 100% no-repeat;
  pointer-events: none;
}

.copyright {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 30, 0.92);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(90vw, 720px);
  max-height: 78vh;
  border-radius: 12px;
}

.lightbox-caption {
  color: var(--white);
  margin-top: 0.75rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  color: var(--white);
  font-size: 2.4rem;
  line-height: 1;
}

/* Prevent body scroll when mobile nav or lightbox is open */
body.nav-open,
body.lightbox-open {
  overflow: hidden;
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

@media (max-width: 959px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    align-items: center;
  }

  .hero-copy {
    padding: 0.25rem 0 1.25rem;
  }

  .hero-media {
    margin-top: 0;
  }

  .hero-media img {
    width: min(58%, 240px);
  }

  .about-media {
    max-width: 520px;
    margin: 0 auto;
  }

  .card-grid,
  .cert-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .cert-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
    z-index: 1101;
  }

  .site-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(82vw, 320px);
    background: var(--navy-dark);
    padding: calc(var(--header-h) + 1rem) 1.25rem 2rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.28);
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.35rem;
  }

  .site-nav a {
    padding: 0.9rem 0.8rem;
    font-size: 1.1rem;
  }

  .hero-actions .btn {
    flex: 1 1 160px;
  }

  .service-icon {
    width: min(180px, 58vw);
  }

  .footer-wave {
    top: -48px;
    height: 64px;
  }
}

@media (max-width: 639px) {
  .cert-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin-inline: auto;
  }

  .quote-card {
    border-radius: 1.5rem;
  }

  .hero {
    text-align: center;
  }

  .hero p {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }
}

@media (max-width: 479px) {
  .logo img {
    height: 34px;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .section-head h2 {
    font-size: 1.6rem;
  }
}

/* Large screens: keep content readable, do not stretch endlessly */
@media (min-width: 1400px) {
  :root {
    --max: 1200px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
