/* ============================================================
   Prism Docs — shared stylesheet
   Light mode, Inter + JetBrains Mono, lavender accent system
   ============================================================ */

:root {
  --bg:            #ffffff;
  --surface:       #f8f8fb;
  --surface-2:     #f0effe;
  --border:        #e4e1f8;
  --border-muted:  #ebebeb;
  --text:          #0f0e15;
  --muted:         #6b6880;
  --accent:        #7c6af7;
  --accent-hi:     #6354e8;
  --accent-tint:   #ede9ff;
  --code-bg:       #f6f4ff;
  --terminal-bg:   #0f0e15;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --max-w:         1100px;
  --max-w-narrow:  720px;
  --sidebar-w:     260px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* ============================================================
   Nav (shared, sticky)
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-nav .logo:hover { color: var(--accent); }

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

.site-nav .nav-links a {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  transition: color 0.1s, background 0.1s;
}

.site-nav .nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav .nav-links a.nav-github {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* ============================================================
   Terminal window component
   ============================================================ */

.terminal-window {
  background: var(--terminal-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(15,14,21,0.18),
    0 4px 16px rgba(124,106,247,0.12);
}

.terminal-chrome {
  background: #1a1826;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-bottom: 1px solid #2a2840;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-filename {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #7a7898;
}

.terminal-body {
  padding: 1.25rem 1.25rem 1.5rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  line-height: 1.75;
  color: #c8c5e8;
  overflow-x: auto;
  white-space: pre;
}

/* Terminal token colors (dark background) */
.t-prompt  { color: #7c6af7; }
.t-cmd     { color: #e8e6ff; font-weight: 500; }
.t-flag    { color: #a8a0f0; }
.t-ok      { color: #28c840; }
.t-label   { color: #7a7898; }
.t-addr    { color: #64b5f6; }
.t-val     { color: #f0c070; }
.t-muted   { color: #4a4868; }
.t-dim     { color: #3a3858; }

/* ============================================================
   Hero — 2 column split
   ============================================================ */

.hero-split {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 5.5rem;
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 4rem;
  align-items: center;
}

.hero-left { display: flex; flex-direction: column; gap: 0; }

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
}

.hero-split h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 440px;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-width: fit-content;
}

.install-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.hero-install code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
}

@media (max-width: 860px) {
  .hero-split {
    grid-template-columns: 1fr;
    padding: 3.5rem 1.5rem 4rem;
    gap: 2.5rem;
  }
  .hero-right { display: none; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.575rem 1.125rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  color: #fff;
}

.btn-secondary {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--accent-hi);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

/* ============================================================
   Value Props
   ============================================================ */

.props-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.props-intro {
  max-width: 52ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 3.5rem;
}

.props-intro strong {
  color: var(--text);
  font-weight: 500;
}

.props-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.prop-card {
  background: var(--surface);
  padding: 1.75rem;
  transition: background 0.15s;
}

.prop-card:hover { background: var(--surface-2); }

.prop-symbol {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  margin-bottom: 0.875rem;
  display: inline-block;
  letter-spacing: 0.02em;
}

.prop-card h3 {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.prop-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.prop-card p code {
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.8em;
}

/* ============================================================
   CLI Spotlight section
   ============================================================ */

.cli-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.cli-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
  margin-top: 2.5rem;
}

.cli-left h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.cli-left p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.cli-commands {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.cli-cmd-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: baseline;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-muted);
}

.cli-cmd-row:last-child { border-bottom: none; }
.cli-cmd-row:nth-child(even) { background: var(--surface); }

code.cli-cmd {
  font-family: var(--font-mono);
  font-size: 0.785rem;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  white-space: nowrap;
}

.cli-cmd-desc {
  font-size: 0.825rem;
  color: var(--muted);
  line-height: 1.4;
}

.cli-install {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.cli-install code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
}

@media (max-width: 860px) {
  .cli-split { grid-template-columns: 1fr; }
  .cli-right { display: none; }
}

/* ============================================================
   Packages
   ============================================================ */

.packages-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.pkg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(124,106,247,0.05), 0 1px 2px rgba(0,0,0,0.03);
}

.pkg-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(124,106,247,0.12), 0 1px 3px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.pkg-name {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--accent);
  font-weight: 500;
}

.pkg-tagline {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.pkg-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pkg-features li {
  font-size: 0.825rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.4;
}

.pkg-features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border);
}

.pkg-install {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pkg-link {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: auto;
  font-weight: 500;
}

.pkg-link:hover { color: var(--accent-hi); }

/* ============================================================
   Code sample section
   ============================================================ */

.code-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.code-block-wrapper {
  margin-top: 2.5rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.code-block-label {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--muted);
}

.code-block-wrapper pre {
  padding: 1.5rem 1.25rem;
  overflow-x: auto;
  font-size: 0.825rem;
  line-height: 1.75;
  tab-size: 2;
}

/* Syntax highlighting — light mode */
.code-block-wrapper .kw  { color: #7c6af7; }    /* keywords — purple */
.code-block-wrapper .fn  { color: #1a6ea8; }    /* function names — blue */
.code-block-wrapper .str { color: #b5461a; }    /* strings — warm brown */
.code-block-wrapper .cm  { color: #8b8ba7; }    /* comments — muted */
.code-block-wrapper .id  { color: var(--text); } /* identifiers — near-black */
.code-block-wrapper .num { color: #2d7a40; }    /* numbers — green */

.code-footnote {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.code-footnote a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

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

/* ============================================================
   Doc pages — sidebar layout
   ============================================================ */

.doc-page-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: 52px;
}

.doc-page-nav-inner {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover { color: var(--accent); }

.nav-sep { color: var(--border); font-size: 1.2rem; font-weight: 300; }

.nav-pkg {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.nav-links-right {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}

.nav-links-right a {
  font-family: var(--font-mono);
  font-size: 0.735rem;
  color: var(--muted);
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}

.nav-links-right a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
}

/* Sidebar layout */
.doc-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: calc(var(--max-w) + var(--sidebar-w) + 4rem);
  margin: 0 auto;
  min-height: calc(100vh - 52px);
}

.doc-sidebar {
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 1.5rem 1.25rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.475rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.25rem;
  color: var(--muted);
}

.sidebar-search svg { flex-shrink: 0; }

.sidebar-search input {
  border: none;
  outline: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text);
  width: 100%;
}

.sidebar-search input::placeholder { color: var(--muted); }

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-pkg-link {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 5px;
  transition: background 0.1s;
  margin-bottom: 0.1rem;
}

.sidebar-pkg-link:hover { background: var(--surface-2); }
.sidebar-pkg-link.active { background: var(--accent-tint); }

.sidebar-pkg-mono {
  font-family: var(--font-mono);
  font-size: 0.755rem;
  color: var(--text);
}

.sidebar-pkg-link.active .sidebar-pkg-mono { color: var(--accent); }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.875rem 0.5rem;
}

.sidebar-toc-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-toc {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-toc a {
  display: block;
  padding: 0.22rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-radius: 4px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.1s, background 0.1s;
}

.sidebar-toc a:hover { color: var(--text); background: var(--surface-2); }
.sidebar-toc a.toc-active { color: var(--accent); background: var(--accent-tint); }
.sidebar-toc a.toc-h3 { padding-left: 1.25rem; font-size: 0.77rem; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,14,21,0.4);
  z-index: 35;
}

/* Doc main content */
.doc-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.doc-content {
  flex: 1;
  padding: 3rem 2.5rem 5rem;
  max-width: var(--max-w-narrow);
}

.doc-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2.5rem;
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.doc-footer a { color: var(--muted); }
.doc-footer a:hover { color: var(--text); }

/* ============================================================
   Markdown body
   ============================================================ */

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.markdown-body h1 { font-size: 1.875rem; margin-top: 0; }
.markdown-body h2 {
  font-size: 1.3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.markdown-body h3 { font-size: 1.05rem; }

.markdown-body p {
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.72;
}

.markdown-body a { color: var(--accent); }
.markdown-body a:hover { color: var(--accent-hi); }

.markdown-body ul,
.markdown-body ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.3rem;
  color: var(--text);
  line-height: 1.65;
}

.markdown-body code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text);
}

.markdown-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text);
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  padding: 0.875rem 1rem 0.875rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin: 1rem 0;
}

.markdown-body blockquote p { color: var(--text); margin-bottom: 0; }

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.markdown-body th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

.markdown-body td {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.markdown-body td:first-child { color: var(--text); }
.markdown-body td code { font-size: 0.8em; }

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .props-grid     { grid-template-columns: repeat(2, 1fr); }
  .packages-grid  { grid-template-columns: repeat(2, 1fr); }

  .doc-layout { grid-template-columns: 1fr; }

  .doc-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    bottom: 0;
    z-index: 40;
    transition: left 0.25s ease;
    height: 100vh;
    padding-top: 4.5rem;
    width: 280px;
    box-shadow: 4px 0 20px rgba(15,14,21,0.1);
  }

  .sidebar-toggle {
    display: flex;
  }

  .nav-links-right { display: none; }

  body.sidebar-open .doc-sidebar { left: 0; }
  body.sidebar-open .sidebar-overlay { display: block; }
}

@media (max-width: 600px) {
  .props-grid    { grid-template-columns: 1fr; }
  .packages-grid { grid-template-columns: 1fr; }

  .hero-split { padding: 3rem 1.25rem 3.5rem; }
  .props-section,
  .cli-section,
  .packages-section,
  .code-section { padding: 3rem 1.25rem; }

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

  .doc-content { padding: 2rem 1.25rem 4rem; }
  .doc-footer  { padding: 1.5rem 1.25rem; }
}
