/**
 * CrowdControl — doc-page shared styles
 * Used by: guide/index.html, privacy/index.html
 *
 * Token strategy: dark-first.
 * Bare :root defines the dark palette.
 * @media (prefers-color-scheme: light) guards :root:not([data-theme="dark"]).
 * [data-theme="dark"] / [data-theme="light"] handle explicit overrides.
 */

/* ── Doc-page token system ────────────────────────────────────── */
:root {
  --bg:         #111116;
  --surface:    #1c1c24;
  --surface-hi: #24242e;
  --border:     #30303e;
  --text:       #e6e6f0;
  --text-muted: #7676a0;

  --cyan:    #1cfff7;
  --magenta: #ff42e0;
  --lime:    #93e200;
  --amber:   #f5a623;
  --violet:  #b87aff;
  --orange:  #ff7040;

  /* Station-level accent colours */
  --c-world:   #1cfff7;
  --c-country: #ff42e0;
  --c-state:   #93e200;
  --c-city:    #f5a623;
  --c-zip:     #b87aff;
  --c-private: #ff7040;

  --accent-glow: rgba(28, 255, 247, 0.10);
  --accent-line: rgba(28, 255, 247, 0.25);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:         #f2f2f8;
    --surface:    #ffffff;
    --surface-hi: #ebebf5;
    --border:     #d8d8ea;
    --text:       #111116;
    --text-muted: #58587a;

    --cyan:    #c80090;
    --magenta: #a6009a;
    --lime:    #568600;
    --amber:   #a07000;
    --violet:  #7040c8;
    --orange:  #c04420;

    --c-world:   #c80090;
    --c-country: #a6009a;
    --c-state:   #568600;
    --c-city:    #a07000;
    --c-zip:     #7040c8;
    --c-private: #c04420;

    --accent-glow: rgba(200, 0, 144, 0.08);
    --accent-line: rgba(200, 0, 144, 0.22);
  }
}

:root[data-theme="light"] {
  --bg:         #f2f2f8;
  --surface:    #ffffff;
  --surface-hi: #ebebf5;
  --border:     #d8d8ea;
  --text:       #111116;
  --text-muted: #58587a;

  --cyan:    #c80090;
  --magenta: #a6009a;
  --lime:    #568600;
  --amber:   #a07000;
  --violet:  #7040c8;
  --orange:  #c04420;

  --c-world:   #c80090;
  --c-country: #a6009a;
  --c-state:   #568600;
  --c-city:    #a07000;
  --c-zip:     #7040c8;
  --c-private: #c04420;

  --accent-glow: rgba(200, 0, 144, 0.08);
  --accent-line: rgba(200, 0, 144, 0.22);
}

:root[data-theme="dark"] {
  --bg:         #111116;
  --surface:    #1c1c24;
  --surface-hi: #24242e;
  --border:     #30303e;
  --text:       #e6e6f0;
  --text-muted: #7676a0;

  --cyan:    #1cfff7;
  --magenta: #ff42e0;
  --lime:    #93e200;
  --amber:   #f5a623;
  --violet:  #b87aff;
  --orange:  #ff7040;

  --c-world:   #1cfff7;
  --c-country: #ff42e0;
  --c-state:   #93e200;
  --c-city:    #f5a623;
  --c-zip:     #b87aff;
  --c-private: #ff7040;

  --accent-glow: rgba(28, 255, 247, 0.10);
  --accent-line: rgba(28, 255, 247, 0.25);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  padding-top: 60px; /* cc-header height */
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shell layout ─────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  max-width: 1060px;
  margin: 0 auto;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2.25rem 1rem 2.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-brand .doc-label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-updated {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 0.6rem;
  line-height: 1.4;
}

.sidebar-meta {
  margin-top: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 0.6rem;
  line-height: 1.5;
}

.sidebar-meta a { color: var(--cyan); text-decoration: none; }
.sidebar-meta a:hover { text-decoration: underline; }

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.6rem;
  margin-bottom: 0.3rem;
}

.nav-group a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}

.nav-group a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-group a.active { color: var(--cyan); background: var(--accent-glow); }

/* ── Content area ─────────────────────────────────────────────── */
.content {
  padding: 2.75rem 3rem 6rem 3rem;
  min-width: 0;
}

/* ── Hero (doc style) ─────────────────────────────────────────── */
.hero {
  max-width: 640px;
  margin-bottom: 4rem;
  padding-top: 0.5rem;
}

.hero-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.1rem;
}

.hero-flag::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cyan);
  border-radius: 1px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero h1 .accent { color: var(--cyan); }

.hero .sub,
.hero .intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 54ch;
  line-height: 1.6;
}

.hero-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Sections ─────────────────────────────────────────────────── */
.section {
  max-width: 640px;
  margin-bottom: 4.5rem;
  scroll-margin-top: 1.5rem;
}

.eyebrow {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.section > h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  text-wrap: balance;
  color: var(--text);
  margin-bottom: 1rem;
}

.section > p,
.section-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 0.85rem;
  line-height: 1.65;
}

.section > p:last-child,
.section-body p:last-child { margin-bottom: 0; }

.section p strong { font-weight: 600; }

h3.sub {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.65rem;
}

/* ── Chips ────────────────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.4rem 0;
}

.chip {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.5rem;
  border-radius: 100px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Callout ──────────────────────────────────────────────────── */
.callout {
  background: var(--accent-glow);
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  padding: 0.875rem 1.1rem;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  margin: 1.25rem 0;
}

.callout strong { color: var(--cyan); }

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 3.5rem 0;
  max-width: 640px;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge-premium {
  display: inline-block;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93e200;
  border: 1px solid #93e200;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.5rem;
  opacity: 0.85;
}

.badge-soon {
  display: inline-block;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.5rem;
  opacity: 0.8;
}

/* ── Security measure lists ───────────────────────────────────── */
.security-list {
  list-style: none;
  margin: 0.75rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.security-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.security-list li::before {
  content: '✓';
  font-weight: 700;
  flex-shrink: 0;
  color: var(--lime);
}

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

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 680px) {
  .shell { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }

  .nav-group-label { display: none; }
  .nav-group { flex-direction: row; flex-wrap: wrap; gap: 0.2rem; }
  .sidebar-updated { display: none; }
  .sidebar-meta { display: none; }
  .content { padding: 1.75rem 1.25rem 4rem; }
}

/* ── Motion preferences ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
