/* =========================================================
   AdBionic — Premium UI V2 (FINAL / COMPLETE)
   - Desktop: single-line nav
   - Mobile: hamburger + off-canvas drawer
   - Dark default + readable Light theme
   - HERO tiles: 3-up on desktop
   ========================================================= */

/* =========================
   TOKENS (DARK DEFAULT)
========================= */
:root{
  --bg:#020617;
  --bg-2:#06122a;
  --surface:#0b1220;
  --surface-2:#0a162e;
  --border:rgba(255,255,255,.08);

  --text:#e5e7eb;
  --muted:rgba(229,231,235,.72);

  --accent:#f5c542;

  --radius:16px;
  --radius-sm:12px;
  --max:1120px;

  --shadow: 0 14px 40px rgba(0,0,0,.35);
}

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

html,body{ margin:0; padding:0; }

body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: linear-gradient(180deg, var(--bg), #01040e);
  color: var(--text);
  line-height: 1.55;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
h1,h2,h3{ letter-spacing:-0.02em; margin:0 0 12px; color: var(--text); }
p{ margin:0 0 12px; color: var(--muted); }
li{ color: var(--muted); }

/* =========================
   LAYOUT
========================= */
.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.section-block{ padding: 72px 0; }

/* =========================
   HEADER / NAV (DESKTOP)
========================= */
header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2,6,23,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height: 84px;
  gap: 16px;
}

.logo-wrap img,
#site-logo{ height:30px; width:auto; }

.header-right{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

/* Desktop nav stays in one line */
nav{ min-width: 0; }
nav ul{
  display:flex;
  flex-wrap: nowrap;
  gap: 26px;
  list-style:none;
  margin:0;
  padding:0;
  white-space: nowrap;
}

nav a{
  position: relative;
  font-weight: 700;
  font-size: 18px;
  color: rgba(229,231,235,.7);
  padding: 10px 0 20px;
  display:inline-block;
}

nav a:hover,
nav a.active{ color: var(--text); }

nav a.active::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:6px;
  height:3px;
  background: var(--accent);
  border-radius: 2px;
}

/* =========================
   ICON BUTTONS (toggle + hamburger)
========================= */
#theme-toggle,
#mobile-menu-btn,
#mobile-close-btn{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

#theme-toggle:hover,
#mobile-menu-btn:hover,
#mobile-close-btn:hover{
  background: rgba(255,255,255,.08);
}

#theme-toggle svg,
#mobile-menu-btn svg,
#mobile-close-btn svg{ display:block; }

/* =========================
   HERO
========================= */
.hero-inner{ max-width: 860px; }

.hero-eyebrow{
  font-size:12px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-inner h1{
  font-size: clamp(36px,4.5vw,46px);
  line-height:1.08;
  margin: 0 0 18px;
}

.hero-inner p{
  font-size:18px;
  max-width:720px;
  margin: 0;
}

/* =========================
   BUTTONS
========================= */
.btn{
  padding:14px 22px;
  border-radius:12px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid transparent;
}

.btn-primary{
  background: var(--accent);
  color:#020617;
}

.btn-ghost{
  border-color: var(--border);
  color: var(--text);
  background: rgba(255,255,255,.02);
}

/* =========================
   GRIDS / CARDS
========================= */
.cards{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 22px;
  margin-top: 36px;
}

/* HERO tiles fix (only affects hero wrappers) */
@media (min-width: 901px){
  .hero-kpi-row,
  .hero-cards,
  .hero-inner .cards{
    display:grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 22px !important;
  }
}

.card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:24px;
}

/* =========================
   PILLS
========================= */
.pill-row{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 20px; }

.pill{
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.02);
}

.pill.active{
  border-color: rgba(245,197,66,.8);
  color: var(--text);
}

/* =========================
   FOOTER
========================= */
footer{
  border-top:1px solid var(--border);
  padding:56px 0;
}

/* =========================
   MOBILE DRAWER (OFF-CANVAS)
========================= */
#mobile-menu-btn{ display:none; } /* desktop hidden */
#mobile-overlay{ display:none; }
#mobile-drawer{ display:none; }
.mobile-nav{ display:none; }

@media (max-width: 900px){
  nav ul{ display:none; }                 /* hide desktop nav */
  #mobile-menu-btn{ display:inline-flex; } /* show hamburger */

  /* Global grids become 1 col */
  .cards{ grid-template-columns: 1fr; }
  .hero-inner h1{ font-size: 32px; }

  #mobile-overlay{
    display:block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 99;
  }

  #mobile-drawer{
    display:block;
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: linear-gradient(180deg, var(--bg-2), #040a18);
    border-left: 1px solid var(--border);
    padding: 22px;
    transition: right .25s ease;
    z-index: 100;
    overflow-y: auto;
  }

  #mobile-drawer.open{ right: 0; }
  #mobile-overlay.open{
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 14px;
    margin-bottom: 10px;
  }

  .mobile-drawer-head img{ height: 26px; width:auto; }

  .mobile-nav{ display:block; }
  .mobile-nav a{
    display:block;
    padding: 14px 2px;
    border-bottom: 1px solid var(--border);
    font-weight: 800;
    color: rgba(229,231,235,.9);
  }

  .mobile-nav a.active{ color: var(--text); }

  .mobile-drawer-footer{
    margin-top: 18px;
    color: rgba(229,231,235,.65);
    font-weight: 700;
    font-size: 12px;
  }
}

/* =========================
   LIGHT THEME (READABLE)
========================= */
body.theme-light{
  --bg:#f8fafc;
  --bg-2:#ffffff;
  --surface:#ffffff;
  --surface-2:#f1f5f9;
  --border: rgba(15,23,42,.14);

  --text:#0f172a;
  --muted: rgba(15,23,42,.72);

  background: linear-gradient(180deg,#f8fafc,#eef2ff);
}

body.theme-light header{ background: rgba(255,255,255,.9); }

body.theme-light nav a{
  color: rgba(15,23,42,.65);
}

body.theme-light nav a:hover,
body.theme-light nav a.active{
  color: var(--text);
}

/* readable text overrides in light */
body.theme-light p,
body.theme-light li{
  color: var(--muted);
}

body.theme-light .card{
  background: #ffffff;
  border-color: rgba(15,23,42,.14);
}

/* toggle visible in light */
body.theme-light #theme-toggle{
  background: rgba(15,23,42,.06);
  border-color: rgba(15,23,42,.18);
  color: var(--text);
}
body.theme-light #theme-toggle:hover{
  background: rgba(15,23,42,.12);
}
