/* Celgrid SEO, Engine Integration, Starter Pack, Comparison, and Technical Guide Stylesheet */
:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --panel: #11161c;
  --panel-alt: #161d25;
  --surface: #1b232d;
  --border: rgba(220, 234, 244, 0.11);
  --border-strong: rgba(220, 234, 244, 0.22);
  --text: #eef4f7;
  --muted: #9eb0be;
  --faint: #758696;
  --accent: #3ee0a8;
  --accent-hover: #64ebb9;
  --accent-dim: rgba(62, 224, 168, 0.13);
  --accent-border: rgba(62, 224, 168, 0.42);
  --amber: #f5b856;
  --amber-dim: rgba(245, 184, 86, 0.13);
  --amber-border: rgba(245, 184, 86, 0.38);
  --blue: #60a5fa;
  --pink: #f472b6;
  --radius-card: 10px;
  --radius-btn: 8px;
  --radius-tag: 5px;
  --sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4, p, figure, ul, ol, pre { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: #051610;
  font-weight: 700;
}
.skip-link:focus { left: 16px; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 64px;
  background: rgba(11, 14, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.nav-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #051610;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent-border); background: #222c37; }
.btn-lg { min-height: 44px; padding: 10px 20px; font-size: 14.5px; }

/* Breadcrumbs */
.breadcrumb-bar {
  padding: 16px 0 0;
}
.breadcrumb-list {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb-list li + li::before {
  content: "/";
  color: var(--faint);
}
.breadcrumb-list a { color: var(--muted); }
.breadcrumb-list a:hover { color: var(--accent); }
.breadcrumb-list [aria-current="page"] { color: var(--text); }

/* Hero */
.seo-hero {
  padding: 28px 0 44px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 82% 24%, rgba(62, 224, 168, 0.08), transparent 48%);
}
.seo-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: start;
}
.seo-hero-single {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.seo-hero-single > * {
  max-width: 78ch;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.eyebrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-tag);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.seo-hero h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.answer-box {
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--accent-border);
  background: linear-gradient(160deg, rgba(62, 224, 168, 0.08), var(--panel));
  font-size: 15px;
  line-height: 1.62;
  color: #e4eff4;
}
.answer-box strong { color: var(--text); }
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

/* Sprite Showcase Panel in Hero */
.hero-visual-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  overflow: hidden;
}
.hero-visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.hero-visual-head strong { color: var(--text); }
.zoom-controls {
  display: inline-flex;
  gap: 4px;
}
.zoom-btn {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.zoom-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}
.hero-sprite-stage {
  padding: 20px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: #0d1218;
}
.pixel-tile {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
}
.pixel-stage {
  height: 136px;
  display: grid;
  place-items: center;
  position: relative;
  background-color: #1e262f;
  background-image: conic-gradient(#151b22 25%, transparent 0 50%, #151b22 0 75%, transparent 0);
  background-size: 12px 12px;
}
.pixel-stage img,
.pixel-stage canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
}
.pixel-stage[data-zoom="1"] img,
.pixel-stage[data-zoom="1"] canvas { width: 24px; height: 24px; }
.pixel-stage[data-zoom="4"] img,
.pixel-stage[data-zoom="4"] canvas { width: 84px; height: 84px; }
.pixel-stage[data-zoom="8"] img,
.pixel-stage[data-zoom="8"] canvas { width: 112px; height: 112px; }
.pixel-stage img { width: 84px; height: 84px; }

.pixel-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(11, 14, 18, 0.88);
  border: 1px solid var(--border-strong);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}
.pixel-foot {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pixel-foot strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.pixel-foot span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* Main Content Sections */
.seo-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 74ch;
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
}
.section-head p {
  font-size: 15px;
  color: var(--muted);
}
.direct-answer {
  margin-bottom: 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
  color: #dce9ef;
  font-size: 14.5px;
  max-width: 78ch;
}

/* Cards & Grids */
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.info-card {
  padding: 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-card h3 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.info-card p,
.info-card li {
  font-size: 14px;
  color: var(--muted);
}
.info-card ul,
.info-card ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.info-card strong { color: var(--text); }
.hub-card {
  padding: 22px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.hub-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.hub-card .card-kicker {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hub-card h3 { font-size: 18px; font-weight: 800; }
.hub-card p { font-size: 14px; color: var(--muted); }
.hub-card .card-link-hint {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* Sprite Gallery Grid */
.sprite-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.sprite-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.sprite-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.sprite-card-foot {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sprite-card-foot strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.sprite-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.sprite-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
}
.sprite-links a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Palette Strip */
.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: var(--radius-tag);
  border: 1px solid var(--border);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.swatch-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: none;
}

/* Code Blocks */
.code-block-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-strong);
  background: #0d1218;
  overflow: hidden;
  margin-bottom: 18px;
}
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
}
.code-block-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.copy-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.copy-btn:hover { border-color: var(--accent-border); color: var(--accent); }
.code-block-card pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #dcebf2;
}
.code-block-card code {
  font-family: var(--mono);
}

/* Comparison & Spec Tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-strong);
  background: var(--panel);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  text-align: left;
  font-size: 14px;
}
.spec-table th,
.spec-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table thead th {
  background: var(--panel-alt);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table td:first-child {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.spec-table td { color: var(--muted); }
.spec-table .celgrid-col {
  background: rgba(62, 224, 168, 0.05);
  color: var(--text);
}
.verified-note {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* Proof Figure (Indexed vs Diffusion) */
.proof-figure {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  overflow: hidden;
  margin-bottom: 20px;
}
.proof-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #0d1218;
}
.proof-figure figcaption {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.proof-figure figcaption strong { color: var(--text); }

/* Metric Strip */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric-box {
  padding: 14px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-box span {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.metric-box strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.metric-box.accent strong { color: var(--accent); }

/* FAQ Accordion / Semantic Blocks */
.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.faq-item {
  padding: 18px 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item h3 {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.faq-item p {
  font-size: 14px;
  color: var(--muted);
}

/* CTA Banner */
.cta-band {
  padding: 28px;
  border-radius: var(--radius-card);
  border: 1px solid var(--accent-border);
  background: linear-gradient(155deg, rgba(62, 224, 168, 0.1), var(--panel));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.cta-band h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.cta-band p {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 60ch;
}
.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Footer Internal-Link Hub */
.site-footer {
  padding: 48px 0 80px;
  background: #090c10;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-logo {
  height: 26px;
  width: auto;
  align-self: flex-start;
}
.footer-brand p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 32ch;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col h3 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 4px;
}
.footer-col a,
.footer-col .footer-link-btn {
  font-size: 13.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.footer-col a:hover,
.footer-col .footer-link-btn:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--faint);
}
.footer-bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .seo-hero-grid { grid-template-columns: 1fr; }
  .sprite-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .nav-inner { padding: 10px 16px 8px; gap: 10px; flex-wrap: wrap; }
  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding: 8px 0 2px;
    border-top: 1px solid var(--border);
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { font-size: 13px; }
  .seo-hero { padding: 20px 0 32px; }
  .seo-hero h1 { font-size: 1.85rem; }
  .seo-section { padding: 34px 0; }
  .hero-sprite-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 12px; }
  .sprite-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid-2,
  .card-grid-3,
  .card-grid-4,
  .faq-list { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-band { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 680px) {
  .table-scroll {
    border: 0;
    background: transparent;
    overflow-x: visible;
  }
  .spec-table {
    min-width: 0;
    display: block;
  }
  .spec-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .spec-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .spec-table tbody tr {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-strong);
    background: var(--panel);
    overflow: hidden;
  }
  .spec-table td {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    white-space: normal;
    word-break: break-word;
    border-bottom: 1px solid var(--border);
  }
  .spec-table td:first-child {
    background: var(--panel-alt);
    font-size: 14.5px;
    white-space: normal;
  }
  .spec-table td:last-child {
    border-bottom: 0;
  }
  .spec-table td[data-label]::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--faint);
  }
  .spec-table td.celgrid-col[data-label]::before {
    color: var(--accent);
  }
}
