/* ============================================================
   AIBE Pass Engine — main.css  v2
   Shared: tokens, reset, typography, nav, footer, sticky bar
   ============================================================ */

/* ── 1. DESIGN TOKENS ────────────────────────────────────── */
:root {
  /* Brand colours — update these to rebrand */
  --c-navy:    #1a2744;   /* primary / authority */
  --c-navy-d:  #0f1a33;   /* darker navy for gradients */
  --c-navy-l:  #253660;   /* hover state */
  --c-gold:    #c9a84c;   /* accent — achievement */
  --c-gold-l:  #deba6a;   /* gold hover */
  --c-gold-txt:#8c722a;   /* gold on white — WCAG AA text contrast */
  --c-green:   #2d7a4f;   /* success / free tier */
  --c-red:     #b91c1c;   /* error / locked */

  --c-bg:      #f8f9fa;   /* page background */
  --c-surface: #ffffff;   /* card / panel surface */
  --c-cream:   #faf8f3;   /* warm section background */
  --c-border:  #e0dbd4;   /* borders */
  --c-text:    #1a1a2e;   /* body copy */
  --c-muted:   #56566a;   /* secondary copy */
  --c-faint:   #6c6c86;   /* captions / labels */

  /* Typography — no CDN, system fonts only */
  --f-head: Georgia, 'Times New Roman', serif;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --f-mono: ui-monospace, 'Courier New', monospace;

  /* Spacing scale (4px base) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Layout */
  --max-w:     1100px;
  --radius:    6px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --ease:      0.18s ease;

  /* Nav height — used for scroll offset */
  --nav-h: 60px;
}

/* ── 2. RESET ────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

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; }

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

/* ── 3. BASE TYPOGRAPHY ──────────────────────────────────── */
body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

/* Headings: Georgia gives legal/authority feel without CDN */
h1, h2, h3, h4 {
  font-family: var(--f-head);
  line-height: 1.2;
  color: var(--c-navy);
}

h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { max-width: 68ch; }

/* ── 4. UTILITIES ────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

@media (max-width: 479px) {
  .container { padding-inline: var(--s-4); }
}

@media (max-width: 340px) {
  .nav-hamburger { width: 38px; height: 38px; }
  .nav-logo { font-size: 1rem; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Section wrapper defaults */
.section { padding: var(--s-20) 0; }
.section--cream { background-color: var(--c-cream); }
.section--dark  { background-color: var(--c-navy); }

.section-header {
  text-align: center;
  margin-bottom: var(--s-12);
}
.section-header h2 { margin-bottom: var(--s-3); }
.section-sub {
  font-size: 1.0625rem;
  color: var(--c-muted);
  max-width: 54ch;
  margin-inline: auto;
}

/* ── 5. NAVIGATION ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 2px 10px rgba(26,39,68,.07);
}

.nav-bar {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: var(--s-6);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-navy);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo span { color: var(--c-gold-txt); }
.nav-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Desktop links — hidden on mobile */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  flex: 1;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-muted);
  transition: color var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--c-navy); }

/* Right actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}

.nav-login {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 var(--s-4);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-muted);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--ease), color var(--ease);
  white-space: nowrap;
}
.nav-login:hover { border-color: var(--c-navy); color: var(--c-navy); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 var(--s-4);
  background: var(--c-gold);
  color: var(--c-navy);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: background var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-cta:hover { background: var(--c-gold-l); color: var(--c-navy); }

/* Hamburger button — mobile only */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: var(--s-2);
  cursor: pointer;
  background: none;
  border: none;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-navy);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
  transform-origin: center;
}

/* Animated hamburger → X when open */
.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; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: var(--s-4) var(--s-6) var(--s-6);
  gap: var(--s-1);
}
.nav-drawer.is-open { display: flex; }
.nav-drawer a {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 var(--s-3);
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-text);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.nav-drawer a:hover { background: var(--c-bg); color: var(--c-navy); }
.nav-drawer .drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  background: var(--c-gold);
  color: var(--c-navy);
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-top: var(--s-3);
}
.nav-drawer .drawer-cta:hover { background: var(--c-gold-l); color: var(--c-navy); }

/* Prevent body scroll when drawer open */
body.nav-open { overflow: hidden; }

@media (max-width: 899px) {
  .nav-links  { display: none; }
  .nav-login  { display: none; }
  .nav-cta    { display: none; }
  .nav-hamburger { display: flex; }

  .nav-bar {
    gap: var(--s-3);
  }

  /* Override container on the nav specifically */
  .site-header .container { padding-inline: var(--s-4); }
}

/* ── 6. SHARED BUTTONS ───────────────────────────────────── */
/* Used across all pages */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--s-6);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  white-space: nowrap;
  min-height: 48px;
  text-align: center;
}

.btn-primary {
  background: var(--c-navy);
  color: #fff;
  border-color: var(--c-navy);
}
.btn-primary:hover { background: var(--c-navy-l); border-color: var(--c-navy-l); color: #fff; }

.btn-gold {
  background: var(--c-gold);
  color: var(--c-navy);
  border-color: var(--c-gold);
  font-weight: 700;
}
.btn-gold:hover { background: var(--c-gold-l); border-color: var(--c-gold-l); color: var(--c-navy); }

.btn-outline {
  background: transparent;
  color: var(--c-navy);
  border-color: var(--c-navy);
}
.btn-outline:hover { background: var(--c-navy); color: #fff; }

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.5);
}
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }

.btn-sm { min-height: 40px; padding: 0 var(--s-4); font-size: 0.9rem; }
.btn-lg { min-height: 54px; padding: 0 var(--s-8); font-size: 1.0625rem; }
.btn-full { width: 100%; }

/* ── 7. FOOTER ───────────────────────────────────────────── */
.site-footer {
  background: var(--c-navy-d);
  color: rgba(250,248,243,.7);
  padding: var(--s-16) 0 var(--s-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: var(--s-12);
  margin-bottom: var(--s-8);
}

.footer-brand {
  display: block;
  font-family: var(--f-head);
  font-size: 1.2rem;
  color: var(--c-gold);
  margin-bottom: var(--s-3);
}
.footer-tagline {
  font-size: 0.875rem;
  line-height: 1.55;
  max-width: none;
}

.footer-col-title {
  font-family: var(--f-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(250,248,243,.56);
  margin-bottom: var(--s-4);
  max-width: none;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.footer-links a {
  font-size: 0.875rem;
  transition: color var(--ease);
}
.footer-links a:hover { color: var(--c-gold); }

.footer-legal {
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(250,248,243,.6);
  max-width: none;
}
.footer-legal + .footer-legal { margin-top: var(--s-3); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: var(--s-6);
  font-size: 0.75rem;
  color: rgba(250,248,243,.52);
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
}

@media (max-width: 767px) {
  .site-footer { padding: var(--s-12) 0 var(--s-6); }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }
  /* Add extra bottom space for sticky CTA */
  body { padding-bottom: 76px; }
}

/* ── 8. STICKY MOBILE BOTTOM BAR ─────────────────────────── */
.sticky-bar {
  display: none;
}

@media (max-width: 899px) {
  .sticky-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--c-navy-d);
    border-top: 2px solid var(--c-gold);
    padding: var(--s-3) var(--s-4);
    gap: var(--s-3);
    z-index: 300;
    align-items: center;
    transition: transform .25s ease;
  }

  /* JS hides this when hero CTA is visible */
  .sticky-bar.is-hidden { transform: translateY(100%); }

  .sticky-bar-text {
    font-size: 0.75rem;
    color: rgba(250,248,243,.6);
    line-height: 1.3;
    flex-shrink: 1;
    min-width: 0;
    max-width: none;
    overflow: hidden;
  }
  .sticky-bar-text strong {
    display: block;
    font-size: 0.825rem;
    color: rgba(250,248,243,.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sticky-bar .btn {
    flex: 1;
    flex-shrink: 0;
    min-height: 44px;
    font-size: 0.85rem;
    padding-inline: var(--s-3);
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .sticky-bar-text { display: none; }
}
