:root {
  color-scheme: dark;
  --bg: #070912;
  --panel: rgba(16, 24, 39, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #22d3ee;
  --purple: #a78bfa;
  --green: #34d399;
  --grid-line: rgba(148, 163, 184, 0.08);
  --grid-glow: rgba(124, 58, 237, 0.24);
  --glow-a: #0891b2;
  --glow-b: #7c3aed;
  --shadow: 0 28px 80px rgba(2, 6, 23, 0.38);
  --button-bg: rgba(15, 23, 42, 0.72);
  --code-bg: rgba(2, 6, 23, 0.76);
  --code: #c4b5fd;
  --media-bg: rgba(2, 6, 23, 0.22);
  --source-bg: rgba(2, 6, 23, 0.72);
  --source-dialog-bg: rgba(7, 9, 18, 0.98);
  --source-dialog-code-bg: rgba(2, 6, 23, 0.7);
  --source-dialog-border: rgba(148, 163, 184, 0.24);
  --source-dialog-text: #f8fafc;
  --source-dialog-eyebrow: #34d399;
  --source-dialog-backdrop: rgba(2, 6, 23, 0.78);
  --source-dialog-shadow: 0 34px 120px rgba(0, 0, 0, 0.56);
  --nav-bg: rgba(7, 9, 18, 0.74);
}

:root[data-site-theme="light"] {
  color-scheme: light;
  --bg: #f7fafc;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #475569;
  --blue: #0891b2;
  --purple: #6d28d9;
  --green: #047857;
  --grid-line: rgba(15, 23, 42, 0.08);
  --grid-glow: rgba(14, 165, 233, 0.18);
  --glow-a: #bae6fd;
  --glow-b: #ddd6fe;
  --shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
  --button-bg: rgba(255, 255, 255, 0.78);
  --code-bg: rgba(15, 23, 42, 0.94);
  --code: #c4b5fd;
  --media-bg: rgba(226, 232, 240, 0.42);
  --source-bg: rgba(15, 23, 42, 0.82);
  --source-dialog-bg: rgba(255, 255, 255, 0.98);
  --source-dialog-code-bg: #ffffff;
  --source-dialog-border: rgba(15, 23, 42, 0.14);
  --source-dialog-text: #0f172a;
  --source-dialog-eyebrow: #047857;
  --source-dialog-backdrop: rgba(15, 23, 42, 0.34);
  --source-dialog-shadow: 0 34px 120px rgba(15, 23, 42, 0.24);
  --nav-bg: rgba(255, 255, 255, 0.78);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

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

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, var(--grid-glow), transparent 38%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.glow {
  position: fixed;
  z-index: -2;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.32;
  pointer-events: none;
}

.glow-a {
  top: -160px;
  left: -120px;
  background: var(--glow-a);
}

.glow-b {
  right: -180px;
  bottom: 10%;
  background: var(--glow-b);
}

.nav {
  position: sticky;
  top: 12px;
  z-index: 50;
  width: min(1180px, calc(100% - 40px));
  margin: 12px auto 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--nav-bg);
  box-shadow: 0 16px 50px rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand,
.nav-links,
.nav-actions,
.theme-toggle {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
  font-size: 20px;
}

.nav-links {
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a {
  position: relative;
  padding: 8px 0;
}

.nav-links .github-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.github-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: currentColor;
}

.nav-actions {
  gap: 18px;
  justify-content: flex-end;
}

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

.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
}

.theme-toggle {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}

.theme-toggle button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.hero {
  width: min(1360px, calc(100% - 40px));
  min-height: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(420px, 0.78fr);
  gap: 36px;
  align-items: center;
  padding: 34px 0 82px;
}

.eyebrow,
.section-head span,
.theme-copy > span,
.prompt-copy > span,
.skill-copy > span {
  color: var(--green);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 18px;
  max-width: 860px;
  font-size: clamp(46px, 4.4vw, 64px);
  line-height: 1;
  font-weight: 920;
}

.hero-copy p {
  margin-top: 24px;
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, #06b6d4, #7c3aed);
  border-color: transparent;
}

.install {
  width: fit-content;
  margin-top: 22px;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--code-bg);
  color: var(--code);
  font: 600 14px/1.2 "Fira Code", ui-monospace, monospace;
}

.install span {
  color: var(--green);
}

.hero-frame,
.theme-card,
.gallery article,
.recipe-card,
.quality-item,
.gif-card,
pre,
.metrics,
.theme-copy,
.prompt-copy,
.skill-copy {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-frame {
  border-radius: 18px;
  padding: 12px;
  transform: rotate(1.4deg);
}

.hero-frame img,
.theme-card img,
.gallery img,
.gif-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
}

.metrics {
  width: min(1080px, calc(100% - 40px));
  margin: -32px auto 0;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.metrics div {
  padding: 22px;
  border-right: 1px solid var(--border);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 32px;
  color: var(--text);
}

.metrics span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-head.compact {
  margin: 0;
}

.section h2,
.theme-copy h2,
.prompt-copy h2 {
  margin-top: 10px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  font-weight: 900;
}

.section-head p,
.theme-copy p,
.prompt-copy p,
.recipe-card p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

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

.gallery article {
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 252px;
  cursor: zoom-in;
}

.gallery h3 {
  margin-top: auto;
  padding: 13px 4px 4px;
  font-size: 15px;
  color: #cbd5e1;
}

:root[data-site-theme="light"] .gallery h3 {
  color: #1e293b;
}

.gallery h3 span {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

.media-wrap {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 8.4;
  border-radius: 12px;
  background: var(--media-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.source-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(248, 250, 252, 0.18);
  border-radius: 8px;
  background: var(--source-bg);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 0.86;
}

.source-button:hover {
  opacity: 1;
  border-color: rgba(34, 211, 238, 0.55);
}

.source-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.recipe-card {
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.recipe-card img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.recipe-card h3 {
  font-size: 20px;
}

.recipe-card p {
  font-size: 14px;
}

.recipe-card pre {
  max-height: 360px;
  background: var(--code-bg);
  box-shadow: none;
  backdrop-filter: none;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.quality-item {
  border-radius: 16px;
  padding: 22px;
}

.quality-item span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--green);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.quality-item h3 {
  font-size: 20px;
  line-height: 1.08;
}

.quality-item p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.split {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 32px;
  align-items: start;
}

.hero > *,
.split > *,
.gif-showcase > *,
.themes > *,
.prompt-section > *,
.skill-section > *,
.gallery > *,
.recipe-grid > *,
.quality-grid > * {
  min-width: 0;
}

.agent-install-grid > * {
  min-width: 0;
}

.gif-showcase {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 28px;
  align-items: center;
}

.gif-copy > span {
  color: var(--green);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.gif-copy p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.gif-copy pre {
  margin-top: 22px;
  background: var(--code-bg);
}

.gif-card {
  border-radius: 18px;
  padding: 12px;
}

pre {
  margin: 0;
  border-radius: 16px;
  padding: 24px;
  max-width: 100%;
  overflow: auto;
}

pre.shiki {
  position: relative;
  background: var(--code-bg) !important;
  color: #e1e4e8;
}

pre.shiki:has(.code-copy-button) {
  padding-top: 48px;
}

pre.shiki code {
  display: block;
  min-width: max-content;
  color: inherit;
  font-size: 13px;
  line-height: 1.7;
}

pre.shiki .line {
  min-height: 1.7em;
}

.code-copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font: 800 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  opacity: 0.82;
  backdrop-filter: blur(8px);
}

.code-copy-button:hover {
  opacity: 1;
  border-color: rgba(34, 211, 238, 0.55);
}

code {
  color: var(--code);
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 1em;
  line-height: inherit;
}

p code,
li code {
  font-weight: 600;
}

.source-dialog {
  width: min(1120px, calc(100% - 36px));
  max-height: min(860px, calc(100vh - 36px));
  padding: 0;
  border: 1px solid var(--source-dialog-border);
  border-radius: 18px;
  background: var(--source-dialog-bg);
  color: var(--source-dialog-text);
  box-shadow: var(--source-dialog-shadow);
}

.source-dialog::backdrop {
  background: var(--source-dialog-backdrop);
  backdrop-filter: blur(8px);
}

.source-dialog-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.source-dialog header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.source-dialog header span {
  color: var(--source-dialog-eyebrow);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.source-dialog header h2 {
  margin-top: 6px;
  font-size: 28px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.source-code {
  min-height: 0;
  overflow: auto;
  background: var(--source-dialog-code-bg);
}

.source-code .shiki {
  margin: 0;
  min-height: 520px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  backdrop-filter: none;
}

.source-code .shiki code {
  display: block;
  min-width: max-content;
  padding: 24px;
  color: inherit;
}

.image-dialog {
  width: min(1120px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 64px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--source-dialog-border);
  border-radius: 18px;
  background: var(--source-dialog-bg);
  color: var(--source-dialog-text);
  box-shadow: var(--source-dialog-shadow);
}

.image-dialog::backdrop {
  background: var(--source-dialog-backdrop);
  backdrop-filter: blur(8px);
}

.image-dialog-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}

.image-dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--source-dialog-border);
}

.image-dialog-header h2 {
  margin: 0;
  font-size: 22px;
}

.image-dialog-viewport {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--media-bg);
  overflow: hidden;
}

.image-dialog-viewport img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.themes {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 96px;
}

.prompt-section {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 28px;
  align-items: start;
}

.skill-section {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 28px;
  align-items: start;
}

.prompt-copy,
.skill-copy {
  border-radius: 18px;
  padding: 32px;
}

.skill-copy pre {
  margin-top: 22px;
  background: var(--code-bg);
}

.skill-examples {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 22px;
}

.skill-examples div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--media-bg);
}

.skill-examples strong {
  display: block;
  font-size: 14px;
}

.skill-examples p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.agent-install-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.agent-install-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.agent-install-card > span {
  color: var(--green);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.agent-install-card h3 {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.08;
}

.agent-install-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.agent-install-card pre {
  margin-top: 14px;
  border-radius: 12px;
}

.prompt-preview {
  min-height: 420px;
  max-height: min(760px, calc(100vh - 120px));
  background: var(--code-bg);
}

.theme-card,
.theme-copy {
  border-radius: 18px;
  padding: 12px;
}

.theme-copy {
  padding: 32px;
}

.theme-copy ul {
  margin: 22px 0 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.9;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 60px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

footer a {
  color: var(--text);
}

@media (max-width: 960px) {
  .nav {
    align-items: flex-start;
    gap: 18px;
  }

  .nav,
  .nav-links,
  .nav-actions {
    flex-wrap: wrap;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .hero,
  .split,
  .gif-showcase,
  .themes,
  .prompt-section,
  .skill-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 28px;
  }

  .hero-frame {
    transform: none;
  }

  .metrics,
  .gallery,
  .recipe-grid,
  .quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero,
  .section,
  .nav,
  footer,
  .metrics {
    width: min(100% - 28px, 1180px);
  }

  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-actions {
    display: contents;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .theme-toggle button {
    padding: 0 9px;
    font-size: 11px;
  }

  h1 {
    font-size: 38px;
    line-height: 1.05;
  }

  .hero-copy p {
    font-size: 17px;
  }

  .metrics,
  .gallery,
  .recipe-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .metrics div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .source-dialog header {
    flex-direction: column;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }
}
