/* ========= RESET / BASE ========= */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #0f172a;        /* slate-900 vibe */
  background-color: #ffffff;
}

/* Smooth text & consistent look */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ========= DESIGN TOKENS ========= */

:root {
  --bg-main: #ffffff;
  --bg-subtle: #f9fafb;         /* light gray background */
  --bg-muted: #f3f4f6;

  --border-subtle: #e5e7eb;     /* soft borders */
  --border-strong: #d1d5db;

  --text-main: #0f172a;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;

  --accent: #2563eb;            /* blue */
  --accent-soft: #eff6ff;
  --accent-hover: #1d4ed8;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.08),
                 0 1px 2px rgba(15, 23, 42, 0.04);

  --content-width: 1200px;
}

/* ========= GLOBAL TEXT ELEMENTS ========= */

p {
  margin: 0 0 1rem;
}

p + p {
  margin-top: -0.25rem; /* tighter para stacking like docs */
}

h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  margin: 1.75rem 0 0.75rem;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.1rem;
}

ul, ol {
  margin: 0 0 1rem 1.5rem;
  padding: 0;
}

li {
  margin: 0.25rem 0;
}

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

a:hover {
  text-decoration: underline;
}

/* Inline code */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: var(--bg-muted);
  padding: 0.15em 0.3em;
  border-radius: 0.25rem;
  border: 1px solid #e5e7eb;
}

/* Code blocks */
pre {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.9rem;
}

/* ========= APP SHELL & TOP NAV ========= */

.app-shell {
  min-height: 100vh;
  background: var(--bg-main);
  color: var(--text-main);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.brand-mark {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.4rem;
  background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb);
}

.brand-text {
  letter-spacing: -0.03em;
}

/* Nav spacing */
.top-nav-spacer {
  flex: 1 1 auto;
}

.top-links {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.top-links a {
  color: var(--text-muted);
}

.top-links a:hover {
  color: var(--text-main);
  text-decoration: none;
}

/* Search */
.top-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-search input {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  min-width: 160px;
}

.top-search input::placeholder {
  color: var(--text-soft);
}

.top-search-shortcut {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

/* ========= MAIN LAYOUT GRID ========= */

.layout {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  column-gap: 2.5rem;
}

/* ========= LEFT SIDEBAR ========= */

.sidebar {
  position: sticky;
  top: 4.25rem; /* below top-nav */
  align-self: flex-start;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.sidebar-section-label {
  margin-bottom: 0.4rem;
  margin-top: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--text-soft);
}

.sidebar-section-label:first-of-type {
  margin-top: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-link {
  display: block;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.sidebar-link:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  text-decoration: none;
}

.sidebar-link-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* ========= MAIN CONTENT ========= */

.content {
  min-width: 0; /* fix overflow in grid */
}

.doc {
  max-width: 700px;
}

/* Eyebrow above h1, like "Get started" */
.doc-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

/* Paragraph spacing tweak inside doc */
.doc p {
  color: var(--text-muted);
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.primary-button:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.secondary-button {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.secondary-button:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}

/* "Was this page helpful?" */
.feedback-block {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.feedback-question {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.feedback-actions {
  display: flex;
  gap: 0.5rem;
}

.chip-button {
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
}

.chip-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ========= RIGHT RAIL: ON THIS PAGE ========= */

.on-this-page {
  position: sticky;
  top: 4.25rem;
  align-self: flex-start;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.on-this-page-title {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  margin-bottom: 0.6rem;
}

.on-this-page-link {
  display: block;
  margin: 0.15rem 0;
  color: var(--text-soft);
}

.on-this-page-link:hover {
  color: var(--text-main);
  text-decoration: none;
}

/* ========= RESPONSIVE ========= */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .sidebar,
  .on-this-page {
    display: none;
  }

  .content {
    max-width: 100%;
  }

  .doc {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .top-nav {
    padding-inline: 1rem;
  }

  .top-links {
    display: none;
  }

  .top-search input {
    min-width: 120px;
  }

  .layout {
    padding-inline: 1rem;
  }

  h1 {
    font-size: 1.7rem;
  }
}
