/* graph-api.com — GraphQL Developer Documentation */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white: #FFFFFF;
  --purple: #4A154B;
  --magenta: #E01E5A;
  --lavender: #F8F5FF;
  --dark: #1D1C1D;
  --gray-100: #F4F4F4;
  --gray-200: #E8E8E8;
  --gray-300: #CCCCCC;
  --gray-500: #717171;
  --gray-700: #444444;
  --radius: 6px;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --max-w: 1140px;
  --max-w-narrow: 820px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--magenta);
}

ul, ol {
  padding-left: 1.5em;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* ---- Layout ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--magenta);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: color 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--magenta);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  position: absolute;
  left: 5px;
  transition: 0.2s;
}

.nav-toggle span { top: 15px; }
.nav-toggle span::before { content: ''; top: -7px; }
.nav-toggle span::after { content: ''; top: 7px; }

.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
  }
  .main-nav.open {
    display: flex;
  }
}

/* ---- Hero ---- */
.hero {
  background: var(--purple);
  color: var(--white);
  padding: 80px 0;
}

.hero h1 {
  font-size: 2.5rem;
  max-width: 600px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 540px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 768px) {
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 1.75rem; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ---- Code Blocks ---- */
.code-block {
  background: #1E1E2E;
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.65;
  position: relative;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-block__label {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-block__copy {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  font-family: var(--mono);
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.15s;
  position: relative;
}

.code-block__copy:hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
}

.code-block__copy .tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--magenta);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  white-space: nowrap;
}

.code-block__copy.copied .tooltip {
  display: block;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  color: #CDD6F4;
}

/* Syntax colors */
.sy-key { color: #CBA6F7; }
.sy-str { color: #A6E3A1; }
.sy-num { color: #FAB387; }
.sy-type { color: #89B4FA; }
.sy-com { color: #6C7086; font-style: italic; }
.sy-fn { color: #F9E2AF; }
.sy-op { color: #94E2D5; }
.sy-kw { color: #F38BA8; }
.sy-bool { color: #FAB387; }
.sy-punc { color: #9399B2; }

/* ---- Pillars / Cards ---- */
.pillars {
  padding: 72px 0;
}

.pillars h2 {
  text-align: center;
  margin-bottom: 48px;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.pillar-card {
  background: var(--lavender);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.pillar-card__icon {
  font-size: 1.75rem;
  margin-bottom: 16px;
  width: 48px;
  height: 48px;
  background: var(--purple);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
}

.pillar-card h3 {
  margin-bottom: 10px;
}

.pillar-card p {
  color: var(--gray-700);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Featured Resources ---- */
.resources {
  padding: 64px 0;
  background: var(--gray-100);
}

.resources h2 {
  text-align: center;
  margin-bottom: 40px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.resource-link:hover {
  border-color: var(--magenta);
  box-shadow: 0 2px 8px rgba(74,21,75,0.08);
  color: var(--dark);
}

.resource-link__icon {
  width: 40px;
  height: 40px;
  background: var(--purple);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.resource-link h4 {
  margin-bottom: 2px;
}

.resource-link p {
  font-size: 0.85rem;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .resources-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Stats ---- */
.stats {
  padding: 64px 0;
}

.stats h2 {
  text-align: center;
  margin-bottom: 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item__number {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
  display: block;
}

.stat-item__label {
  font-size: 0.9rem;
  color: var(--gray-500);
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* ---- Image Band ---- */
.image-band {
  width: 100%;
  height: 320px;
  overflow: hidden;
  position: relative;
}

.image-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(74,21,75,0.3), rgba(74,21,75,0.5));
}

/* ---- Page Hero (inner pages) ---- */
.page-hero {
  background: var(--purple);
  color: var(--white);
  padding: 56px 0;
}

.page-hero h1 {
  margin-bottom: 12px;
}

.page-hero p {
  opacity: 0.8;
  font-size: 1.05rem;
  max-width: 560px;
}

/* ---- Docs ---- */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 48px 0;
}

.docs-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
}

.docs-sidebar ul {
  list-style: none;
  padding: 0;
}

.docs-sidebar li {
  margin-bottom: 6px;
}

.docs-sidebar a {
  font-size: 0.9rem;
  color: var(--gray-700);
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: 0.15s;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--purple);
  background: var(--lavender);
  border-left-color: var(--magenta);
}

.docs-content section {
  margin-bottom: 56px;
  scroll-margin-top: 80px;
}

.docs-content h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
}

.docs-content p {
  margin-bottom: 16px;
}

.docs-content .code-block {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .docs-sidebar {
    position: static;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 20px;
    margin-bottom: 32px;
  }
}

/* ---- Playground ---- */
.playground-mock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 32px 0;
}

.playground-panel {
  min-height: 360px;
}

.playground-panel__header {
  padding: 10px 16px;
  background: #1E1E2E;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.playground-panel pre {
  background: #1E1E2E;
  color: #CDD6F4;
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  height: calc(100% - 37px);
  overflow: auto;
  margin: 0;
}

.playground-panel--response pre {
  background: #181825;
}

@media (max-width: 768px) {
  .playground-mock {
    grid-template-columns: 1fr;
  }
}

/* ---- Examples Grid ---- */
.examples-list {
  padding: 48px 0;
}

.example-item {
  margin-bottom: 48px;
  scroll-margin-top: 80px;
}

.example-item h3 {
  margin-bottom: 10px;
}

.example-item > p {
  margin-bottom: 16px;
  color: var(--gray-700);
}

/* ---- Blog ---- */
.blog-list {
  padding: 48px 0;
}

.blog-card {
  display: block;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.blog-card:hover {
  border-color: var(--magenta);
  box-shadow: 0 2px 8px rgba(74,21,75,0.08);
  color: var(--dark);
}

.blog-card__date {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-family: var(--mono);
  display: block;
  margin-bottom: 6px;
}

.blog-card h3 {
  margin-bottom: 8px;
}

.blog-card p {
  color: var(--gray-700);
  font-size: 0.95rem;
}

/* ---- Blog Post ---- */
.blog-post {
  padding: 48px 0 72px;
}

.blog-post__meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 32px;
}

.blog-post h2 {
  margin-top: 40px;
  margin-bottom: 16px;
}

.blog-post h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.blog-post p {
  margin-bottom: 16px;
}

.blog-post ul, .blog-post ol {
  margin-bottom: 16px;
}

.blog-post li {
  margin-bottom: 6px;
}

.blog-post .code-block {
  margin: 20px 0;
}

.blog-post blockquote {
  border-left: 3px solid var(--magenta);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--lavender);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-700);
}

/* ---- Community ---- */
.community-hero {
  text-align: center;
}

.community-hero p {
  max-width: 480px;
  margin: 0 auto;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 48px 0;
}

.community-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
}

.community-card h3 {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.community-card p {
  color: var(--gray-700);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.community-card a.btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius);
  background: var(--purple);
  color: var(--white);
  transition: background 0.15s;
}

.community-card a.btn:hover {
  background: var(--magenta);
  color: var(--white);
}

@media (max-width: 768px) {
  .community-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Conduct / Guidelines ---- */
.guidelines {
  padding: 0 0 64px;
}

.guidelines h2 {
  margin-bottom: 20px;
}

.guidelines-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.guidelines-grid section h3 {
  margin-bottom: 10px;
}

.guidelines-grid section p,
.guidelines-grid section ul {
  color: var(--gray-700);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .guidelines-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Privacy / Legal ---- */
.legal {
  padding: 48px 0 72px;
}

.legal h2 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.legal p {
  margin-bottom: 14px;
  color: var(--gray-700);
}

/* ---- 404 ---- */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 48px 24px;
}

.page-404 h1 {
  font-family: var(--mono);
  font-size: 2.5rem;
  color: var(--purple);
  margin-bottom: 16px;
}

.page-404 p {
  color: var(--gray-500);
  margin-bottom: 24px;
}

.page-404 a {
  font-weight: 600;
  color: var(--magenta);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.6);
  padding: 48px 0 32px;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h4 {
  color: var(--white);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a {
  color: rgba(255,255,255,0.6);
  transition: color 0.15s;
}

.footer-grid a:hover {
  color: var(--white);
}

.footer-about .logo {
  margin-bottom: 12px;
}

.footer-about p {
  max-width: 280px;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.footer-bottom a {
  color: rgba(255,255,255,0.4);
}

.footer-bottom a:hover {
  color: var(--white);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Utilities ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-mono {
  font-family: var(--mono);
}

.text-magenta {
  color: var(--magenta);
}

.mb-0 { margin-bottom: 0; }
