/* ═══════════════════════════════════════════════════════════
   site.css — shared styles for 61insights.com
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a1628;
  --bg-alt:      #0d1e35;
  --card-bg:     #1e3a5f;
  --card-border: #1a3050;
  --accent:      #3b9eff;
  --accent-h:    #2a8af0;
  --text:        #ffffff;
  --muted:       #a8c0d6;
  --dim:         #4a6a88;
  --radius:      12px;
  --warn-bg:     #1f1500;
  --warn-border: #3d2e00;
  --warn-text:   #ffb74d;
  --info-bg:     #061428;
  --info-border: #0d2c50;
  --info-text:   #64b5f6;
  --code-bg:     rgba(255,255,255,0.07);
  --toc-width:   220px;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Docs pages: tighter typography, subtler palette */
body.docs {
  --card-bg:     #0f2035;
  --text:        #e8f0f8;
  --muted:       #7a9ab8;
  --radius:      8px;
  line-height: 1.65;
  font-size: 14px;
  min-height: auto;
}

/* Docs light mode: invert palette while preserving accent */
body.docs.light {
  --bg:          #ffffff;
  --bg-alt:      #f7f9fc;
  --card-bg:     #ffffff;
  --card-border: #e3e8ef;
  --text:        #1a2332;
  --muted:       #556776;
  --dim:         #8a99a8;
  --warn-bg:     #fff8e6;
  --warn-border: #f0d98a;
  --warn-text:   #8a6200;
  --info-bg:     #eaf4ff;
  --info-border: #b6d4f5;
  --info-text:   #1a5fb4;
  --code-bg:     rgba(10, 22, 40, 0.05);
}

body.docs.light .toc a:hover { background: rgba(59,158,255,0.1); }
body.docs.light .site-footer { border-top-color: var(--card-border); }

/* ── Nav ────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  height: 64px;
  width: auto;
  display: block;
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

.nav-links a.nav-signin {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a.nav-signin:hover { color: var(--accent-h); }

.nav-beta {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #ff8c00;
  letter-spacing: 0.04em;
}

/* Docs nav: full-width, sticky, bordered */
body.docs .site-nav {
  max-width: none;
  margin: 0;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: 100;
}

body.docs .nav-logo img {
  height: 48px;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

body.docs .site-footer {
  padding: 1.5rem;
  color: var(--dim);
  font-size: 0.8rem;
  border-top-color: var(--card-border);
}

body.docs .site-footer a { color: var(--dim); }
body.docs .site-footer a:hover { color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   Homepage
   ═══════════════════════════════════════════════════════════ */

.hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
  max-width: 760px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(59, 158, 255, 0.12);
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 2.25rem;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
}

.cards-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}

.cards-section h2 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 158, 255, 0.3);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════
   Content pages (privacy, terms)
   ═══════════════════════════════════════════════════════════ */

.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.content h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.effective-date {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.content p {
  font-size: 0.975rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content ul li {
  font-size: 0.975rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }

.notice {
  background: rgba(59, 158, 255, 0.08);
  border: 1px solid rgba(59, 158, 255, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════
   Docs
   ═══════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────── */
.page-wrap {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 2rem;
}

/* ── TOC sidebar (hidden in embed mode) ─────────────────── */
.toc {
  width: var(--toc-width);
  flex-shrink: 0;
  padding: 2rem 0;
  position: sticky;
  top: 57px;
  max-height: calc(100vh - 57px);
  overflow-y: auto;
  align-self: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(128,140,160,0.25) transparent;
}

.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb {
  background: rgba(128,140,160,0.25);
  border-radius: 3px;
}
.toc::-webkit-scrollbar-thumb:hover { background: rgba(128,140,160,0.45); }

.toc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.toc a {
  display: block;
  padding: 0.3rem 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}

.toc a:hover { color: var(--text); background: rgba(59,158,255,0.08); }
.toc a.toc-section { font-weight: 600; color: var(--accent); margin-top: 0.75rem; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Docs main content ──────────────────────────────────── */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 0 4rem;
}

.doc-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.doc-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* ── Section headers ────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--card-border);
}

/* ── Accordions ─────────────────────────────────────────── */
body.docs details {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  overflow: hidden;
}

body.docs summary {
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  transition: background 0.12s;
}

body.docs summary::-webkit-details-marker { display: none; }

body.docs summary::before {
  content: "\25B8";
  color: var(--accent);
  font-size: 10px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

body.docs details[open] > summary::before { transform: rotate(90deg); }
body.docs summary:hover { background: rgba(59,158,255,0.05); }

.acc-body {
  padding: 0.25rem 1rem 1.1rem;
}

/* ── Prose (scoped to docs) ─────────────────────────────── */
body.docs p { color: var(--muted); margin-bottom: 0.9rem; font-size: 13.5px; }
body.docs p:last-child { margin-bottom: 0; }

body.docs strong { color: var(--text); font-weight: 600; }
body.docs em { color: var(--muted); font-style: italic; }

body.docs h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 1rem 0 0.4rem;
}

body.docs h4:first-child { margin-top: 0; }

body.docs ol, body.docs ul {
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 0.9rem;
}

body.docs ol:last-child, body.docs ul:last-child { margin-bottom: 0; }

body.docs li { margin-bottom: 0.45rem; line-height: 1.65; }

body.docs code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--text);
}

body.docs pre {
  background: var(--code-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

/* ── Callout boxes ──────────────────────────────────────── */
.note-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0;
  font-size: 12.5px;
  color: var(--warn-text);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.6;
}

.note-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0;
  font-size: 12.5px;
  color: var(--info-text);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.6;
}

.note-icon { flex-shrink: 0; font-size: 14px; }

/* ── Embed mode ─────────────────────────────────────────── */
body.embed .site-nav,
body.embed .toc,
body.embed .site-footer { display: none; }

body.embed .page-wrap {
  max-width: 100%;
  padding: 0 1.25rem;
}

body.embed .docs-main {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

body.embed .doc-title { font-size: 1.2rem; }

/* ═══════════════════════════════════════════════════════════
   Mobile
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .toc { display: none; }
  .page-wrap { padding: 0 1rem; }
}

@media (max-width: 640px) {
  .site-nav { padding: 1rem 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .cards-section { padding: 1rem 1.25rem 4rem; }
  .cards { grid-template-columns: 1fr; }
  .content { padding: 2rem 1.25rem 4rem; }
}
