:root {
  color-scheme: light;
  --bg: #f4ede3;
  --bg-strong: #efe3d2;
  --surface: rgba(255, 251, 246, 0.86);
  --surface-strong: #fffdfa;
  --text: #1f2430;
  --muted: #5e6472;
  --border: rgba(86, 62, 39, 0.15);
  --accent: #0e5f8c;
  --accent-strong: #0a4464;
  --accent-soft: rgba(14, 95, 140, 0.12);
  --success: #1d6b4e;
  --warning: #8d5d13;
  --shadow: 0 24px 60px rgba(38, 24, 15, 0.12);
  --code-bg: #18202c;
  --code-border: rgba(255, 255, 255, 0.08);
  --code-text: #eef2f8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1218;
  --bg-strong: #131b25;
  --surface: rgba(18, 25, 34, 0.88);
  --surface-strong: #17202b;
  --text: #eef3f7;
  --muted: #a4b2c2;
  --border: rgba(168, 189, 212, 0.15);
  --accent: #67c0f1;
  --accent-strong: #9fdcff;
  --accent-soft: rgba(103, 192, 241, 0.14);
  --success: #5fd6a3;
  --warning: #f3b65f;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  --code-bg: #081018;
  --code-border: rgba(255, 255, 255, 0.08);
  --code-text: #edf4fb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI Variable Text", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 153, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(75, 158, 216, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg-strong), var(--bg));
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

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

code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.45rem;
  background: var(--accent-soft);
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.8rem;
  background:
    linear-gradient(135deg, rgba(16, 79, 119, 0.96), rgba(37, 128, 165, 0.84)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
  color: #f8fbff;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -15% -25% auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 238, 215, 0.34), transparent 70%);
  pointer-events: none;
}

.hero__eyebrow,
.hero__actions,
.theme-switcher,
.section__heading,
.card-grid,
.feature-list,
.snippet-tabs__list,
.code-header,
.endpoint summary,
.hero__content {
  display: flex;
}

.hero__eyebrow,
.hero__actions,
.theme-switcher,
.snippet-tabs__list,
.code-header {
  gap: 0.75rem;
}

.hero__content {
  gap: 1.5rem;
  align-items: stretch;
  justify-content: space-between;
}

.hero__copy {
  flex: 1 1 0;
  min-width: 0;
}

.hero__panel {
  width: min(360px, 100%);
  padding: 1.25rem;
  border-radius: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 27, 43, 0.28);
  backdrop-filter: blur(8px);
}

.hero__kicker,
.section__kicker,
.card__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero__kicker {
  margin: 0 0 0.65rem;
  color: rgba(255, 255, 255, 0.82);
}

.hero h1,
.hero__panel h2,
.section h2,
.card h3,
.endpoint .path {
  font-family: Georgia, "Palatino Linotype", serif;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 1;
}

.hero__lead {
  margin: 1rem 0 1.3rem;
  max-width: 42rem;
  color: rgba(248, 251, 255, 0.9);
}

.button,
.theme-pill,
.snippet-tabs__tab,
.copy-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.button {
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover,
.theme-pill:hover,
.snippet-tabs__tab:hover,
.copy-button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: #fff5e8;
  color: #12324a;
}

.button--secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.button--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.badge {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.82rem;
  font-weight: 700;
}

.badge--soft {
  background: rgba(255, 239, 214, 0.2);
}

.feature-list {
  flex-direction: column;
  margin: 1rem 0 1.25rem;
  padding-left: 1.1rem;
}

.feature-list li + li {
  margin-top: 0.55rem;
}

.theme-switcher {
  flex-wrap: wrap;
}

.theme-pill {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.theme-pill.is-active {
  background: #fff5e8;
  color: #12324a;
}

.content {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.4rem;
}

.section {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.section__heading {
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
}

.section__heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section__heading p {
  margin: 0;
  color: var(--muted);
}

.section__kicker,
.card__label {
  color: var(--accent);
}

.card-grid {
  flex-wrap: wrap;
  gap: 1rem;
}

.card-grid--three > * {
  flex: 1 1 280px;
}

.card-grid--two > * {
  flex: 1 1 360px;
}

.card {
  padding: 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.card--soft {
  background: linear-gradient(180deg, var(--surface-strong), transparent);
}

.card h3,
.hero__panel h2 {
  margin: 0.25rem 0 0.65rem;
}

.card p,
.hero__panel p {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.callout {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(141, 93, 19, 0.22);
  background: rgba(141, 93, 19, 0.1);
  color: var(--text);
}

.callout--warning strong {
  color: var(--warning);
}

.snippet-tabs {
  margin-top: 0.95rem;
}

.snippet-tabs__list {
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.snippet-tabs__tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.snippet-tabs__tab.is-active {
  background: var(--accent);
  color: #f8fbff;
  border-color: transparent;
}

.snippet-tabs__panel {
  display: none;
}

.snippet-tabs__panel.is-active {
  display: block;
}

.code-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.copy-button {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.copy-button.is-copied {
  background: rgba(29, 107, 78, 0.16);
  color: var(--success);
}

pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  color: var(--code-text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.endpoint-list {
  display: grid;
  gap: 0.85rem;
}

.endpoint {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface-strong);
  overflow: hidden;
}

.endpoint summary {
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  list-style: none;
  cursor: pointer;
}

.endpoint summary::-webkit-details-marker {
  display: none;
}

.endpoint summary::after {
  content: "+";
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
}

.endpoint[open] summary::after {
  content: "−";
}

.endpoint__body {
  padding: 0 1.1rem 1.1rem;
}

.endpoint__body p {
  margin-top: 0;
  color: var(--muted);
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.method--post {
  background: rgba(29, 107, 78, 0.16);
  color: var(--success);
}

.path {
  font-size: 1.1rem;
  font-weight: 700;
}

.summary-copy {
  color: var(--muted);
}

.response-card {
  margin-top: 1rem;
}

.response-card h4 {
  margin: 0 0 0.5rem;
  color: var(--accent);
}

@media (max-width: 920px) {
  .hero__content {
    flex-direction: column;
  }

  .hero__panel {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1200px);
    padding-top: 0.75rem;
  }

  .hero,
  .section {
    border-radius: 1.25rem;
    padding: 1rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .endpoint summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
