:root {
  --bg: #f7f4ee;
  --panel: #ffffff;
  --panel-soft: #fbf9f4;
  --ink: #1f2430;
  --muted: #6d7483;
  --line: rgba(44, 54, 74, 0.12);
  --line-strong: rgba(44, 54, 74, 0.2);
  --gold: #d4b15d;
  --gold-soft: #f3e4b0;
  --navy: #111827;
  --navy-soft: #1a2233;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.12);
  --shadow: 0 18px 45px rgba(18, 25, 39, 0.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sans: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", sans-serif;
  --mono: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 92, 255, 0.08), transparent 28rem),
    radial-gradient(circle at 100% 0%, rgba(212, 177, 93, 0.18), transparent 28rem),
    linear-gradient(180deg, #fcfbf8 0%, var(--bg) 100%);
}

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

code,
pre,
kbd {
  font-family: var(--mono);
}

code {
  font-size: 0.94em;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  min-height: 100vh;
}

.sidebar,
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
}

.sidebar {
  padding: 1.6rem 1rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.rail {
  padding: 1.6rem 1rem;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.78), rgba(245, 239, 255, 0.82));
  backdrop-filter: blur(12px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.brand-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f1728, #202b42);
  color: #f8e6ab;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow);
}

.kicker,
.menu-title,
.mini-title,
.resource-type {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.kicker,
.menu-title,
.mini-title {
  color: #7b8798;
}

.sidebar-brand h1,
.topbar h2,
.hero-copy h3,
.section-head h3,
.doc-card h4,
.rail-head h4 {
  margin: 0;
}

.sidebar-brand h1 {
  font-size: 1.5rem;
}

.search-shell {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.3rem;
}

.search-shell span {
  font-size: 0.84rem;
  color: var(--muted);
}

.search-shell input,
.search-shell kbd {
  border-radius: 14px;
}

.search-shell input {
  width: 100%;
  min-height: 46px;
  padding: 0 4.6rem 0 1rem;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.search-shell {
  position: relative;
}

.search-shell kbd {
  position: absolute;
  right: 0.8rem;
  bottom: 0.6rem;
  padding: 0.22rem 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
}

.menu-group + .menu-group {
  margin-top: 1.1rem;
}

.menu {
  display: grid;
  gap: 0.2rem;
}

.menu a {
  display: block;
  padding: 0.62rem 0.8rem;
  border-radius: 12px;
  color: var(--muted);
  transition: 180ms ease;
}

.menu a:hover {
  background: rgba(124, 92, 255, 0.08);
  color: var(--ink);
}

.content {
  padding: 1.8rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.topbar h2 {
  margin-top: 0.22rem;
  font-size: clamp(2rem, 2.5vw, 3.1rem);
  line-height: 1.02;
  max-width: 14ch;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}

.pill-soft,
.badge-soft {
  background: var(--accent-soft);
  color: #5840b7;
  border-color: rgba(124, 92, 255, 0.18);
}

.hero-card,
.doc-card,
.rail-card,
.stat-card,
.check-grid label {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1rem;
  padding: 1.35rem;
}

.hero-copy {
  padding: 0.5rem;
}

.hero-copy h3 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 3.1vw, 3.6rem);
  line-height: 0.98;
  max-width: 11ch;
}

.hero-copy p:last-of-type {
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #111827, #242d42);
  color: #fff;
}

.button-secondary {
  border: 1px solid rgba(124, 92, 255, 0.18);
  background: rgba(124, 92, 255, 0.08);
  color: #5e49c7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-card {
  padding: 1rem;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.8rem;
}

.stat-card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.stat-card-dark {
  background: linear-gradient(165deg, #111827, #1d2740);
  color: #fff;
}

.stat-card-dark span,
.stat-card-dark p {
  color: rgba(255, 255, 255, 0.72);
}

.stat-card-gold {
  background: linear-gradient(145deg, #f3dfb0, #f5ecce);
}

.doc-section {
  margin-top: 1.35rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.section-head h3 {
  margin-top: 0.18rem;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
}

.split,
.resource-grid,
.check-grid {
  display: grid;
  gap: 1rem;
}

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

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

.doc-card {
  padding: 1.2rem;
  margin-top: 1rem;
}

.doc-card p,
.doc-card li {
  color: var(--muted);
  line-height: 1.72;
}

.endpoint-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 34px;
  padding: 0 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.method-post {
  background: rgba(255, 138, 61, 0.14);
  color: #f26f22;
  border: 1px solid rgba(242, 111, 34, 0.18);
}

.endpoint-note {
  margin: 0.35rem 0 0.7rem;
}

.mini-title {
  margin-bottom: 0.45rem;
}

.callout {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.08), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(124, 92, 255, 0.14);
}

pre {
  overflow: auto;
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #101828 0%, #161f31 100%);
  color: #e9eef8;
  line-height: 1.6;
}

.table-shell {
  overflow: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

thead th {
  padding: 0.95rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: rgba(124, 92, 255, 0.05);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(44, 54, 74, 0.08);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

.steps {
  margin: 0;
  padding-left: 1.15rem;
}

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

.resource-card {
  display: block;
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(124, 92, 255, 0.08), transparent 9rem),
    radial-gradient(circle at bottom left, rgba(212, 177, 93, 0.12), transparent 8rem),
    var(--panel);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
}

.resource-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 92, 255, 0.2);
}

.resource-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.1rem;
}

.resource-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.resource-type {
  color: #6f54ee;
}

.check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: #fff;
}

.check-grid input {
  accent-color: #6f54ee;
}

.rail-card {
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #121825 0%, #1b2436 100%);
  color: #ecf1fb;
  border-color: rgba(255, 255, 255, 0.05);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.rail-head span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.85rem;
  font-weight: 700;
}

.rail-list {
  margin: 0;
  padding-left: 1rem;
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 1500px) {
  .layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .rail {
    position: relative;
    grid-column: 2;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .rail-card {
    margin-bottom: 0;
  }
}

@media (max-width: 1220px) {
  .layout,
  .hero-card,
  .split.two,
  .split.three,
  .resource-grid,
  .check-grid,
  .rail {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .rail {
    position: relative;
    height: auto;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 1.2rem;
  }

  .topbar {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .content,
  .sidebar,
  .rail {
    padding: 1rem;
  }

  .doc-card,
  .rail-card,
  .hero-card,
  .stat-card {
    padding: 1rem;
  }

  .button {
    width: 100%;
  }

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