/* Storion Documentation - Distinctive, readable design */
:root {
  --bg: #0f0f12;
  --bg-card: #18181c;
  --bg-code: #1a1a1f;
  --border: #2a2a32;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --accent: #22d3ee;
  --accent-dim: #0891b2;
  --accent-soft: rgba(34, 211, 238, 0.15);
  --green: #34d399;
  --orange: #fb923c;
  --radius: 8px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

:root[data-theme='light'] {
  --bg: #ffffff;
  --bg-card: #f3f4f6;
  --bg-code: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #0891b2;
  --accent-dim: #0e7490;
  --accent-soft: rgba(8, 145, 178, 0.12);
  --green: #16a34a;
  --orange: #ea580c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.docs-wrap {
  display: flex;
  min-height: 100vh;
}

.docs-nav {
  width: 240px;
  flex-shrink: 0;
  padding: 1.5rem 0;
  border-right: 1px solid var(--border);
  background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.05), transparent 55%), var(--bg-card);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.docs-nav-inner {
  padding: 0 1.25rem;
}

.docs-nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}

.docs-nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.docs-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}

.docs-nav .nav-group {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem 0.75rem;
}

.docs-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 3rem 4rem;
  max-width: 880px;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p {
  margin: 0 0 1rem;
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

/* Code */
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid var(--border);
}

pre {
  margin: 1rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-code);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--text);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* Lists */
ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

/* Hero / Home */
.hero {
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero .install {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

/* Cards / Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-card strong {
  color: var(--text);
}

.feature-card p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* API sections */
.api-section {
  margin-bottom: 2rem;
}

.api-section h2 {
  margin-top: 2.5rem;
}

.api-section h2:first-child {
  margin-top: 0;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .docs-wrap {
    flex-direction: column;
  }

  .docs-nav {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: none;
  }

  .docs-nav.open {
    display: block;
  }

  .nav-toggle {
    display: block;
  }

  .docs-main {
    padding: 1.5rem 1.25rem 3rem;
  }
}

/* Logo/brand in nav */
.docs-nav .brand {
  padding: 0.25rem 0.75rem 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.docs-nav .brand a {
  color: inherit;
  font-size: 1.25rem;
  font-weight: 700;
}

.docs-nav .brand a:hover {
  background: none;
  text-decoration: none;
}

.brand-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px; /* rounded square */
  border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.2), transparent 60%);
  box-shadow: 0 0 0 1px rgba(15,23,42,0.5), 0 6px 14px rgba(0,0,0,0.4);
  object-fit: cover;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  padding: 0;
  font-size: 0.9rem;
}

.theme-toggle::before {
  content: '🌙';
}

:root[data-theme='light'] .theme-toggle::before {
  content: '☀';
}

.theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Code example cards with copy button */
.code-example {
  margin: 1.25rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(to bottom right, rgba(34, 211, 238, 0.06), transparent 55%), var(--bg-card);
  overflow: hidden;
}

.code-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 10, 24, 0.9);
}

.code-example-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-example-copy {
  border: 1px solid var(--border);
  background: rgba(12, 10, 24, 0.9);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.code-example-copy:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.code-example-copy.copied {
  color: var(--green);
  border-color: var(--green);
}

.code-example-body {
  background: #111827; /* softer slate background for examples */
}

.code-example-body pre {
  margin: 0;
  border-radius: 0;
  border: none;
}

.code-example-body pre code {
  color: var(--accent);
}
