:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-strong: #eceef2;
  --text: #16181d;
  --muted: #5d6573;
  --border: #dfe3e8;
  --accent: #7c3aed;
  --accent-2: #ec4899;
  --think: #8a92a0;
  --radius: 12px;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-strong: #1d2430;
    --text: #e8ebf0;
    --muted: #9aa3b2;
    --border: #2a3240;
    --accent: #a78bfa;
    --accent-2: #f472b6;
    --think: #7d8696;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

a {
  color: var(--accent);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

pre.shiki {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  background-color: var(--surface) !important;
}

pre.shiki code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.shiki span {
  color: var(--shiki-light);
}

@media (prefers-color-scheme: dark) {
  .shiki span {
    color: var(--shiki-dark);
  }
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px;
}

.brand img {
  display: block;
}

.top nav {
  display: flex;
  gap: 20px;
}

.top nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

.top nav a:hover {
  color: var(--text);
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

main.doc {
  max-width: 760px;
}

h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 40px 0 16px;
}

main.doc h1 {
  font-size: clamp(30px, 5vw, 42px);
}

h2 {
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
}

main.doc h2 {
  font-size: 22px;
  margin-top: 36px;
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 36px 0 20px;
}

.hero h1 {
  margin: 8px 0 18px;
  font-size: clamp(42px, 7vw, 72px);
}

.eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.gradient-text {
  background: linear-gradient(90deg, #7c3aed, #ec4899 55%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 20px;
  color: var(--muted);
  margin: 0;
}

.cta-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.cta-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cta-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 18px;
  padding: 14px 14px 14px 18px;
  border-radius: 12px;
  background: #0d1117;
  color: #f5f5f7;
}

.cta-command code {
  background: none;
  padding: 0;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}

.cta-command .prompt {
  color: #ec4899;
  margin-right: 6px;
}

.cta-command .copy {
  background: #262c36;
  border-color: #3a414d;
  color: #f5f5f7;
}

.cta-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  flex: 1 1 auto;
  text-align: center;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
}

.button.primary {
  border-color: var(--text);
  color: var(--bg);
  background: var(--text);
}

.button.primary:hover {
  opacity: 0.88;
}

.cta-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}

.cta-points li::before {
  content: '✓ ';
  color: #16a34a;
  font-weight: 700;
}

/* --- Logos and use cases ----------------------------------------------------- */

.works-with {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 28px 0 8px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.works-with-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.brand-logo svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}

/* The official OpenAI file includes its required clear space, so it is drawn
   larger and pulled in to line up with the other logos */
.official-logo img {
  display: block;
  width: 36px;
  height: 36px;
  margin: -8px;
}

.use-case-icon .official-logo img {
  width: 44px;
  height: 44px;
  margin: -9px;
}

.card-logos .official-logo img,
.tab-list .official-logo img {
  width: 32px;
  height: 32px;
  margin: -7px;
}

footer .legal {
  max-width: 720px;
  margin: 8px auto 0;
  font-size: 12.5px;
}

.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.use-case {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.use-case:hover {
  border-color: var(--muted);
}

.use-case-icon {
  display: flex;
  gap: 8px;
  height: 30px;
  align-items: center;
}

.use-case-icon .brand-logo svg {
  width: 26px;
  height: 26px;
}

.status-badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  padding: 3px 9px;
  border-radius: 8px;
  color: #fff;
  background: #dc2626;
}

.use-case strong {
  font-size: 17px;
}

.use-case > span:not(.use-case-icon):not(.more) {
  color: var(--muted);
  font-size: 15px;
}

.use-case .more {
  margin-top: auto;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.use-case code {
  background: none;
  padding: 0;
  font-size: 0.92em;
  color: var(--text);
}

.brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.works-with .brand-text {
  font-size: 15px;
  border: none;
  padding: 0;
}

.card-logos {
  display: flex;
  gap: 8px;
}

.card-logos .brand-logo svg {
  width: 18px;
  height: 18px;
}

.section-lead {
  color: var(--muted);
  margin-top: 0;
}

.guides-title {
  margin: 32px 0 0;
  font-size: 18px;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 16px;
  }
}

button {
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
}

button:hover {
  border-color: var(--accent);
}

.playground {
  margin-top: 40px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.playground h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

#ask {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#ask select,
#ask input {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

#ask input {
  flex: 1 1 240px;
  min-width: 0;
}

#ask button[type='submit'] {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 8px 18px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.examples button {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
}

.output {
  min-height: 120px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.output .hint {
  margin: 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

.output .thinking {
  color: var(--think);
}

.output .answer {
  margin-top: 10px;
  color: var(--text);
  font-weight: 600;
}

.output .error {
  color: #dc2626;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  min-height: 32px;
  font-size: 14px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}

.card:hover {
  border-color: var(--accent);
}

.card span {
  color: var(--muted);
  font-size: 14.5px;
}

.features {
  padding-left: 20px;
}

.features li {
  margin: 8px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

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

.doc-footer {
  margin-top: 48px;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px 16px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* --- Code tabs ------------------------------------------------------------------ */

.tabs {
  margin-top: 20px;
}

.tab-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.tab-list button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  margin-bottom: -1px;
}

.tab-list button:hover {
  color: var(--text);
}

.tab-list button[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--text);
}

.tab-list .brand-logo svg {
  width: 16px;
  height: 16px;
}

.tab-list .brand-text {
  font-size: 12px;
  padding: 0 6px;
}

.tab-panel pre.shiki {
  margin-top: 14px;
}

.tab-panel p {
  color: var(--muted);
  font-size: 15px;
  margin: 10px 0 0;
}
