/* ClearAI HQ — shared site chrome (nav, footer, mobile drawer, theme toggle) */

/* ── Token scope: chrome components always get the right palette ── */
nav, footer, #mobile-drawer {
  --obsidian:    #080b10;
  --deep:        #0d1117;
  --surface:     #121820;
  --emerald:     #00c875;
  --emerald-dim: #00a85e;
  --gold:        #f0b429;
  --cream:       #f0ece4;
  --muted:       rgba(240,236,228,.62);
  --faint:       rgba(240,236,228,.12);
  --border:      rgba(240,236,228,.08);
  --border-em:   rgba(0,200,117,.25);
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --theme-speed:  0.5s;
}
html.light nav,
html.light footer,
html.light #mobile-drawer {
  --obsidian:    #f5f2ed;
  --deep:        #ede9e2;
  --surface:     #ffffff;
  --emerald:     #0a7a4a;
  --emerald-dim: #085e38;
  --gold:        #b07d1a;
  --cream:       #1a1a1a;
  --muted:       rgba(26,26,26,.66);
  --faint:       rgba(26,26,26,.06);
  --border:      rgba(26,26,26,.1);
  --border-em:   rgba(10,122,74,.3);
}

/* ── Theme transitions ── */
.theme-transitioning nav,
.theme-transitioning footer,
.theme-transitioning #mobile-drawer,
.theme-transitioning nav *,
.theme-transitioning footer *,
.theme-transitioning #mobile-drawer * {
  transition:
    background 0.5s ease,
    background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease !important;
}

/* ── Navigation ── */
nav#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 clamp(1.5rem,5vw,4rem);
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(8,11,16,0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}
nav#navbar.scrolled { background: rgba(8,11,16,0.92); }
html.light nav#navbar { background: rgba(245,242,237,0.75); border-bottom-color: rgba(26,26,26,0.1); }
html.light nav#navbar.scrolled { background: rgba(245,242,237,0.96); }

.nav-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.nav-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dim) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(0,200,117,0.4), inset 0 1px 0 rgba(255,255,255,.15);
  flex-shrink: 0;
}
.nav-logo-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  letter-spacing: -.01em; line-height: 1;
}
.nav-logo-text .clear { color: var(--cream); }
html.light .nav-logo-text .clear { color: #1a1a1a; }
.nav-logo-text .ai {
  color: var(--emerald);
  text-shadow: 0 0 18px rgba(0,200,117,.55), 0 0 40px rgba(0,200,117,.2);
}
.nav-logo-text .hq {
  font-size: .55rem; font-weight: 700; letter-spacing: .09em;
  background: linear-gradient(135deg, var(--gold) 0%, #e8a617 100%);
  color: #080b10;
  padding: 2px 6px; border-radius: 5px; margin-left: 4px;
  font-family: var(--font-body); vertical-align: middle;
  box-shadow: 0 2px 8px rgba(240,180,41,.35), inset 0 1px 0 rgba(255,255,255,.3);
}

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  font-size: .875rem; color: rgba(240,236,228,.65); text-decoration: none;
  padding: 8px 14px; border-radius: 8px;
  transition: color .15s, background .15s;
  font-weight: 500; letter-spacing: .01em;
}
.nav-links a:hover { color: var(--cream); background: var(--faint); }
.nav-links a.active { color: var(--emerald) !important; }
html.light .nav-links a { color: rgba(26,26,26,.8); }
html.light .nav-links a:hover { color: #059669; background: rgba(10,122,74,.08); }

.nav-signin {
  font-size: .875rem; color: rgba(240,236,228,.75) !important; padding: 7px 16px;
  border-radius: 8px; border: 1px solid rgba(0,212,138,.28); font-weight: 500;
  transition: all .2s; text-decoration: none;
}
.nav-signin:hover { background: rgba(0,212,138,.08); border-color: var(--emerald); color: var(--cream) !important; }
html.light .nav-signin { color: rgba(26,26,26,.75) !important; border-color: rgba(10,122,74,.35) !important; }
html.light .nav-signin:hover { color: #059669 !important; background: rgba(10,122,74,.07) !important; }

.nav-cta {
  background: var(--emerald); color: var(--obsidian) !important;
  font-weight: 600 !important; border-radius: 9px !important;
  box-shadow: 0 0 20px rgba(0,200,117,0.35);
  transition: all .2s !important;
}
.nav-cta:hover {
  background: #00e688 !important;
  box-shadow: 0 0 32px rgba(0,200,117,0.55) !important;
  transform: translateY(-1px);
}

.nav-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform .08s linear;
  pointer-events: none;
}

/* ── Theme toggle ── */
.theme-toggle {
  position: relative;
  width: 56px; height: 28px;
  border-radius: 99px; cursor: pointer;
  padding: 3px;
  background: rgba(240,236,228,0.1);
  border: 1px solid var(--border);
  display: flex; align-items: center;
  transition: background var(--theme-speed), border-color var(--theme-speed);
  flex-shrink: 0;
}
html.light .theme-toggle { background: rgba(10,122,74,0.1); border-color: rgba(10,122,74,0.25); }
.theme-toggle-track {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px;
  pointer-events: none;
}
.toggle-icon { font-size: .7rem; line-height: 1; transition: opacity .3s; }
.toggle-icon-moon { opacity: 1; }
.toggle-icon-sun  { opacity: .4; }
html.light .toggle-icon-moon { opacity: .4; }
html.light .toggle-icon-sun  { opacity: 1; }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dim));
  box-shadow: 0 2px 8px rgba(0,200,117,0.4);
  transition: transform var(--theme-speed) cubic-bezier(.34,1.56,.64,1), background var(--theme-speed);
  pointer-events: none;
}
html.light .toggle-thumb {
  transform: translateX(28px);
  background: linear-gradient(135deg, #0a7a4a, #085e38);
  box-shadow: 0 2px 8px rgba(10,122,74,0.4);
}

/* ── Mobile button ── */
#mobile-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: #f0ece4;
  padding: 8px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}
html.light #mobile-btn { color: #1a1a1a; border-color: rgba(128,128,128,.3); }
@media(max-width:1024px) {
  #mobile-btn { display: block; }
  nav#navbar .nav-links { display: none !important; }
}

/* ── Mobile drawer ── */
#mobile-drawer {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #05080f;
  z-index: 9999;
  flex-direction: column;
  padding: 24px;
  color: #f0ece4;
  transition: background .3s, color .3s;
}
#mobile-drawer * { box-sizing: border-box; }
#mobile-drawer.light-mode { background: #f0ece4; color: #111; }
#mobile-drawer.light-mode a:not(.md-trial):not(.md-signin) {
  color: #111 !important; border-bottom-color: rgba(0,0,0,.12) !important; font-weight: 700;
}
#mobile-drawer.light-mode .md-signin { color: #111 !important; border-color: rgba(0,0,0,.3) !important; font-weight: 600 !important; }
#mobile-drawer.light-mode #mobile-close { color: #111 !important; border-color: rgba(0,0,0,.3) !important; }
#mobile-drawer.light-mode #md-theme-row { color: #333 !important; border-bottom-color: rgba(0,0,0,.12) !important; }
#mobile-drawer.light-mode #md-theme-label { color: #333 !important; }
#mobile-drawer.open { display: flex; }
#mobile-drawer .md-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px;
}
#mobile-drawer a {
  display: block; color: #f0ece4 !important; font-size: 1.1rem; font-weight: 600;
  padding: 14px 16px; border-radius: 12px; text-decoration: none;
  transition: background .15s; border-bottom: 1px solid rgba(255,255,255,.06);
}
#mobile-drawer a:hover { background: rgba(0,212,138,.1) !important; color: #00d48a !important; }
#mobile-drawer .md-signin {
  color: rgba(240,236,228,.7) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  border-radius: 12px !important; text-align: center; margin-top: 16px;
  border-bottom: 1px solid rgba(255,255,255,.2) !important;
}
#mobile-drawer .md-trial {
  background: linear-gradient(135deg,#00d48a,#007a50);
  color: #000 !important; font-weight: 700; text-align: center;
  margin-top: 8px; border-bottom: none !important; border-radius: 12px;
}
#mobile-close {
  background: none; border: 1px solid rgba(255,255,255,.15); color: #f0ece4;
  padding: 8px 13px; border-radius: 8px; cursor: pointer; font-size: 1.3rem;
}

/* ── Footer ── */
footer#site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(8,11,16,0.8);
  backdrop-filter: blur(12px);
  padding: clamp(48px,6vw,80px) clamp(1rem,5vw,4rem) clamp(28px,4vw,40px);
}
html.light footer#site-footer {
  background: rgba(237,233,226,0.9);
  border-top-color: rgba(26,26,26,0.1);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; max-width: 1200px; margin: 0 auto 48px;
}
@media(max-width:700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media(max-width:500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-tagline { font-size: .85rem; color: var(--muted); line-height: 1.7; max-width: 240px; margin-top: 12px; font-weight: 300; }
.footer-col h3 { font-family: var(--font-display); font-size: .9rem; font-weight: 600; margin-bottom: 16px; color: var(--cream); }
html.light .footer-col h3 { color: #1a1a1a; }
.footer-col a { display: block; font-size: .84rem; color: var(--muted); text-decoration: none; margin-bottom: 9px; transition: color .15s; font-weight: 300; }
.footer-col a:hover { color: var(--emerald); }

.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: rgba(240,236,228,.3); flex-wrap: wrap; gap: 10px;
}
html.light .footer-bottom { color: rgba(26,26,26,.3); border-top-color: rgba(26,26,26,.08); }
.footer-bottom-logo { font-family: var(--font-display); font-weight: 700; color: var(--emerald); font-size: .9rem; text-shadow: 0 0 12px rgba(0,200,117,.3); }
.footer-bottom a { color: rgba(240,236,228,.3); text-decoration: none; transition: color .15s; }
html.light .footer-bottom a { color: rgba(26,26,26,.3); }
.footer-bottom a:hover { color: var(--emerald); }

.footer-brand-logo { display:flex; align-items:center; gap:12px; margin-bottom:14px; text-decoration:none; }
.footer-brand-icon {
  width:46px; height:46px; flex-shrink:0;
  background:linear-gradient(135deg,#0f1e30,#081526);
  border:1px solid rgba(0,200,117,.22); border-radius:13px;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 20px rgba(0,200,117,.15),inset 0 1px 0 rgba(255,255,255,.09);
}
.footer-brand-sub { font-size:.63rem; color:var(--muted); letter-spacing:.1em; text-transform:uppercase; margin-top:3px; font-weight:500; }
.footer-social { display:flex; align-items:center; gap:8px; margin-top:20px; }
.footer-social a {
  width:32px; height:32px; border-radius:8px; border:1px solid var(--border);
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--muted); transition:all .2s; text-decoration:none; flex-shrink:0;
}
.footer-social a:hover { border-color:var(--border-em); color:var(--cream); background:rgba(255,255,255,.04); }
.footer-badges { display:flex; flex-direction:column; gap:10px; margin-top:24px; }
.stripe-badge-3d {
  display:inline-flex; align-items:center; gap:12px;
  background:linear-gradient(135deg,rgba(99,91,255,.1),rgba(99,91,255,.05));
  border:1px solid rgba(99,91,255,.22); border-radius:12px; padding:11px 16px;
  box-shadow:0 4px 18px rgba(99,91,255,.13),inset 0 1px 0 rgba(255,255,255,.07);
}
html.light .stripe-badge-3d {
  background:linear-gradient(135deg,rgba(99,91,255,.07),rgba(99,91,255,.03));
  border-color:rgba(99,91,255,.18);
  box-shadow:0 2px 10px rgba(99,91,255,.08);
}
