:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #dfe3e8;
  --accent: #2f7fbf;
  --accent-dark: #1e5a9b;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 127, 191, 0.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(47, 127, 191, 0.05), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  backdrop-filter: blur(14px);
  background: rgba(246, 247, 249, 0.82);
}

.topbar-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: block;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 24px rgba(47, 127, 191, 0.22);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy small {
  font-size: 0.84rem;
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-nav a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  font-weight: 700;
  transition: 0.18s ease;
}

.topbar-nav a:hover,
.topbar-nav a:focus-visible {
  border-color: rgba(47, 127, 191, 0.28);
  background: rgba(47, 127, 191, 0.08);
  color: var(--accent-dark);
}

.topbar-nav--desktop {
  display: flex;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  display: block;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  z-index: 29;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100dvh;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.mobile-nav__header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.mobile-nav__title {
  font-size: 0.98rem;
  font-weight: 700;
}

.mobile-nav__close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1.1rem;
}

.mobile-nav__links {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.mobile-nav__links a {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background: #f9fafb;
  font-weight: 600;
}

.mobile-nav__links a[aria-current="page"] {
  border-color: rgba(47, 127, 191, 0.28);
  background: rgba(47, 127, 191, 0.08);
  color: var(--accent-dark);
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .mobile-nav {
  transform: translateX(0);
}

.page {
  padding: 32px 0 56px;
}

.hero {
  margin-bottom: 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.surface {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
}

.hero-panel {
  padding: 24px;
}

.eyebrow,
.section-kicker,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.subcopy {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.6;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.18s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 12px 24px rgba(47, 127, 191, 0.22);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: #fff;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.quick-links {
  display: grid;
  gap: 12px;
}

.quick-link {
  display: block;
  padding: 16px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  transition: 0.18s ease;
}

.quick-link:hover,
.quick-link:focus-visible {
  border-color: rgba(47, 127, 191, 0.26);
  background: rgba(47, 127, 191, 0.05);
}

.quick-link-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.quick-link-text {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 24px;
}

.workspace-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.workspace-side {
  display: grid;
  gap: 20px;
  align-content: start;
}

.workspace-main,
.workspace-side,
.response-card {
  min-width: 0;
}

.workspace,
.workspace-main,
.workspace-side,
.ask-card,
.response-card,
.ask-form,
.response-content {
  min-width: 0;
}

.ask-card,
.response-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.surface {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f9fafb;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
}

.examples {
  margin-bottom: 20px;
}

.examples-label {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.example-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example-btn {
  border: 1px solid var(--border);
  background: #f9fafb;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  transition: 0.18s ease;
}

.example-btn:hover,
.example-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #f3f8fc;
}

.ask-form {
  display: grid;
  gap: 14px;
}

textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  resize: vertical;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font: inherit;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 127, 191, 0.12);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.scroll-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: 0.18s ease;
}

.scroll-arrow:hover,
.scroll-arrow:focus-visible {
  border-color: rgba(47, 127, 191, 0.28);
  background: rgba(47, 127, 191, 0.06);
  transform: translateY(1px);
}

button[type="submit"] {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
}

button[type="submit"]:hover {
  background: var(--accent-dark);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status {
  min-height: 24px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.response-card {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-top: 24px;
}

.response-head {
  margin-bottom: 16px;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.92rem;
}

.response-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 1.68;
  color: var(--text);
  overflow-x: hidden;
}

.response-content p {
  margin: 0 0 14px;
}

.response-content h3,
.response-content h4 {
  margin: 20px 0 10px;
}

.response-content ul {
  margin: 0 0 14px 20px;
  padding: 0;
}

.response-content li {
  margin-bottom: 6px;
}

.response-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.markdown-table {
  border-collapse: collapse;
  table-layout: auto;
  width: max-content;
  min-width: 100%;
  max-width: none;
  font-size: 0.92rem;
  line-height: 1.45;
}

.markdown-table th,
.markdown-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 140px;
  max-width: 260px;
}

.markdown-table th {
  background: #f9fafb;
}

.response-content .ref {
  color: var(--accent-dark);
  font-weight: 600;
}

.side-card {
  padding: 22px;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.feature-list li + li {
  margin-top: 10px;
}

.stack-links {
  display: grid;
  gap: 10px;
}

.stack-links a {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f9fafb;
  font-weight: 600;
  transition: 0.18s ease;
}

.stack-links a:hover,
.stack-links a:focus-visible {
  border-color: rgba(47, 127, 191, 0.26);
  background: rgba(47, 127, 191, 0.05);
  color: var(--accent-dark);
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1180px) {
  .hero-grid,
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100%, calc(100% - 20px));
  }

  .page {
    padding: 20px 0 36px;
  }

  .hero-copy,
  .hero-panel,
  .surface {
    padding: 20px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions,
  .section-meta,
  .example-buttons {
    width: 100%;
  }

  .btn,
  .example-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-nav--desktop {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .topbar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand-copy small {
    display: none;
  }

  .markdown-table {
    min-width: 920px;
  }
}
