/* ===========================
   GLOBAL — Brand, Reset, Layout (Universal Only)
   - Tokens, reset, typography base
   - Header / Nav (universal)
   - Buttons (universal)
   - Footer (universal)
   - Utilities + responsive
=========================== */

/* ===== Variables & Brand ===== */
:root {
  --primary: #1b65e0;
  --primary-dark: #1249a7;

  --dark: #0d0d0d;
  --light: #ffffff;

  --text: #0d0d0d;
  --muted: #6a6d75;
  --muted-2: #9599a2;

  --bg: #f5f7fa;
  --line: rgba(17, 24, 39, 0.12);

  --max-width: 1280px;
  --font-main: "Inter", sans-serif;

  /* Elevated UI Effects */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.28);

  /* Radius / Shadow */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.12);

  /* Spacing */
  --section-y: 90px;
}

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Images + media safe defaults */
img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Better keyboard focus */
:focus-visible {
  outline: 3px solid rgba(27, 101, 224, 0.35);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 9999;
  background: #fff;
  color: #111;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.skip-link:focus {
  left: 12px;
}

/* ===== Universal Layout ===== */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

section {
  padding: var(--section-y) 0;
}

/* ===== Typography (Base) ===== */
h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 16px;
}

.section-desc {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 42px;
}

/* ===== Buttons (Universal) ===== */
.btn-primary,
.btn-outline {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(27, 101, 224, 0.35);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(27, 101, 224, 0.25);
}

/* ===========================
   HEADER — Transparent + Glass (Universal)
=========================== */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 200;
  padding: 12px 0;
  transition: 0.35s ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.logo {
  font-weight: 900;
  font-size: 1.65rem;
  letter-spacing: 0.6px;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  font-weight: 500;
  padding: 4px 2px;
  position: relative;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
}

.nav a:hover {
  opacity: 0.9;
}

.nav a.active::after {
  content: "";
  height: 2px;
  width: 100%;
  background: var(--primary);
  position: absolute;
  bottom: -2px;
  left: 0;
}

/* CTA in nav */
.cta-nav {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
}

/* ===== Dropdown ===== */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  display: none;
  padding: 8px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.2s ease;
}
.dropdown-menu a:hover {
  background: #f3f5f8;
}

/* Hover open for desktop */
.dropdown:hover .dropdown-menu {
  display: block;
}

/* ===== Mobile Menu Toggle ===== */
.mobile-btn {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  color: inherit;
}

/* Mobile expanded state (JS toggles .open on .nav) */
.nav.open {
  display: flex !important;
  flex-direction: column;
  gap: 18px;
  background: var(--light);
  position: absolute;
  top: 100%;
  right: 0;
  padding: 18px 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

/* ===========================
   NAV COLOR CONTROL OVER HERO (Universal)
   - When header is transparent: white text
   - When scrolled (glass): dark text
=========================== */
.header:not(.scrolled) .logo,
.header:not(.scrolled) .nav a,
.header:not(.scrolled) .mobile-btn {
  color: #fff;
}

.header:not(.scrolled) .nav a.active::after {
  background: #fff;
}

/* CTA on hero: invert for premium contrast */
.header:not(.scrolled) .cta-nav {
  background: #fff;
  color: var(--dark) !important;
}

/* When scrolled: default dark */
.header.scrolled .logo,
.header.scrolled .nav a,
.header.scrolled .mobile-btn {
  color: var(--dark);
}

.header.scrolled .cta-nav {
  background: var(--primary);
  color: #fff !important;
}

/* ===========================
   FOOTER (Universal)
   NOTE: Footer markup will be injected into #site-footer later.
=========================== */
.footer {
  background: #fff;
  padding: 90px 0 42px;
  border-top: 1px solid #e9eaec;
  margin-top: 120px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 42px;
}

.footer h3 {
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.footer h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.footer a {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.footer-bottom {
  text-align: center;
  margin-top: 42px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ===========================
   RESPONSIVE (Universal)
=========================== */
@media (max-width: 900px) {
  .nav {
    display: none;
  }
  .mobile-btn {
    display: block;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
