/* Logic Studio Manual — shared stylesheet
   Mirrors the design tokens from App.css. Respects data-theme and prefers-color-scheme. */

:root {
  --bg:        #11151c;
  --surface:   #1a2030;
  --surface2:  #232c40;
  --text:      #e7e3d6;
  --text-dim:  #a4abba;
  --border:    #364056;
  --accent:    #d9a35a;
  --accent2:   #5fa8d3;
  --success:   #5bc78b;
  --warn:      #e5b14a;
  --error:     #e87a6b;
  --on-accent: #11151c;
  --shadow:    rgba(0,0,0,0.45);
  --hover-tint: rgba(255,255,255,0.06);
  --font-mono: 'JetBrains Mono','Fira Code','Cascadia Code',monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #f5f1e6;
    --surface:   #fffcf3;
    --surface2:  #ebe5d2;
    --text:      #1c2230;
    --text-dim:  #4a5363;
    --border:    #c5bda0;
    --accent:    #8a5616;
    --accent2:   #2c628f;
    --success:   #2f7a55;
    --warn:      #b86a14;
    --error:     #a23a2d;
    --on-accent: #fffcf3;
    --shadow:    rgba(28,34,48,0.12);
    --hover-tint: rgba(28,34,48,0.05);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg:        #f5f1e6;
  --surface:   #fffcf3;
  --surface2:  #ebe5d2;
  --text:      #1c2230;
  --text-dim:  #4a5363;
  --border:    #c5bda0;
  --accent:    #8a5616;
  --accent2:   #2c628f;
  --success:   #2f7a55;
  --warn:      #b86a14;
  --error:     #a23a2d;
  --on-accent: #fffcf3;
  --shadow:    rgba(28,34,48,0.12);
  --hover-tint: rgba(28,34,48,0.05);
  color-scheme: light;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ---- Site header ---- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__wordmark {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.site-header__badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
}

.site-header__nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-header__nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.site-header__nav a:hover,
.site-header__nav a:focus-visible {
  color: var(--text);
  background: var(--hover-tint);
  outline: none;
}

.site-header__nav a.active {
  color: var(--accent);
}

.site-header__launch {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: opacity 0.12s;
}

.site-header__launch:hover { opacity: 0.85; }

/* ---- Page layout ---- */

.page-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  gap: 48px;
}

/* ---- Sidebar TOC ---- */

.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.sidebar-toc {
  position: sticky;
  top: 70px;
}

.sidebar-toc__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.sidebar-toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-toc__list a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color 0.1s, background 0.1s;
}

.sidebar-toc__list a:hover {
  color: var(--text);
  background: var(--hover-tint);
}

.sidebar-toc__list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(217,163,90,0.08);
}

.sidebar-toc__list .toc-h3 {
  padding-left: 20px;
  font-size: 12px;
}

/* ---- Main content ---- */

.content {
  flex: 1;
  min-width: 0;
  max-width: 760px;
}

/* ---- Typography ---- */

.content h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.content .page-subtitle {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 32px;
  line-height: 1.5;
}

.content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 70px;
}

.content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent2);
  margin: 28px 0 8px;
  scroll-margin-top: 70px;
}

.content p {
  margin-bottom: 14px;
  color: var(--text);
}

.content p:last-child { margin-bottom: 0; }

.content ul, .content ol {
  padding-left: 20px;
  margin-bottom: 14px;
  color: var(--text);
}

.content li { margin-bottom: 4px; }

.content a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover { color: var(--text); }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent2);
}

kbd {
  color: var(--text-dim);
  padding: 2px 6px;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---- Screenshot figures ---- */

.screenshot {
  margin: 20px 0 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ---- Callout blocks ---- */

.callout {
  padding: 12px 16px;
  border-radius: 5px;
  border-left: 3px solid var(--accent2);
  background: rgba(95,168,211,0.08);
  margin-bottom: 16px;
  font-size: 14px;
}

.callout--tip { border-color: var(--accent2); }
.callout--note { border-color: var(--warn); background: rgba(229,177,74,0.08); }
.callout--warn { border-color: var(--error); background: rgba(232,122,107,0.08); }

.callout-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent2);
  margin-bottom: 4px;
}
.callout--note .callout-label { color: var(--warn); }
.callout--warn .callout-label { color: var(--error); }

/* ---- Feature support matrix ---- */

.support-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13px;
}

.support-table th,
.support-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.support-table th {
  background: var(--surface2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.support-table tr:hover td { background: var(--hover-tint); }

.status--full  { color: var(--success); font-weight: 700; }
.status--partial { color: var(--warn); font-weight: 700; }
.status--no    { color: var(--error); }
.status--roadmap { color: var(--accent); font-weight: 700; }

/* ---- Index cards ---- */

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.index-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.12s, background 0.12s;
}

.index-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.index-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.index-card__desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ---- Breadcrumb ---- */

.breadcrumb {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border); }

/* ---- Shortcut reference table ---- */

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 20px;
}

.shortcut-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.shortcut-table td:first-child { color: var(--text-dim); }
.shortcut-table td:last-child { text-align: right; }

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .page-layout {
    flex-direction: column;
    padding: 24px 16px 60px;
    gap: 24px;
  }

  .sidebar { width: 100%; }
  .sidebar-toc { position: static; }
}

/* ---- Print ---- */

@media print {
  .site-header,
  .sidebar,
  .site-header__nav { display: none; }

  .content { max-width: 100%; }

  .page-layout {
    padding: 0;
    max-width: 100%;
  }

  .screenshot {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  pre { white-space: pre-wrap; }
}
