:root {
  --paper: #f4ede1;
  --paper-strong: #fffaf1;
  --ink: #22150c;
  --muted: #6c5a4a;
  --line: rgba(70, 45, 18, 0.14);
  --accent: #b4551e;
  --accent-strong: #8b3f14;
  --accent-soft: rgba(180, 85, 30, 0.12);
  --shadow: 0 24px 60px rgba(41, 24, 10, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 85, 30, 0.08), transparent 34%),
    repeating-linear-gradient(
      90deg,
      rgba(180, 85, 30, 0.04) 0,
      rgba(180, 85, 30, 0.04) 1px,
      transparent 1px,
      transparent 72px
    ),
    var(--paper);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
}

code,
pre,
input,
button {
  font-family: "Consolas", "SFMono-Regular", monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  background: rgba(244, 237, 225, 0.86);
}

.brand {
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.top-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.page-shell {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.tutorial-shell {
  width: min(1120px, calc(100% - 28px));
}

.hero,
.info-card,
.quick-card,
.docs-sidebar,
.docs-viewer {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(255, 250, 241, 0.88);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 28px;
  padding: 34px;
  border-radius: 36px;
  margin-bottom: 22px;
}

.eyebrow,
.card-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1,
.info-card h2,
.quick-card h3,
.docs-sidebar h2,
.viewer-head h2 {
  margin: 0;
}

.lede,
.sidebar-copy,
.doc-summary,
.markdown-body p,
.markdown-body li {
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--line);
}

.button.primary {
  color: white;
  background: var(--accent);
  border-color: transparent;
}

.button.secondary,
.button.ghost {
  background: rgba(255, 255, 255, 0.55);
}

.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.badge-stack span,
.quick-index,
.doc-button.active::before {
  border-radius: 999px;
}

.badge-stack span {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.hero-code,
.quick-card pre,
.markdown-body pre {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(34, 21, 12, 0.08);
  background: #1f130c;
  color: #f8efe3;
}

.hero-code pre,
.quick-card pre,
.markdown-body pre {
  margin: 0;
  padding: 18px;
}

.overview-grid,
.quickstart-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quickstart-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.quick-card {
  padding: 22px;
  border-radius: var(--radius);
}

.text-link {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

.quick-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.docs-shell {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.docs-sidebar,
.docs-viewer {
  border-radius: 30px;
  padding: 24px;
}

.search-field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.search-field span {
  font-size: 0.88rem;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.doc-list {
  display: grid;
  gap: 10px;
}

.doc-button {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  color: inherit;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
}

.doc-button strong {
  font-size: 1rem;
}

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

.doc-button.active {
  border-color: rgba(180, 85, 30, 0.32);
  background: var(--accent-soft);
}

.doc-button.active::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.sidebar-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.doc-summary {
  margin: 16px 0 20px;
  font-size: 1rem;
}

.markdown-body {
  line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 28px 0 10px;
  color: var(--ink);
}

.markdown-body h1 {
  font-size: 2rem;
}

.markdown-body h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.5rem;
}

.markdown-body ul,
.markdown-body ol {
  margin: 12px 0 18px;
  padding-left: 22px;
}

.markdown-body li + li {
  margin-top: 4px;
}

.markdown-body code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(34, 21, 12, 0.08);
  color: var(--ink);
}

.markdown-body pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.tutorial-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
}

.tutorial-article {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
  background: rgba(255, 250, 241, 0.9);
}

.tutorial-article h2 {
  margin: 0 0 14px;
  padding-top: 22px;
  font-size: 1.8rem;
}

.tutorial-article h2:first-child {
  padding-top: 0;
}

.tutorial-article h3 {
  margin: 24px 0 10px;
  font-size: 1.25rem;
}

.tutorial-article p,
.tutorial-article li {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.tutorial-article ul {
  margin: 12px 0 18px;
  padding-left: 22px;
}

.tutorial-article pre {
  overflow: auto;
  margin: 14px 0 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(34, 21, 12, 0.08);
  background: #1f130c;
  color: #f8efe3;
}

.tutorial-article code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(34, 21, 12, 0.08);
  color: var(--ink);
}

.tutorial-article pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.viewer-empty {
  padding: 26px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
}

.example-grid {
  display: grid;
  gap: 18px;
}

.example-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  background: rgba(255, 250, 241, 0.9);
}

.example-panel h2,
.example-panel h3 {
  margin: 0;
}

.example-copy,
.example-status,
.example-panel p,
.example-panel label {
  color: var(--muted);
}

.example-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 22px;
}

.example-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.example-field input[type="file"],
.example-field input[type="range"] {
  width: 100%;
}

.example-field output {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.95rem;
}

.example-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  font-weight: 600;
}

.example-player-host {
  min-height: 92px;
  padding: 16px;
  border-radius: 24px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.example-player-host audio {
  width: 100%;
}

.code-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.code-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.code-card pre {
  overflow: auto;
  margin: 12px 0 0;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(34, 21, 12, 0.08);
  background: #1f130c;
  color: #f8efe3;
}

@media (max-width: 1100px) {
  .hero,
  .overview-grid,
  .quickstart-grid,
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .tutorial-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .viewer-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 20px;
  }

  .hero,
  .docs-sidebar,
  .docs-viewer {
    padding: 20px;
  }
}
