:root {
  --bg: #f5efe3;
  --bg-accent: #ece1cf;
  --panel: rgba(255, 250, 241, 0.88);
  --panel-strong: #fff8ec;
  --line: rgba(46, 59, 54, 0.14);
  --text: #21312b;
  --muted: #5c6e67;
  --heading: #10231d;
  --brand: #0f6a69;
  --brand-strong: #0a4f4f;
  --highlight: #b8693a;
  --shadow: 0 24px 70px rgba(16, 35, 29, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --max-width: 1380px;
  --sans: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 106, 105, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(184, 105, 58, 0.10), transparent 32%),
    linear-gradient(180deg, #faf6ee 0%, var(--bg) 42%, #f1e8d9 100%);
  min-height: 100vh;
}

a {
  color: var(--brand-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--highlight);
}

img {
  max-width: 100%;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(16, 35, 29, 0.08);
  backdrop-filter: blur(18px);
  background: rgba(250, 246, 238, 0.82);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--heading);
  text-decoration: none;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  background:
    linear-gradient(135deg, rgba(15, 106, 105, 0.92), rgba(10, 79, 79, 0.94)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

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

.top-links {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.top-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--heading);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(16, 35, 29, 0.08);
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  background:
    linear-gradient(135deg, rgba(15, 106, 105, 0.95), rgba(10, 79, 79, 0.98)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 40%);
  color: #f7f1e7;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -3rem -4rem auto;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.hero-brow {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 241, 231, 0.78);
}

.hero h1 {
  margin: 0.5rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 0.95;
  font-weight: 700;
}

.hero p {
  max-width: 48rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(247, 241, 231, 0.88);
}

.hero-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.hero-stat {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
}

.hero-stat span {
  display: block;
  margin-top: 0.2rem;
  color: rgba(247, 241, 231, 0.76);
  font-size: 0.9rem;
}

.layout {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 5.8rem;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar h2,
.sidebar h3 {
  margin: 0;
  color: var(--heading);
}

.sidebar h2 {
  font-size: 1rem;
}

.sidebar section + section {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.sidebar-list,
.language-list,
.repo-links,
.tool-grid,
.workspace-grid,
.source-list,
.section-list,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.sidebar-link,
.chip,
.repo-link,
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(16, 35, 29, 0.08);
  color: var(--heading);
  text-decoration: none;
  font-size: 0.92rem;
}

.sidebar-link.active,
.chip.active {
  background: rgba(15, 106, 105, 0.12);
  border-color: rgba(15, 106, 105, 0.3);
  color: var(--brand-strong);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel h2,
.panel h3 {
  margin-top: 0;
  color: var(--heading);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.page-header h1 {
  margin: 0.2rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--heading);
}

.page-header p {
  max-width: 45rem;
  margin: 0.7rem 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.eyebrow {
  color: var(--brand);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.meta span {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 106, 105, 0.08);
  color: var(--brand-strong);
  font-size: 0.9rem;
}

.tool-card,
.workspace-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(247, 241, 229, 0.96));
  border: 1px solid rgba(16, 35, 29, 0.08);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 14px 40px rgba(16, 35, 29, 0.08);
}

.tool-card:hover,
.workspace-card:hover {
  transform: translateY(-2px);
  transition: transform 140ms ease;
}

.tool-card h3,
.workspace-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--heading);
}

.tool-card p,
.workspace-card p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.section-list {
  margin-top: 0.9rem;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(16, 35, 29, 0.08);
  color: var(--heading);
  text-decoration: none;
}

.doc-section {
  border-radius: var(--radius-lg);
  padding: 1.45rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

.doc-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.doc-source {
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-body {
  font-size: 1rem;
  line-height: 1.75;
}

.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4 {
  color: var(--heading);
  margin-top: 1.5em;
}

.doc-body h1:first-child,
.doc-body h2:first-child,
.doc-body h3:first-child {
  margin-top: 0;
}

.doc-body p,
.doc-body ul,
.doc-body ol,
.doc-body blockquote {
  margin: 0 0 1rem;
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.4rem;
}

.doc-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 0.12rem 0.35rem;
  border-radius: 0.45rem;
  background: rgba(16, 35, 29, 0.06);
}

.doc-body pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #11231e;
  color: #f7f1e7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.doc-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1rem 0 1.35rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
}

.doc-body th,
.doc-body td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(16, 35, 29, 0.08);
  vertical-align: top;
}

.doc-body thead th {
  background: rgba(15, 106, 105, 0.08);
  color: var(--heading);
}

.doc-body blockquote {
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 4px solid rgba(15, 106, 105, 0.35);
  color: var(--muted);
}

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.mobile-toggle {
  display: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(16, 35, 29, 0.08);
    background: rgba(255, 255, 255, 0.72);
    color: var(--heading);
  }

  .topbar-inner {
    padding-inline: 1rem;
  }
}

@media (max-width: 720px) {
  .page {
    padding-inline: 0.9rem;
  }

  .hero,
  .panel,
  .doc-section,
  .sidebar {
    padding: 1.1rem;
  }

  .hero-grid,
  .tool-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}
