/* KiroGraph — shared stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset & base ────────────────────────────────────────── */

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

:root {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-code:     #1f2428;
  --bg-input:    #21262d;
  --border:      #30363d;
  --accent:      #a78bfa;
  --accent-dim:  #7c3aed;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --text:        #c9d1d9;
  --text-muted:  #8b949e;
  --text-bright: #f0f6fc;
  --green:       #3fb950;
  --yellow:      #d29922;
  --red:         #f85149;
  --purple:      #bc8cff;
  --orange:      #ffa657;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
  color: var(--text-bright);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

strong { color: var(--text-bright); font-weight: 600; }

/* ── Fixed logo banner ────────────────────────────────────── */

.logo-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}

.logo-banner img {
  opacity: 0.08;
  padding: 50px;
}

/* ── Navigation ──────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-bright);
  font-size: 1.05rem;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--text-bright); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.nav-links a:hover { color: var(--text-bright); background: var(--bg-input); }
.nav-links a.active { color: var(--accent); background: var(--accent-glow); }

.nav-links .nav-gh {
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.nav-links .nav-gh:hover { color: var(--text-bright); background: var(--bg-input); }
.nav-links .nav-gh svg { width: 18px; height: 18px; }

/* ── Layout containers ───────────────────────────────────── */

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

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(167,139,250,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 40px rgba(167,139,250,0.3);
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 1rem auto 2rem;
  line-height: 1.6;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-bright) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}
.btn-primary:hover { background: #c4b5fd; text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-input); border-color: var(--text-muted); text-decoration: none; }

/* ── Install block ───────────────────────────────────────── */

.install-block {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-bright);
  margin-bottom: 2rem;
}

.install-block .prompt { color: var(--green); user-select: none; }

/* ── Screenshot ──────────────────────────────────────────── */

.hero-screenshot {
  margin: 0 auto 3rem;
  max-width: 820px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(167,139,250,0.08);
  overflow: hidden;
}

.hero-screenshot img {
  width: 100%;
  border-radius: inherit;
}

/* ── Cards / grid ────────────────────────────────────────── */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 4px 20px rgba(0,0,0,0.4);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--accent);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.card-media { margin-top: 1rem; border-radius: var(--radius); overflow: hidden; }
.card-media img, .card-media video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── Section headings ────────────────────────────────────── */

.section-header { text-align: center; margin-bottom: 1rem; }
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: var(--text-muted); max-width: 560px; margin: 0 auto; }

.label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ── "Why" benefits ──────────────────────────────────────── */

.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.benefit {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.benefit-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.benefit-icon svg {
  width: 22px;
  height: 22px;
}

.benefit h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.benefit p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* ── How it works diagram ────────────────────────────────── */

.how-diagram {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  margin-top: 3rem;
}

.diagram-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 620px;
}

.diagram-box h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.diagram-box .box-content {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
}

.diagram-arrow {
  width: 2px;
  height: 32px;
  background: linear-gradient(to bottom, var(--border), var(--accent));
  position: relative;
  margin: 0 auto;
}

.diagram-arrow::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--accent);
}

.diagram-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.diagram-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

.diagram-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.4rem;
}

/* ── Languages badges ────────────────────────────────────── */

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.lang-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}
.lang-badge:hover { color: var(--text-bright); border-color: var(--text-muted); }

/* ── CTA banner ──────────────────────────────────────────── */

.cta-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 58, 237, 0.1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  margin: 0 0 5rem;
}

.cta-banner h2 { margin-bottom: 0.5rem; }
.cta-banner p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Footer ──────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* ── Code blocks ─────────────────────────────────────────── */

code, kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.45em;
  color: var(--orange);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}

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

/* ── Tables ──────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 1.25rem 0; border-radius: var(--radius); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-input);
}

th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

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

td code { background: var(--bg-input); border-color: transparent; }

/* ── Docs layout (sidebar + content) ────────────────────── */

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
}

/* Three-column layout (left sidebar + content + right TOC) */
.docs-layout-three {
  grid-template-columns: 240px 1fr 200px;
}

.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
  margin-bottom: 0.25rem;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1.5rem 0.25rem;
}

.sidebar-link {
  display: block;
  padding: 0.35rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.03); text-decoration: none; }
.sidebar-link.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-glow); }

.docs-content {
  padding: 3rem 3rem 5rem;
  max-width: 860px;
}

/* Right-sidebar layout (content left, TOC right) */
.docs-layout-right {
  grid-template-columns: 1fr 220px;
}

.docs-sidebar-right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.docs-sidebar-right .sidebar-link {
  border-left: none;
  border-right: 2px solid transparent;
  padding: 0.3rem 1.25rem;
  font-size: 0.8rem;
}

.docs-sidebar-right .sidebar-link.active {
  border-right-color: var(--accent);
  border-left-color: transparent;
}

.docs-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}

.docs-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.docs-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.docs-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-content p { color: var(--text); margin-bottom: 1rem; }
.docs-content ul, .docs-content ol { margin-bottom: 1rem; }
.docs-content li { color: var(--text); }
.docs-content pre { margin: 1rem 0; }

/* ── Breadcrumb ──────────────────────────────────────────── */

.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

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

.breadcrumb-sep {
  margin: 0 0.4rem;
  color: var(--border);
}

/* ── Changelog ───────────────────────────────────────────── */

.changelog-content { max-width: 760px; padding: 3rem 2rem 5rem; }

.changelog-content h2 {
  font-size: 1.2rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-badge {
  display: inline-block;
  background: var(--accent-glow);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.version-title {
  display: inline-block;
  margin-left: 0.6rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-bright, var(--text));
  letter-spacing: -0.01em;
}

.version-date {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.changelog-content h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.changelog-content ul { margin-bottom: 1rem; }
.changelog-content li { color: var(--text); font-size: 0.9rem; margin-bottom: 0.3rem; }
.changelog-content p { color: var(--text-muted); font-size: 0.875rem; }
.changelog-content a { color: var(--accent); }
.changelog-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── Spinner ─────────────────────────────────────────────── */

.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem;
  color: var(--text-muted);
}

.spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tool section cards ──────────────────────────────────── */

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

.tool-card h3 { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; color: var(--accent); margin: 0 0 0.5rem; }
.tool-card .tool-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.tool-card .table-wrap { margin: 0; }

/* ── Badges / tags ───────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: rgba(63,185,80,0.15); color: var(--green); }
.badge-yellow { background: rgba(210,153,34,0.15); color: var(--yellow); }
.badge-purple { background: rgba(188,140,255,0.15); color: var(--purple); }
.badge-blue { background: var(--accent-glow); color: var(--accent); }
.badge-orange { background: rgba(255,166,87,0.15); color: var(--orange); }

/* ── Callout ─────────────────────────────────────────────── */

.callout {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.callout.callout-warn { border-left-color: var(--yellow); }
.callout.callout-tip { border-left-color: var(--green); }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }

  .hero { padding: 3rem 0 2rem; }

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

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

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

  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }

  .docs-sidebar-right {
    display: none;
  }

  .docs-content { padding: 2rem 1rem 3rem; }

  .cta-banner { padding: 2rem 1rem; }

  .benefits { gap: 1.5rem; }

  .diagram-box { padding: 1rem 1.25rem; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
}
