:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-strong: #f2eee7;
  --text: #201e1b;
  --muted: #625d55;
  --border: #ddd5ca;
  --accent: #ff5a36;
  --accent-dark: #c83d22;
  --code-bg: #f3eee6;
  --shadow: 0 16px 45px rgba(49, 40, 32, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.skip-link {
  left: 1rem;
  position: absolute;
  top: -4rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  align-items: center;
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  height: 64px;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand {
  color: var(--text);
  font-weight: 800;
}

.brand img {
  height: 32px;
  width: 32px;
}

.top-nav {
  font-size: 0.92rem;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--border);
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 22px;
  position: sticky;
  top: 64px;
}

.nav-tab {
  margin-bottom: 24px;
}

.nav-tab h2 {
  color: var(--text);
  font-size: 0.86rem;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.nav-group h3 {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin: 16px 0 6px;
}

.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-group a {
  border-radius: 6px;
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  padding: 5px 8px;
}

.nav-group a.active {
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
}

.content {
  min-width: 0;
  padding: 36px clamp(18px, 4vw, 58px);
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  margin: 0 auto 48px;
  max-width: 1160px;
}

.hero h1 {
  font-size: clamp(2.45rem, 5vw, 5.2rem);
  letter-spacing: 0;
  line-height: 0.96;
  margin: 0 0 18px;
}

.lede {
  color: var(--muted);
  font-size: 1.14rem;
  max-width: 760px;
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  display: inline-flex;
  font-weight: 750;
  min-height: 42px;
  padding: 9px 14px;
}

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

.hero-panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 24px;
}

.hero-panel img {
  display: block;
  height: auto;
  margin-bottom: 10px;
  max-width: 100%;
}

code,
pre {
  background: var(--code-bg);
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.15em 0.35em;
}

pre {
  overflow: auto;
  padding: 16px;
}

pre code {
  background: transparent;
  padding: 0;
}

.section {
  margin: 0 auto 42px;
  max-width: 1160px;
}

.section-heading h2 {
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0 0 18px;
}

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

.card {
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
}

.card.compact {
  min-height: 126px;
}

.card span:last-child {
  color: var(--muted);
}

.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 930px;
  padding: clamp(20px, 4vw, 42px);
}

.prose h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin-top: 0;
}

.prose h2 {
  border-top: 1px solid var(--border);
  margin-top: 2.2rem;
  padding-top: 1.4rem;
}

.prose img {
  height: auto;
  max-width: 100%;
}

.prose table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin: 18px 0;
  padding: 14px 16px;
}

.callout.warning {
  border-left-color: #b42318;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 36px auto 0;
  max-width: 930px;
}

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

  .sidebar {
    border-bottom: 1px solid var(--border);
    border-right: 0;
    max-height: 320px;
    position: static;
  }

  .top-nav {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14110f;
    --surface: #1f1a17;
    --surface-strong: #2a231f;
    --text: #fff8f2;
    --muted: #c9baae;
    --border: #40362f;
    --accent: #ff6a42;
    --accent-dark: #ff987c;
    --code-bg: #2b241f;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  }
}
