/* ============================
   DESIGN TOKENS
   ============================ */
:root {
  --color-base:           #F8F7F4;
  --color-surface:        #FFFFFF;
  --color-deep:           #060D1F;

  --color-primary:        #1B3D72;
  --color-primary-mid:    #254E90;
  --color-primary-ultra:  #EDF2FB;
  --color-primary-dark:   #0D2347;

  --color-accent:         #0B7A6E;
  --color-accent-dark:    #075E54;
  --color-accent-warm:    #EBF6F4;

  --color-star:           #F5A623;

  --color-text:           #0E1D3C;
  --color-text-secondary: #46547A;
  --color-text-tertiary:  #8B97B8;

  --color-border:         #DDE1EE;
  --color-border-light:   #EEF0F8;

  /* RGB components for alpha variants */
  --rgb-primary:          27, 61, 114;
  --rgb-accent:           11, 122, 110;
  --rgb-base:             248, 247, 244;
  --rgb-white:            255, 255, 255;
  --rgb-black:            0, 0, 0;

  --font-display: 'Gloock', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-2xl: 24px;

  --shadow-md:   0 4px 16px rgba(var(--rgb-primary), 0.09);
  --shadow-lg:   0 12px 40px rgba(var(--rgb-primary), 0.13);
  --shadow-card: 0 1px 2px rgba(var(--rgb-black), 0.04), 0 4px 16px rgba(var(--rgb-primary), 0.08);
}

/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-base);
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

/* ============================
   UTILITY
   ============================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--color-text);
}

.section-title em {
  font-style: italic;
  color: var(--color-accent);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 52ch;
  line-height: 1.75;
  margin-top: 0.875rem;
}

/* Dark-section overrides */
.testimonials .section-label { color: rgba(var(--rgb-white),0.5); }
.testimonials .section-label::before { background: rgba(var(--rgb-white),0.3); }
.testimonials .section-title { color: var(--color-surface); }
.testimonials .section-title em { color: rgba(var(--rgb-white),0.45); }
.testimonials .section-subtitle { color: rgba(var(--rgb-white),0.55); }

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  white-space: nowrap;
}

.btn--sm  { padding: 0.5rem 1.125rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn--md  { padding: 0.75rem 1.625rem; font-size: 0.9375rem; border-radius: var(--radius-md); }

.btn--primary {
  color: var(--color-surface);
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(var(--rgb-primary), 0.25);
}
.btn--primary:hover { background: var(--color-primary-mid); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(var(--rgb-primary), 0.32); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  color: var(--color-text);
  background: transparent;
  border: 1.5px solid var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-ultra); }
.btn--ghost:active { transform: scale(0.98); }

.btn--surface {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 700;
}
.btn--surface:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(var(--rgb-black), 0.14); }

.btn--ghost-inv {
  color: rgba(var(--rgb-white),0.85);
  background: transparent;
  border: 1.5px solid rgba(var(--rgb-white),0.28);
}
.btn--ghost-inv:hover { border-color: rgba(var(--rgb-white),0.55); color: var(--color-surface); background: rgba(var(--rgb-white),0.08); }

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ============================
   NAV
   ============================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--rgb-base), 0.92);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--color-border-light);
}

.nav__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.1s linear;
  z-index: 101;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav__logo-icon {
  width: 34px;
  height: 34px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__logo-icon svg { width: 18px; height: 18px; color: var(--color-surface); }

.nav__logo-img { height: 36px; width: auto; max-width: none; display: block; object-fit: contain; flex-shrink: 0; }

.footer__logo-img { height: 40px; width: auto; display: block; object-fit: contain; margin-bottom: 1rem; }
.footer__logo-img--invert { filter: brightness(0) invert(1); }

/* ============================
   SCROLL REVEAL & STAGGER
   ============================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal--visible {
  opacity: 1;
  transform: none;
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.stagger-children--visible > * {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.nav__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 2.25rem);
}

.nav__links a {
  font-size: clamp(0.8rem, 1vw, 0.875rem);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.18s ease;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--color-text); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================
   FOOTER
   ============================ */
.footer {
  background: var(--color-primary-dark);
  color: var(--color-surface);
  padding: 4.5rem 0 0;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer__brand-icon {
  width: 34px; height: 34px;
  background: var(--color-primary-mid);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}
.footer__brand-icon svg { width: 18px; height: 18px; color: var(--color-surface); }

.footer__brand-name { font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.75rem; }

.footer__brand-desc {
  font-size: 0.875rem;
  color: rgba(var(--rgb-white),0.38);
  line-height: 1.65;
  max-width: 26ch;
  margin-bottom: 1.375rem;
}

.footer__brand-actions { display: flex; gap: 0.5rem; }

.footer__social { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.footer__social-link {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s ease;
}
.footer__social-link:hover { color: #fff; }
.footer__social-link svg { width: 1.125rem; height: 1.125rem; }

.footer .btn--footer-primary {
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-sm);
}
.footer .btn--footer-primary:hover { background: var(--color-accent-dark); }

.footer .btn--footer-ghost {
  background: transparent;
  color: rgba(var(--rgb-white),0.55);
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--rgb-white),0.12);
}
.footer .btn--footer-ghost:hover { border-color: rgba(var(--rgb-white),0.3); color: var(--color-surface); }

.footer__col-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 1.25rem; }

.footer__links { list-style: none; display: flex; flex-direction: column; gap: 0.625rem; }
.footer__links a { font-size: 0.875rem; color: rgba(var(--rgb-white),0.38); transition: color 0.15s ease; }
.footer__links a:hover { color: var(--color-surface); }

.footer__newsletter-desc { font-size: 0.875rem; color: rgba(var(--rgb-white),0.38); line-height: 1.6; margin-bottom: 1rem; }

.footer__newsletter-form { display: flex; gap: 0.5rem; }

.footer__newsletter-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: rgba(var(--rgb-white),0.06);
  border: 1px solid rgba(var(--rgb-white),0.1);
  border-radius: var(--radius-sm);
  color: var(--color-surface);
  outline: none;
  transition: border-color 0.2s ease;
}
.footer__newsletter-input::placeholder { color: rgba(var(--rgb-white),0.25); }
.footer__newsletter-input:focus { border-color: var(--color-accent); }

.footer__newsletter-btn {
  padding: 0.625rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-body);
  background: var(--color-accent);
  color: var(--color-surface);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.footer__newsletter-btn:hover { background: var(--color-accent-dark); }

/* Associations trust bar */
.footer__associations { border-top: 1px solid rgba(var(--rgb-white), 0.08); }

.footer__associations-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer__associations-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(var(--rgb-white), 0.28);
  white-space: nowrap;
  flex-shrink: 0;
}

.footer__associations-logos {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer__associations-logos a {
  opacity: 0.4;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
}

.footer__associations-logos a:hover { opacity: 0.82; }

.footer__associations-logos img {
  height: 24px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
}

.footer__bottom {
  border-top: 1px solid rgba(var(--rgb-white),0.06);
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer__copyright { font-size: 0.8125rem; color: rgba(var(--rgb-white),0.22); }

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
  .services__grid { grid-template-columns: 1fr 1fr; }
  .services__card--featured { grid-row: auto; }
  .faq__layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .faq__left { position: static; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* Mobile overrides for Base.astro layout (nav + footer) — unscoped, so global.css is correct here.
   All component-level responsive styles live inside each component's own <style> block,
   since Astro scoped styles have higher specificity than global.css. */
/* Hamburger button — hidden on desktop */
.nav__hamburger {
  display: none;
}

/* Mobile drawer — hidden on desktop */
.nav__drawer {
  display: none;
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__name { font-size: 0.9375rem; white-space: nowrap; }
  .nav__actions .btn--ghost { display: none; }

  /* At page top: show hamburger, hide CTA */
  .nav__cta { display: none; }
  .nav__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .nav__hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
  }
  .nav__hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav__hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* On scroll: hide hamburger, show CTA */
  .nav--scrolled .nav__hamburger { display: none; }
  .nav--scrolled .nav__cta { display: inline-flex; }

  /* Mobile drawer */
  .nav__drawer {
    display: block;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    background: rgba(var(--rgb-base), 0.97);
    border-top: 1px solid var(--color-border-light);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .nav__drawer--open { max-height: 400px; }
  .nav__drawer-links {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1.5rem 1rem;
  }
  .nav__drawer-links a {
    padding: 0.75rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-light);
    transition: color 0.15s ease;
  }
  .nav__drawer-links a:last-child { border-bottom: none; }
  .nav__drawer-links a:hover { color: var(--color-text); }

  .footer__top { grid-template-columns: 1fr; gap: 2rem; }
  .footer__newsletter-form { flex-direction: column; }
}
