/* ============================================================
   canonical-developer.css
   ONE design system for the REM Labs developer track.
   Source of truth: developers.html (light) + console.html (dark).
   Used by: developers, console, api, api-reference, docs, cookbook,
            benchmarks, benchmark-live, benchmark-tool, benchmark-dataset,
            changelog, cli-login, adapters, architecture, compare,
            pricing-developer.
   Last updated: 2026-04-25
   ============================================================ */

/* -- 1. DESIGN TOKENS -------------------------------------- */
:root {
  /* Surfaces — light is the default for developer marketing pages */
  --bg:        #ffffff;
  --bg2:       #f8f8fa;
  --bg3:       #f0f0f5;

  /* Borders */
  --border:    rgba(0,0,0,0.07);
  --border2:   rgba(0,0,0,0.12);

  /* Text */
  --text:      #1d1d1f;
  --text2:     #6e6e73;
  --text3:     #aeaeb2;

  /* Brand accent — indigo across the dev track */
  --accent:        #6366f1;
  --accent2:       #818cf8;
  --accent-bg:     rgba(99,102,241,0.06);
  --accent-border: rgba(99,102,241,0.2);

  /* Status */
  --green:     #34c759;
  --red:       #ef4444;
  --warn:      #e6a73b;

  /* Typography */
  --font:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --nav-h:     52px;
  --max-w:     1160px;
  --r:         14px;

  /* Code-block surface — same in both themes for maximum consistency */
  --code-bg:    #1a1a2e;
  --code-fg:    #e4e4e7;
  --code-muted: #6a737d;
  --code-kw:    #818cf8;
  --code-fn:    #34d399;
  --code-str:   #fbbf24;
  --code-cm:    #6b7280;
  --code-num:   #f472b6;
  --code-prop:  #67e8f9;

  /* Shadows */
  --shadow-1:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-2:  0 4px 24px rgba(0,0,0,0.06);
}

/* -- 2. DARK-THEME OVERRIDE -------------------------------- */
/* Pages opt in with <html data-theme="dark"> (e.g. console, cli-login). */
html[data-theme="dark"] {
  --bg:        #0a0a0f;
  --bg2:       #12121a;
  --bg3:       #1a1a24;

  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.14);

  --text:      #f0f0f5;
  --text2:     #a0a0b0;
  --text3:     #606070;

  --accent-bg:     rgba(124,124,248,0.14);
  --accent-border: rgba(124,124,248,0.30);

  --shadow-1:  0 1px 3px rgba(0,0,0,0.30);
  --shadow-2:  0 4px 20px rgba(0,0,0,0.35);
}

/* -- 3. RESET + BASE --------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code, pre, .mono { font-family: var(--mono); }

/* Skip link for keyboard nav */
.skip-link {
  position: absolute; top: -40px; left: 8px;
  padding: 8px 14px; background: var(--accent); color: #fff;
  border-radius: 8px; font-size: 0.84rem; font-weight: 500;
  z-index: 10000; text-decoration: none;
}
.skip-link:focus { top: 8px; }

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

/* -- 4. REVEAL --------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }

/* -- 5. NAV ------------------------------------------------ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .nav { background: rgba(10,10,15,0.82); }
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 28px;
  height: 100%; display: flex; align-items: center;
  justify-content: space-between; position: relative;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text); letter-spacing: 0.01em;
  text-decoration: none; flex-shrink: 0; line-height: 1;
}
.nav-logo svg { animation: orbit-spin 10s linear infinite; display: block; flex-shrink: 0; }
@keyframes orbit-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.nav-right { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.nav-link {
  padding: 6px 12px; border-radius: 8px;
  font-size: 0.84rem; font-weight: 400;
  color: var(--text2);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--bg2); }
.nav-link.active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; flex-shrink: 0; }
.nav-signin {
  padding: 7px 14px; border-radius: 8px;
  font-size: 0.84rem; font-weight: 500;
  color: var(--text2); border: 1px solid var(--border2);
  transition: all 0.15s; text-decoration: none; white-space: nowrap;
}
.nav-signin:hover { color: var(--text); border-color: var(--text2); }
.nav-cta {
  padding: 7px 16px; border-radius: 8px;
  font-size: 0.84rem; font-weight: 500;
  background: var(--text); color: var(--bg);
  transition: opacity 0.15s, transform 0.15s;
  text-decoration: none; white-space: nowrap;
}
.nav-cta:hover { opacity: 0.82; transform: translateY(-1px); }
.nav-dash { display: none; }
.nav-dash.visible { display: flex; }
.hamburger {
  display: none; flex-direction: column; gap: 4px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s; background: none; border: none;
}
.hamburger:hover { background: var(--bg2); }
.hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text2); border-radius: 2px;
  transition: all 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.mob-menu {
  display: none; flex-direction: column;
  background: rgba(255,255,255,0.96);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 20px; gap: 2px;
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
}
html[data-theme="dark"] .mob-menu { background: rgba(10,10,15,0.96); }
.mob-menu.open { display: flex; }
.mob-menu a {
  padding: 10px 12px; border-radius: 8px;
  font-size: 0.9rem; color: var(--text2);
  transition: background 0.12s, color 0.12s;
}
.mob-menu a:hover { background: var(--bg2); color: var(--text); }
.mob-divider { height: 1px; background: var(--border); margin: 6px 0; }
.mob-cta {
  background: var(--text) !important;
  color: var(--bg) !important;
  font-weight: 500 !important;
  text-align: center; margin-top: 4px;
}
@media (max-width: 720px) {
  .nav-right .nav-link, .nav-signin { display: none !important; }
  .hamburger { display: flex !important; }
}

/* -- 6. HERO ----------------------------------------------- */
.hero {
  padding: calc(var(--nav-h) + 80px) 28px 60px;
  text-align: center; position: relative; overflow: hidden;
}
.hero-glow {
  position: absolute; top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.07) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 660px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.6; }
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 600; letter-spacing: -0.03em;
  line-height: 1.08; color: var(--text);
}
.hero-sub {
  font-size: 1.05rem; font-weight: 400; color: var(--text2);
  line-height: 1.7; max-width: 520px;
}
.hero-actions {
  display: flex; gap: 12px; margin-top: 8px;
  flex-wrap: wrap; justify-content: center;
}

/* -- 7. BUTTONS -------------------------------------------- */
.btn-primary {
  padding: 12px 24px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500;
  background: var(--accent); color: #fff;
  transition: opacity 0.15s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary, .btn-ghost {
  padding: 12px 24px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text2); border: 1px solid var(--border2);
  background: transparent;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.btn-secondary:hover, .btn-ghost:hover { color: var(--text); border-color: var(--text2); }

/* -- 8. SECTIONS ------------------------------------------ */
.section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 72px 28px;
}
@media (max-width: 720px) { .section { padding: 48px 20px; } }
.section-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600; letter-spacing: -0.03em;
  line-height: 1.15; color: var(--text);
  margin-bottom: 8px;
}
.section-desc {
  font-size: 0.95rem; font-weight: 400; color: var(--text2);
  line-height: 1.65; max-width: 520px; margin-bottom: 40px;
}

/* -- 9. CARDS ---------------------------------------------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  background: var(--bg);
  transition: box-shadow 0.2s, border-color 0.15s;
  display: flex; flex-direction: column; gap: 12px;
}
.card:hover { box-shadow: var(--shadow-2); border-color: var(--border2); }
.card h3 {
  font-size: 1rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.card p {
  font-size: 0.88rem; color: var(--text2); line-height: 1.6;
}

/* -- 10. CODE BLOCKS (THE canonical look) ------------------ */
.code-block {
  background: var(--code-bg);
  border-radius: var(--r);
  overflow: hidden; position: relative;
  border: 1px solid rgba(255,255,255,0.06);
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.code-lang {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  color: var(--code-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.code-copy, .copy-btn {
  padding: 3px 10px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 500;
  color: var(--code-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; transition: color 0.15s, background 0.15s;
  font-family: var(--mono);
}
.code-copy:hover, .copy-btn:hover { color: #e2e2e2; background: rgba(255,255,255,0.12); }
.code-body {
  padding: 18px 22px;
  font-family: var(--mono); font-size: 0.8rem;
  line-height: 1.8; color: var(--code-fg);
  overflow-x: auto; white-space: pre;
}
.code-body .kw   { color: var(--code-kw); }
.code-body .fn   { color: var(--code-fn); }
.code-body .str  { color: var(--code-str); }
.code-body .cm   { color: var(--code-cm); font-style: italic; }
.code-body .num  { color: var(--code-num); }
.code-body .op   { color: #94a3b8; }
.code-body .prop { color: var(--code-prop); }

/* Inline code fallback for body copy */
:not(pre) > code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-bg);
  color: var(--text);
  padding: 1px 6px; border-radius: 4px;
}

/* Tabs (used by quickstart) */
.tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: none; }
.tab-btn {
  padding: 10px 20px;
  font-size: 0.84rem; font-weight: 500;
  color: var(--code-muted);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  cursor: pointer; font-family: var(--mono);
  position: relative; top: 1px;
  transition: color 0.15s, background 0.15s;
}
.tab-btn:hover { color: #e2e2e2; }
.tab-btn.active {
  color: var(--code-fg);
  background: var(--code-bg);
  border-color: rgba(255,255,255,0.06);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Code-block scrollbar (webkit + firefox) */
.code-body::-webkit-scrollbar { height: 8px; }
.code-body::-webkit-scrollbar-track { background: transparent; }
.code-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 4px; }
.code-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.20); }
.code-body { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }

/* -- 11. CTA BANNER --------------------------------------- */
.cta-banner {
  max-width: var(--max-w); margin: 0 auto 80px;
  padding: 0 28px;
}
.cta-inner {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 18px;
  padding: 48px 40px;
  text-align: center;
}
.cta-inner h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 10px;
}
.cta-inner p {
  font-size: 0.95rem; font-weight: 400; color: var(--text2);
  max-width: 440px; margin: 0 auto 24px; line-height: 1.65;
}
@media (max-width: 600px) {
  .cta-inner { padding: 36px 24px; }
}

/* -- 12. FOOTER -------------------------------------------- */
.footer { padding: 56px 28px 32px; border-top: 1px solid var(--border); margin-top: 0; background: var(--bg2); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; }

/* Legacy single-row layout (still supported for pages that have not migrated) */
.footer-inner.legacy,
.footer-inner > .footer-copy:only-child + .footer-links,
.footer-inner > .footer-links:first-child {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}

/* New multi-column layout */
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer-brand h4 {
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  margin-bottom: 8px; letter-spacing: -0.01em;
}
.footer-brand p {
  font-size: 0.86rem; color: var(--text2); line-height: 1.55;
  max-width: 320px;
}
.footer-col-h {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text2);
  margin-bottom: 14px;
}
.footer-col a {
  display: block; font-size: 0.86rem; color: var(--text2);
  margin-bottom: 8px; transition: color 0.15s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-direction: column; align-items: flex-start;
  padding-top: 22px; border-top: 1px solid var(--border);
  gap: 6px;
}
.footer-copy { font-size: 0.78rem; font-weight: 400; color: var(--text3); }
.footer-dev-link { font-size: 0.65rem; color: var(--text3); opacity: 0.85; letter-spacing: 0.01em; }
.footer-dev-link a { color: var(--text3); text-decoration: none; }
.footer-dev-link a:hover { color: var(--text2); }

/* Legacy fallback links — kept for any pages still using the flat layout */
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.78rem; font-weight: 400; color: var(--text3);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text2); }
.footer-cross {
  font-size: 0.72rem; color: var(--text3); margin-left: auto;
}
.footer-cross a { color: var(--text2); }
@media (max-width: 880px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 600px) {
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
}

/* -- 13. UTILITIES + REDUCED MOTION ----------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Common layout helpers */
.muted { color: var(--text2); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- ACTIVE-STATE (data-page) ---------- */
body[data-page="docs"] .nav-link[href="/docs"],
body[data-page="api"] .nav-link[href="/api-reference"],
body[data-page="benchmarks"] .nav-link[href="/benchmarks"],
body[data-page="mcp"] .nav-link[href="/docs"],
body[data-page="sandbox"] .nav-link[href="/api-reference"],
body[data-page="quickstart"] .nav-link[href="/docs"],
body[data-page="cookbook"] .nav-link[href="/docs"],
body[data-page="changelog"] .nav-link[href="/docs"],
body[data-page="status"] .nav-link[href="/docs"],
body[data-page="enterprise"] .nav-link[href="/pricing-developer"],
body[data-page="integrations"] .nav-link[href="/docs"],
body[data-page="pricing"] .nav-link[href="/pricing-developer"] {
  color: var(--accent) !important;
  font-weight: 600;
}
body[data-page="docs"] .mob-menu a[href="/docs"],
body[data-page="api"] .mob-menu a[href="/api-reference"],
body[data-page="benchmarks"] .mob-menu a[href="/benchmarks"],
body[data-page="pricing"] .mob-menu a[href="/pricing-developer"] {
  color: var(--accent) !important;
  font-weight: 600;
}
