/* ============================================================
   Social Media Analytics — Global Stylesheet
   Dark theme · Sticky navbar · Flexbox layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@600;700;800&family=Inter:wght@300;400;500&display=swap');

/* ── Reset & Tokens ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Palette */
  --bg-base:        #0a0b0f;
  --bg-surface:     #10121a;
  --bg-elevated:    #181c28;
  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.15);

  /* Brand accent — electric teal */
  --accent:         #00d4b4;
  --accent-dim:     rgba(0, 212, 180, 0.15);
  --accent-glow:    rgba(0, 212, 180, 0.35);

  /* Text */
  --text-primary:   #eef0f6;
  --text-secondary: #7a8099;
  --text-muted:     #3d4259;

  /* Nav */
  --nav-height:     64px;
  --nav-bg:         rgba(10, 11, 15, 0.85);

  /* Radii & Shadows */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --shadow-md:      0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow:    0 0 20px var(--accent-glow);

  /* Typography */
  --font-display:   'Syne', sans-serif;
  --font-body:      'Inter', sans-serif;
  --font-mono:      'DM Mono', monospace;

  /* Transitions */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:  150ms;
  --duration-med:   250ms;
}

/* ── Base ────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color var(--duration-fast) ease;
}

.navbar-brand:hover {
  color: var(--accent);
}

.brand-icon {
  font-size: 1.25rem;
  color: var(--accent);
  line-height: 1;
  text-shadow: var(--shadow-glow);
}

/* Navbar Menu */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    background var(--duration-fast) ease;
}

.dropdown-toggle:hover,
.dropdown.is-open .dropdown-toggle {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.chevron {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  transition: transform var(--duration-med) var(--ease-out);
}

.dropdown.is-open .chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu Panel */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity var(--duration-med) var(--ease-out),
    transform var(--duration-med) var(--ease-out),
    visibility 0ms var(--duration-med);
}

.dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity var(--duration-med) var(--ease-out),
    transform var(--duration-med) var(--ease-out),
    visibility 0ms 0ms;
}

/* Dropdown Items */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.dropdown-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.dropdown-item:hover .milestone-tag {
  color: var(--accent);
  border-color: var(--accent);
}

.milestone-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--text-muted);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  transition:
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

/* ── Page Container ──────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.container--narrow {
  max-width: 860px;
}

.container--wide {
  max-width: 1440px;
}

/* ── Typography Utilities ────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }

p {
  color: var(--text-secondary);
  max-width: 68ch;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

code { padding: 0.15em 0.45em; }
pre  { padding: 1.25rem; overflow-x: auto; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Focus / Accessibility ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-inner {
    padding: 0 1rem;
  }

  .navbar-brand span:not(.brand-icon) {
    font-size: 0.95rem;
  }

  .dropdown-toggle {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .container {
    padding: 2rem 1rem;
  }
}