/* ============================================================
   Revenue Growth Guide — Global Design System
   Loaded on every page. Overrides inline body constraints
   and replaces the old tab nav with the new sticky nav.
   ============================================================ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── ROOT TOKENS ── */
:root {
  color-scheme: light dark;

  /* Brand */
  --orange:  #f4622a;
  --navy:    #0f1f3d;
  --teal:    #00a896;

  /* Light surfaces */
  --bg:      #ffffff;
  --bg2:     #f7f9fc;
  --bg3:     #eef2f7;

  /* Light borders */
  --border:  #e4e9ef;
  --border2: #cdd4dc;

  /* Light text */
  --text:    #111827;
  --text2:   #374151;
  --text3:   #6b7280;
  --text4:   #9ca3af;

  /* Radii (keep existing) */
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Layout */
  --nav-h:     64px;
  --content-w: 1100px;
  --nav-w:     1280px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0b1220;
    --bg2:     #111b2d;
    --bg3:     #182237;
    --border:  #1e2f45;
    --border2: #2a3f5a;
    --text:    #f0f4f8;
    --text2:   #94afc8;
    --text3:   #6b8aaa;
    --text4:   #4a6a8a;
  }
}

/* ── GLOBAL ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background: var(--bg);
  max-width: var(--content-w) !important;
  margin: 0 auto !important;
  padding-top: var(--nav-h) !important;
}

/* Widen old 900px content wrapper divs */
div[style*="max-width:900px"],
div[style*="max-width: 900px"] {
  max-width: var(--content-w) !important;
  padding: 40px !important;
}

@media (max-width: 680px) {
  div[style*="max-width:900px"],
  div[style*="max-width: 900px"] {
    padding: 24px 18px !important;
  }
  body { padding-top: var(--nav-h) !important; }
}

/* ── HIDE OLD TAB NAV ── */
/* Hidden immediately — replaced by .rgg-nav injected via nav.js */
.tabs,
nav.tabs {
  display: none !important;
}

/* ── NEW STICKY NAV ── */
.rgg-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 10px rgba(0,0,0,0.05);
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@media (prefers-color-scheme: dark) {
  .rgg-nav {
    background: rgba(11, 18, 32, 0.96);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.4);
  }
}

.rgg-nav-inner {
  max-width: var(--nav-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 36px;
  display: flex;
  align-items: center;
}

/* ── Logo ── */
.rgg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: 32px;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.rgg-logo:hover { opacity: 0.82; }

.rgg-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.rgg-logo-mark img,
.rgg-logo-mark svg { width: 100%; height: 100%; display: block; }

.rgg-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.rgg-logo-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.rgg-logo-sub {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Nav links ── */
.rgg-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.rgg-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text3);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1;
}
.rgg-nav-link:hover { color: var(--text); background: var(--bg2); }
.rgg-nav-link.active { color: var(--text); font-weight: 600; }

.rgg-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.45;
  transition: transform 0.2s, opacity 0.15s;
  display: block;
}

/* ── Experiments dropdown ── */
.rgg-dropdown { position: relative; }

.rgg-dropdown:hover .rgg-nav-link,
.rgg-dropdown.open .rgg-nav-link {
  color: var(--text);
  background: var(--bg2);
}

.rgg-dropdown:hover .rgg-chevron,
.rgg-dropdown.open .rgg-chevron {
  transform: rotate(180deg);
  opacity: 0.7;
}

.rgg-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 252px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 6px 6px; /* top padding bridges the gap — no hover dead zone */
  box-shadow: 0 8px 28px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.25s;
  pointer-events: none;
  z-index: 200;
}

@media (prefers-color-scheme: dark) {
  .rgg-dropdown-panel {
    box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.35);
  }
}

.rgg-dropdown:hover .rgg-dropdown-panel,
.rgg-dropdown.open .rgg-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
  pointer-events: auto;
}

.rgg-dropdown-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.12s;
}
.rgg-dropdown-all:hover { background: var(--bg2); }

.rgg-dropdown-all-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rgg-dropdown-count {
  font-size: 11px;
  color: var(--text4);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 500;
}

.rgg-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}

.rgg-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.rgg-dropdown-item:hover { background: var(--bg2); color: var(--text); }

.rgg-dropdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Nav right CTAs ── */
.rgg-nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 8px;
  visibility: hidden; /* shown after auth check */
}
.rgg-nav-right.ready { visibility: visible; }

.rgg-nav-signin {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.rgg-nav-signin:hover { color: var(--text); background: var(--bg2); }

.rgg-nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff !important;
  background: var(--orange);
  text-decoration: none;
  border-radius: 8px;
  transition: opacity 0.15s, transform 0.12s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.rgg-nav-cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── HOME PAGE HERO (full-viewport-width breakout) ── */
html { overflow-x: hidden; }

.rgg-page-hero {
  /* Break out of the 1100px body constraint */
  width: 100vw;
  margin-left: calc(50% - 50vw);

  background: linear-gradient(170deg, #0d1a30 0%, #0f1f3d 45%, #0b1526 100%);
  padding-top: 80px;
  padding-bottom: 0;
  overflow: hidden;
  position: relative;
}

/* Decorative radial glows */
.rgg-page-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: 12%;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,98,42,0.11) 0%, transparent 65%);
  pointer-events: none;
}
.rgg-page-hero::after {
  content: '';
  position: absolute;
  top: 10%; left: -6%;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,168,150,0.08) 0%, transparent 65%);
  pointer-events: none;
}

.rgg-hero-text {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px 52px;
  position: relative;
  z-index: 1;
}

.rgg-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244,98,42,0.13);
  border: 1px solid rgba(244,98,42,0.28);
  color: #f09070;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
}

.rgg-hero-h1 {
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.rgg-hero-h1 .accent { color: var(--orange); }

.rgg-hero-sub {
  font-size: 18px;
  color: #7a9bbf;
  line-height: 1.65;
  margin-bottom: 36px;
  font-weight: 400;
}

.rgg-hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.rgg-hero-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  color: #fff !important;
  background: var(--orange);
  border-radius: 10px;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.12s;
}
.rgg-hero-btn-primary:hover { opacity: 0.88; transform: translateY(-2px); }

.rgg-hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.rgg-hero-btn-secondary:hover { background: rgba(255,255,255,0.12); color: #fff; }

.rgg-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rgg-hero-stat {
  text-align: center;
  padding: 0 28px;
}
.rgg-hero-stat + .rgg-hero-stat {
  border-left: 1px solid rgba(255,255,255,0.1);
}

.rgg-hero-stat-n {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.rgg-hero-stat-l {
  font-size: 12px;
  color: #527090;
  margin-top: 5px;
  font-weight: 500;
}

/* Screenshot */
.rgg-hero-img-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.rgg-hero-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 -4px 40px rgba(0,0,0,0.55),
    0 -20px 80px rgba(0,0,0,0.25);
}

@media (max-width: 680px) {
  .rgg-page-hero { padding-top: 48px; }
  .rgg-hero-text { padding: 0 18px 40px; }
  .rgg-hero-h1   { letter-spacing: -0.5px; }
  .rgg-hero-sub  { font-size: 16px; }
  .rgg-hero-img-wrap { padding: 0 12px; }
  .rgg-hero-stat { padding: 0 18px; }
}

/* ── Mobile ── */
@media (max-width: 840px) {
  .rgg-nav-links       { display: none; }
  .rgg-nav-inner       { padding: 0 20px; }
  .rgg-logo-text       { display: none; }
  .rgg-nav-right .rgg-nav-signin { display: none; }
}
