:root {
  --bg: #f8f3ee;
  --surface: #ffffff;
  --surface-soft: #fff8f2;
  --text: #221713;
  --muted: #7a7268;
  --border: #eadfd5;
  --accent: #f97316;
  --accent-light: #fb923c;
  --accent-dark: #ea580c;
  --accent-gold: #fbbf24;
  --warning-bg: #fff4e5;
  --warning-border: #ffc453;
  --info-bg: #fff7ed;
  --shadow: 0 1px 2px rgba(34, 23, 19, 0.08);
  --shadow-accent: 0 10px 28px rgba(249, 115, 22, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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);
}

code {
  background: #f3ebe4;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-size: 0.92em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.skip-link:focus {
  left: 12px;
}

.topbar {
  padding: 32px clamp(20px, 4vw, 56px);
  background:
    radial-gradient(ellipse at top right, rgba(251, 191, 36, 0.12), transparent 45%),
    radial-gradient(ellipse at top left, rgba(249, 115, 22, 0.12), transparent 48%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-copy {
  width: 100%;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.25;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
  background: linear-gradient(150deg, var(--text) 20%, var(--accent-light) 58%, var(--accent-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 1.75rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

h3 {
  margin-top: 24px;
  font-size: 1.2rem;
}

h4 {
  font-size: 1rem;
}

p {
  margin: 0 0 14px;
}

.lead {
  max-width: none;
  width: 100%;
  color: var(--muted);
  font-size: 1.08rem;
}

button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 9px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

button:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.sidebar input {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}

.sidebar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
  outline: none;
}

.search-status {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar nav {
  display: grid;
  gap: 2px;
}

.sidebar a {
  border-radius: 6px;
  border-left: 3px solid transparent;
  color: var(--text);
  padding: 8px 10px 8px 9px;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
  background: #fff1e6;
  border-left-color: var(--accent);
  color: var(--accent-dark);
}

.content {
  display: grid;
  gap: 18px;
}

.doc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 32px);
}

.doc-section:target {
  border-color: rgba(249, 115, 22, 0.32);
  box-shadow: var(--shadow-accent);
}

.grid {
  display: grid;
  gap: 12px;
}

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

.concept-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card,
.example,
.callout {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.card {
  border-color: rgba(249, 115, 22, 0.14);
}

.card h3 {
  margin-top: 0;
}

.callout {
  background: var(--info-bg);
  border-color: rgba(249, 115, 22, 0.24);
  margin: 16px 0;
}

.callout.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.example {
  margin: 16px 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  counter-increment: step;
  margin: 0 0 10px;
  padding-left: 42px;
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent), var(--accent-gold));
  color: white;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #fff1e6;
}

details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
  padding: 10px 14px;
  background: var(--surface-soft);
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.screenshot {
  display: grid;
  place-items: center;
  min-height: 240px;
  margin: 18px 0;
  border: 2px dashed #9ca3af;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(251, 191, 36, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(249, 115, 22, 0.07) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(251, 191, 36, 0.09) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(249, 115, 22, 0.07) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  color: var(--muted);
  text-align: center;
}

.screenshot-placeholder {
  display: none;
}

.screenshot div {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 520px;
  padding: 18px;
}

.screenshot strong,
.screenshot span {
  display: block;
}

.hidden-by-search {
  display: none;
}

@media (max-width: 900px) {
  .topbar {
    display: block;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .skip-link {
    display: none;
  }

  body {
    background: white;
  }

  .layout {
    display: block;
    padding: 0;
  }

  .doc-section {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .screenshot {
    min-height: 160px;
  }
}
