/* ============================================================
   Best Brains Academy — Main Stylesheet
   Theme replicated from nairobischool.ac.ke
   Primary: #07294d (deep navy) | Accent: #ffc600 (gold)
   Fonts: Montserrat (headings) / Roboto (body)
   ============================================================ */

:root {
  --site-primary: #07294d;
  --site-primary-dark: #021d3a;
  --site-primary-soft: #0b3768;
  --site-accent: #ffc600;
  --site-accent-soft: #f5c542;
  --site-accent-deep: #c88b00;
  --site-surface: #ffffff;
  --site-surface-soft: #f6f8fc;
  --site-surface-tint: #eef4fb;
  --site-border: #d9e1ec;
  --site-text: #2d3748;
  --site-text-muted: #5d6f84;
  --site-gray: #8a8a8a;
  --site-shadow: 0 18px 45px rgba(7, 41, 77, 0.12);
  --ns-shadow-soft: 0 14px 34px rgba(7, 41, 77, 0.08);
  --ns-shadow-card: 0 24px 52px rgba(7, 41, 77, 0.10);
  --ns-shadow-hover: 0 30px 64px rgba(7, 41, 77, 0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--site-text);
  background: var(--site-surface);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--site-primary);
  line-height: 1.25;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: color .25s ease; }
ul { list-style: none; }
section { overflow: clip; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .4px;
  padding: 14px 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .3s ease;
  text-transform: uppercase;
}
.btn-gold {
  background: var(--site-accent);
  color: var(--site-primary);
}
.btn-gold:hover {
  background: transparent;
  border-color: var(--site-accent);
  color: var(--site-accent);
}
.btn-outline-light {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-outline-light:hover {
  background: #fff;
  color: var(--site-primary);
}
.btn-navy {
  background: var(--site-primary);
  color: #fff;
}
.btn-navy:hover {
  background: var(--site-primary-soft);
  color: var(--site-accent);
}

/* ---------- Top Bar ---------- */
.top-bar {
  background: var(--site-primary-dark);
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  padding: 8px 0;
  position: relative;
  z-index: 60;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.top-bar-contact { display: flex; gap: 22px; flex-wrap: wrap; }
.top-bar-contact span i { color: var(--site-accent); margin-right: 6px; }
.top-bar-links { display: flex; align-items: center; gap: 16px; }
.top-bar-links a:hover { color: var(--site-accent); }
.top-bar-social { display: flex; gap: 12px; }
.top-bar-social a {
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
}
.top-bar-social a:hover { color: var(--site-accent); }

/* ---------- Header / Navbar ---------- */
.site-header {
  background: var(--site-surface);
  box-shadow: 0 4px 18px rgba(7, 41, 77, .08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--site-surface-tint);
}
.brand-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 19px;
  color: var(--site-primary);
  line-height: 1.15;
}
.brand-tagline {
  font-size: 11.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--site-accent-deep);
  font-weight: 600;
}

/* Main nav */
.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--site-primary);
  padding: 30px 13px;
  position: relative;
}
.main-nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 20px;
  height: 3px;
  background: var(--site-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.main-nav > ul > li > a:hover::after,
.main-nav > ul > li.active > a::after { transform: scaleX(1); }
.main-nav > ul > li > a:hover { color: var(--site-primary-soft); }
.main-nav .caret { font-size: 10px; margin-left: 4px; }

/* Dropdowns */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: var(--site-surface);
  border-top: 3px solid var(--site-accent);
  box-shadow: var(--ns-shadow-card);
  border-radius: 0 0 8px 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all .28s ease;
  z-index: 55;
}
.main-nav li:hover > .dropdown,
.main-nav li:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown li a {
  display: block;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--site-text);
  border-bottom: 1px solid var(--site-surface-tint);
  transition: all .22s ease;
}
.dropdown li:last-child a { border-bottom: 0; }
.dropdown li a:hover {
  background: var(--site-surface-tint);
  color: var(--site-primary);
  padding-left: 26px;
}

/* Mobile toggle & close — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 26px;
  color: var(--site-primary);
  cursor: pointer;
}
.nav-close { display: none; }

/* ---------- Hero Slider ---------- */
.hero {
  position: relative;
  height: min(88vh, 720px);
  min-height: 520px;
  color: #fff;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 29, 58, .88) 0%, rgba(7, 41, 77, .62) 55%, rgba(7, 41, 77, .30) 100%);
}
.hero-slide.active { opacity: 1; }
.hero-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.hero-kicker {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--site-accent);
  margin-bottom: 18px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(34px, 5.2vw, 58px);
  font-weight: 800;
  max-width: 720px;
  margin-bottom: 20px;
}
.hero p {
  max-width: 560px;
  font-size: 17px;
  color: rgba(255, 255, 255, .88);
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 6;
}
.hero-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  cursor: pointer;
  transition: all .3s;
}
.hero-dots button.active { background: var(--site-accent); border-color: var(--site-accent); }

/* ---------- Section scaffolding ---------- */
.section { padding: 90px 0; }
.section-soft { background: var(--site-surface-soft); }
.section-tint { background: var(--site-surface-tint); }
.section-navy { background: var(--site-primary); color: rgba(255, 255, 255, .85); }
.section-navy h2, .section-navy h3 { color: #fff; }

.section-title { max-width: 640px; margin: 0 auto 54px; text-align: center; }
.section-title.left { text-align: left; margin-left: 0; }
.section-title h5 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--site-accent-deep);
  margin-bottom: 12px;
}
.section-navy .section-title h5 { color: var(--site-accent); }
.section-title h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 14px; }
.section-title p { color: var(--site-text-muted); }
.section-navy .section-title p { color: rgba(255, 255, 255, .75); }
.title-bar {
  width: 64px;
  height: 4px;
  background: var(--site-accent);
  border-radius: 4px;
  margin: 18px auto 0;
}
.section-title.left .title-bar { margin-left: 0; }

/* ---------- Stats strip ---------- */
.stats-strip {
  background: linear-gradient(135deg, var(--site-primary-dark) 0%, var(--site-primary) 60%, var(--site-primary-soft) 100%);
  padding: 64px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  text-align: center;
}
.stat-item h3 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  color: var(--site-accent);
  margin-bottom: 6px;
}
.stat-item p {
  color: rgba(255, 255, 255, .85);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }

.card {
  background: var(--site-surface);
  border: 1px solid rgba(7, 41, 77, .10);
  border-radius: 14px;
  box-shadow: var(--ns-shadow-soft);
  transition: transform .3s ease, box-shadow .3s ease;
  overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--ns-shadow-hover); }
.card-body { padding: 28px; }
.card-body h4 { font-size: 19px; margin-bottom: 10px; }
.card-body p { color: var(--site-text-muted); font-size: 15px; }
.card-img { height: 230px; width: 100%; object-fit: cover; }

/* Value cards */
.value-card {
  background: var(--site-surface);
  border: 1px solid rgba(7, 41, 77, .10);
  border-radius: 14px;
  padding: 30px 26px;
  box-shadow: var(--ns-shadow-soft);
  transition: transform .3s ease, box-shadow .3s ease;
}
.value-card:hover { transform: translateY(-6px); box-shadow: var(--ns-shadow-hover); }
.value-card .icon {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: var(--site-surface-tint);
  color: var(--site-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
  transition: all .3s ease;
}
.value-card:hover .icon { background: var(--site-accent); }
.value-card h4 { font-size: 18px; margin-bottom: 8px; }
.value-card p { font-size: 14.5px; color: var(--site-text-muted); }

/* ---------- About / welcome split ---------- */
.about-media { position: relative; }
.about-media img {
  border-radius: 16px;
  box-shadow: var(--ns-shadow-card);
  width: 100%;
  height: 460px;
  object-fit: cover;
}
.about-media .experience-badge {
  position: absolute;
  bottom: -24px;
  right: -18px;
  background: var(--site-accent);
  color: var(--site-primary);
  border-radius: 14px;
  padding: 20px 26px;
  font-family: 'Montserrat', sans-serif;
  box-shadow: var(--ns-shadow-card);
  text-align: center;
}
.experience-badge strong { display: block; font-size: 30px; font-weight: 800; }
.experience-badge span { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.about-copy h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 18px; }
.about-copy p { color: var(--site-text-muted); margin-bottom: 16px; }
.about-list { margin: 22px 0 30px; display: grid; gap: 12px; }
.about-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  color: var(--site-text);
}
.about-list li i { color: var(--site-accent-deep); margin-top: 5px; }

/* ---------- Message / quote block ---------- */
.message-card {
  background: var(--site-surface);
  border-radius: 18px;
  box-shadow: var(--ns-shadow-card);
  border: 1px solid rgba(7, 41, 77, .08);
  display: grid;
  grid-template-columns: 340px 1fr;
  overflow: hidden;
}
.message-card .photo { width: 100%; height: 100%; min-height: 340px; object-fit: cover; }
.message-card .content { padding: 44px; }
.message-card blockquote {
  font-size: 17px;
  color: var(--site-text-muted);
  border-left: 4px solid var(--site-accent);
  padding-left: 20px;
  margin: 20px 0;
  font-style: italic;
}
.message-card .signature { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--site-primary); }
.message-card .role { font-size: 13.5px; color: var(--site-accent-deep); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 240px;
  cursor: pointer;
  box-shadow: var(--ns-shadow-soft);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 41, 77, .85), transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 18px;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: opacity .35s ease;
}
.gallery-item:hover .overlay { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 29, 58, .92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.lightbox .close {
  position: absolute;
  top: 24px;
  right: 30px;
  font-size: 34px;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- News ---------- */
.news-card .date {
  display: inline-block;
  background: var(--site-surface-tint);
  color: var(--site-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 30px;
  margin-bottom: 14px;
}
.news-card a.read-more {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--site-accent-deep);
}
.news-card a.read-more:hover { color: var(--site-primary); }

/* ---------- Testimonials ---------- */
.testimonial-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 34px;
}
.testimonial-card p { font-style: italic; color: rgba(255, 255, 255, .88); margin-bottom: 20px; }
.testimonial-card .who { display: flex; align-items: center; gap: 14px; }
.testimonial-card .who .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--site-accent);
  color: var(--site-primary);
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
.testimonial-card .who strong { color: #fff; font-family: 'Montserrat', sans-serif; display: block; }
.testimonial-card .who span { font-size: 13px; color: var(--site-accent); }
.testimonial-card .stars { color: var(--site-accent); margin-bottom: 16px; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background:
    linear-gradient(rgba(2, 29, 58, .88), rgba(7, 41, 77, .88)),
    url('../assets/img/img-15.jpeg') center/cover no-repeat;
  padding: 100px 0;
  text-align: center;
  color: #fff;
}
.cta-banner h2 { color: #fff; font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 16px; }
.cta-banner p { max-width: 620px; margin: 0 auto 34px; color: rgba(255, 255, 255, .85); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background:
    linear-gradient(rgba(2, 29, 58, .82), rgba(7, 41, 77, .82)),
    url('../assets/img/img-15.jpeg') center/cover no-repeat;
  color: #fff;
  padding: 110px 0 90px;
  text-align: center;
}
.page-hero h1 { color: #fff; font-size: clamp(32px, 4.4vw, 50px); margin-bottom: 12px; }
.page-hero .crumbs {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
}
.page-hero .crumbs a { color: var(--site-accent); }

/* ---------- Content helpers ---------- */
.icon-list { display: grid; gap: 12px; margin: 18px 0; }
.icon-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--site-text-muted); }
.icon-list li i { color: var(--site-accent-deep); margin-top: 5px; }
.lead { font-size: 18.5px; color: var(--site-text-muted); }

.info-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.info-table th, .info-table td {
  border: 1px solid var(--site-border);
  padding: 14px 18px;
  text-align: left;
  font-size: 15px;
}
.info-table th {
  background: var(--site-primary);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.info-table tr:nth-child(even) { background: var(--site-surface-soft); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--site-border);
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  color: var(--site-text);
  background: var(--site-surface);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--site-accent);
  box-shadow: 0 0 0 4px rgba(255, 198, 0, .18);
}
textarea.form-control { min-height: 150px; resize: vertical; }
label.form-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--site-primary);
  margin-bottom: 7px;
}

.contact-info-card {
  background: var(--site-surface);
  border-radius: 14px;
  border: 1px solid rgba(7, 41, 77, .1);
  box-shadow: var(--ns-shadow-soft);
  padding: 28px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.contact-info-card .icon {
  flex: 0 0 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--site-surface-tint);
  color: var(--site-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.contact-info-card h4 { font-size: 17px; margin-bottom: 4px; }
.contact-info-card p { color: var(--site-text-muted); font-size: 14.5px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--site-primary-dark);
  color: rgba(255, 255, 255, .78);
  font-size: 14.5px;
}
.footer-main {
  padding: 74px 0 50px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .brand { margin-bottom: 18px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all .3s ease;
}
.footer-social a:hover {
  background: var(--site-accent);
  border-color: var(--site-accent);
  color: var(--site-primary);
}
.footer-col h4 {
  color: #fff;
  font-size: 16.5px;
  margin-bottom: 22px;
  position: relative;
  padding-bottom: 12px;
}
.footer-col h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42px;
  height: 3px;
  background: var(--site-accent);
  border-radius: 3px;
}
.footer-col ul li { margin-bottom: 11px; }
.footer-col ul li a {
  color: rgba(255, 255, 255, .78);
  transition: all .25s ease;
}
.footer-col ul li a:hover { color: var(--site-accent); padding-left: 6px; }
.footer-col ul li a i { font-size: 11px; margin-right: 8px; color: var(--site-accent); }
.footer-contact li {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.footer-contact li i { color: var(--site-accent); margin-top: 5px; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 20px 0;
}
.footer-legal .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
}
.footer-legal a { color: rgba(255, 255, 255, .7); }
.footer-legal a:hover { color: var(--site-accent); }
.footer-legal .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE — Mobile-first professional overhaul
   Breakpoints: 1050 | 920 | 640 | 400
   ============================================================ */

/* ---------- 1050px — large tablets / small desktops ---------- */
@media (max-width: 1050px) {
  .main-nav > ul > li > a { padding: 30px 9px; font-size: 12.5px; }
  .footer-main { grid-template-columns: 1.2fr 1fr 1fr; gap: 30px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- 920px — tablets / mobile nav trigger ---------- */
@media (max-width: 920px) {

  /* Nav toggle button */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--site-surface-tint);
    border: 1px solid var(--site-border);
    border-radius: 8px;
    font-size: 20px;
    color: var(--site-primary);
    cursor: pointer;
  }

  /* Mobile nav drawer */
  .main-nav {
    position: fixed;
    top: 0;
    right: -340px;
    width: 310px;
    height: 100dvh;
    background: var(--site-primary-dark);
    padding: 80px 0 50px;
    overflow-y: auto;
    transition: right .36s cubic-bezier(.4, 0, .2, 1);
    z-index: 200;
    box-shadow: -12px 0 48px rgba(0, 0, 0, .35);
  }
  .main-nav.open { right: 0; }

  /* Close button inside drawer */
  .nav-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.1);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background .2s;
  }
  .nav-close:hover { background: rgba(255,255,255,.18); }

  /* Nav drawer backdrop */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 29, 58, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity .36s ease;
  }
  .nav-backdrop.visible { opacity: 1; pointer-events: all; }

  /* Nav list layout */
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav > ul > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    padding: 16px 26px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
  }
  .main-nav > ul > li > a::after { display: none; }

  /* Dropdown in drawer */
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: 0;
    background: rgba(255, 255, 255, .05);
    border-radius: 0;
    display: none;
    min-width: auto;
  }
  .main-nav li.open-sub > .dropdown { display: block; }
  .dropdown li a {
    color: rgba(255, 255, 255, .75);
    border-color: rgba(255, 255, 255, .06);
    padding: 13px 26px 13px 38px;
    font-size: 13.5px;
  }
  .dropdown li a:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--site-accent);
    padding-left: 44px;
  }

  /* Brand on smaller viewports */
  .brand-name { font-size: 16px; }
  .brand-tagline { font-size: 10.5px; }
  .brand-logo { width: 52px; height: 52px; }

  /* Sections */
  .section { padding: 64px 0; }
  .section-title { margin-bottom: 42px; }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 22px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 18px; }

  /* About media — fix badge overflow */
  .about-media img { height: 340px; }
  .about-media .experience-badge {
    bottom: -16px;
    right: 16px;
    padding: 14px 18px;
  }
  .experience-badge strong { font-size: 24px; }

  /* Message card — stack vertically */
  .message-card { grid-template-columns: 1fr; }
  .message-card .photo { max-height: 320px; width: 100%; object-fit: cover; }
  .message-card .content { padding: 32px 28px; }
  .message-card blockquote { font-size: 15.5px; }

  /* Stats */
  .stats-strip { padding: 50px 0; }

  /* Gallery */
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .gallery-item { height: 200px; }

  /* Tables */
  .table-responsive { overflow-x: auto; border-radius: 8px; }
  .info-table { min-width: 500px; }

  /* Footer */
  .footer-main { grid-template-columns: 1fr 1fr; gap: 36px; padding: 56px 0 40px; }
  .footer-brand { grid-column: 1 / -1; }

  /* Buttons */
  .hero-actions { gap: 12px; }
}

/* ---------- 640px — phones ---------- */
@media (max-width: 640px) {

  /* Top bar — compact on phones */
  .top-bar { padding: 6px 0; font-size: 12px; }
  .top-bar .container { flex-direction: column; align-items: center; gap: 4px; }
  .top-bar-contact { gap: 12px; justify-content: center; }
  .top-bar-links > a { display: none; } /* hide text links, keep socials */
  .top-bar-links { gap: 10px; }

  /* Header */
  .site-header .container { min-height: 70px; gap: 12px; }
  .brand-name { font-size: 15px; }
  .brand-tagline { display: none; } /* hide tagline on small phones */
  .brand-logo { width: 46px; height: 46px; }

  /* Hero */
  .hero { min-height: 100svh; height: auto; }
  .hero-content { padding: 120px 20px 80px; justify-content: flex-end; }
  .hero-kicker { font-size: 11px; letter-spacing: 2px; margin-bottom: 12px; }
  .hero h1 { font-size: clamp(26px, 7.5vw, 36px); margin-bottom: 14px; }
  .hero p { font-size: 15px; margin-bottom: 24px; max-width: 100%; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; text-align: center; padding: 14px 24px; }

  /* Sections */
  .section { padding: 52px 0; }
  .section-title { margin-bottom: 36px; }
  .section-title h2 { font-size: clamp(22px, 6vw, 28px); }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 20px; }

  /* Cards */
  .card-img { height: 200px; }
  .card-body { padding: 20px; }
  .card-body h4 { font-size: 17px; }

  /* Value cards */
  .value-card { padding: 24px 20px; }

  /* About */
  .about-media img { height: 260px; border-radius: 12px; }
  .about-media .experience-badge {
    position: relative;
    bottom: auto;
    right: auto;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    border-radius: 10px;
    padding: 12px 18px;
  }
  .experience-badge strong { font-size: 20px; }
  .experience-badge span { font-size: 12px; }

  /* Message card */
  .message-card .content { padding: 24px 20px; }
  .message-card blockquote { font-size: 15px; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .stat-item h3 { font-size: clamp(28px, 8vw, 40px); }

  /* Gallery */
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gallery-item { height: 150px; border-radius: 8px; }

  /* Testimonials */
  .testimonial-card { padding: 24px 18px; }

  /* CTA */
  .cta-banner { padding: 72px 0; }
  .cta-banner h2 { font-size: clamp(22px, 6.5vw, 30px); }
  .cta-banner p { font-size: 15px; margin-bottom: 24px; }

  /* Page hero */
  .page-hero { padding: 80px 0 60px; }
  .page-hero h1 { font-size: clamp(24px, 7vw, 36px); }

  /* Tables */
  .info-table th, .info-table td { padding: 10px 14px; font-size: 13.5px; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .btn { padding: 13px 24px; font-size: 13px; }

  /* Footer */
  .footer-main { grid-template-columns: 1fr; gap: 32px; padding: 48px 0 32px; }
  .footer-brand { grid-column: auto; }
  .footer-col h4 { font-size: 15px; margin-bottom: 16px; }
  .footer-legal .container { flex-direction: column; text-align: center; gap: 8px; }
  .footer-legal .links { justify-content: center; gap: 14px; }
  .footer-social { justify-content: flex-start; gap: 10px; }
}

/* ---------- 400px — very small phones ---------- */
@media (max-width: 400px) {

  .container { padding: 0 16px; }

  .top-bar { display: none; } /* hide top bar on tiny screens to save vertical space */

  .hero-content { padding: 100px 16px 70px; }
  .hero h1 { font-size: 25px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-item h3 { font-size: 32px; }

  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item { height: 220px; }

  .cta-banner { padding: 56px 0; }

  .nav-toggle { width: 40px; height: 40px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-name { font-size: 13.5px; }

  .main-nav { width: 290px; }
}
