/* shader_transitions demo site. Mobile-first: one column by default,
   more columns from 600px and 900px up. Colors match the app and the
   brand mark (doc/brand in the package repo). */

:root {
  color-scheme: dark;
  --bg: #141218;
  --surface: #1d1b23;
  --surface-2: #26232e;
  --code-bg: #0e0c12;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ece6f0;
  --muted: #b9b2c4;
  --violet: #7c4dff;
  --cyan: #00e5ff;
  /* Button gradient ends on blue, not cyan, so white text stays readable. */
  --button: linear-gradient(135deg, #7c4dff, #2962ff);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.875em; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  padding: 8px 14px; border-radius: 8px; background: var(--surface); color: var(--text);
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- Header */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(20, 18, 24, 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.brand-name { font: 600 14px/1 var(--mono); white-space: nowrap; }
.version-chip {
  display: none;
  padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--muted); font: 500 12px/1 var(--mono);
}

.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: none;
  padding: 8px 12px; border-radius: 8px;
  color: var(--muted); font-size: 14px; text-decoration: none;
}
.icon-link { display: inline-flex; padding: 8px; border-radius: 8px; color: var(--muted); }
.nav-link:hover, .icon-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: 1px solid transparent; border-radius: 10px;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-primary { background: var(--button); color: #fff; box-shadow: 0 10px 28px -12px rgba(124, 77, 255, 0.8); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: 14px; }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -12px rgba(41, 98, 255, 0.9); }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
}

.copy {
  flex: none;
  padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font: 600 13px/1.2 var(--font); cursor: pointer;
}
.copy:hover { background: #312d3a; }
.copy:disabled { cursor: default; color: var(--cyan); }

.install {
  display: flex; align-items: center; gap: 12px; max-width: 100%;
  padding: 8px 8px 8px 16px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface);
}
/* Wraps after "add" on narrow phones rather than hiding part of the command. */
.install code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.install code::before { content: "$ "; color: var(--muted); }

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

.hero { position: relative; isolation: isolate; padding: 40px 0 24px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 640px; height: 640px; right: -220px; top: -260px;
  background: radial-gradient(closest-side, rgba(124, 77, 255, 0.28), transparent);
}
/* minmax(0, 1fr): a track may shrink below its content (the install command
   scrolls instead of widening the page on phones). */
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; }

.eyebrow { margin: 0; color: var(--cyan); font: 600 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
h1 { margin: 12px 0 16px; font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.6rem); letter-spacing: -0.025em; }
.gradient-text {
  background: linear-gradient(90deg, #a98bff, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 0; max-width: 58ch; color: var(--muted); font-size: 17px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 20px; }
.hero-copy .install { width: fit-content; }

.hero-media { margin: 0; }
.window {
  overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(124, 77, 255, 0.18);
}
.window-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.window img { width: 100%; aspect-ratio: 16 / 9; background: var(--code-bg); }
.hero-media figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- Sections */

.section { padding: 56px 0; }
.section-tight { padding: 24px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
.section-head p { margin: 0; max-width: 64ch; color: var(--muted); }

.features { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.feature { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 16px; }
.feature h3::before {
  content: ""; flex: none; width: 9px; height: 9px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.feature code, .note code, .card-body p code { color: #d3c4ff; }

/* ---------------------------------------------------------------- Showcase */

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px); border-color: rgba(124, 77, 255, 0.5);
    box-shadow: 0 18px 40px -20px rgba(124, 77, 255, 0.6);
  }
}
.card-media { display: block; background: var(--code-bg); }
.card-media img { width: 100%; aspect-ratio: 1; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.card-body h3 { margin: 0; font-size: 17px; }
.card-body p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card-body > code {
  align-self: flex-start; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); color: #d3c4ff; font-size: 12.5px;
}
.try {
  align-self: flex-start; margin-top: auto; padding-top: 6px;
  color: var(--cyan); font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.try:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Get started */

.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step {
  min-width: 0; padding: 18px 20px 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.step h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 16px; }
.step h3::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--button); color: #fff; font: 700 13px/1 var(--font);
}
.code { position: relative; }
.code .copy { position: absolute; top: 8px; right: 8px; }
pre {
  margin: 0; padding: 16px; overflow-x: auto;
  border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg);
  font: 13px/1.65 var(--mono); tab-size: 2;
}
pre code { font-size: inherit; }
.note { margin: 20px 0 0; color: var(--muted); font-size: 14.5px; }
.note a { color: var(--cyan); }

/* ---------------------------------------------------------------- Footer */

.site-footer { margin-top: 24px; padding: 32px 0 40px; border-top: 1px solid var(--border); }
.footer-inner { display: grid; gap: 14px; }
.footer-meta { margin: 0; color: var(--muted); font-size: 14px; }
.footer-meta a { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Wider screens */

@media (max-width: 379px) {
  .site-header .brand-name { display: none; }
}

@media (min-width: 480px) {
  .version-chip { display: inline-block; }
}

@media (min-width: 600px) {
  .features, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: auto 1fr; align-items: center; column-gap: 24px; }
  .footer-links { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .nav-link { display: inline-block; }
  .hero { padding: 72px 0 40px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-wide { grid-column: 1 / -1; }
  .step-wide .install { width: fit-content; }
  .section { padding: 56px 0; }
}

@media (min-width: 1000px) {
  .features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
  .btn-primary:hover, .card:hover { transform: none; }
}
