/* Best Codex Pets — curated showcase (light, playful-clean) */
:root {
  --bg: #f3f5f8;
  --bg-elev: #ffffff;
  --bg-soft: #e8edf3;
  --ink: #14181f;
  --muted: #5c6675;
  --line: #d5dbe5;
  --accent: #e4572e;
  --accent-ink: #fff8f5;
  --accent-soft: #ffe4db;
  --stage: #1a2030;
  --stage-glow: #3d5a80;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(20, 24, 31, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 24, 31, 0.12);
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --max: 1120px;
  --header-h: 4rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 85% -5%, #ffd8cc 0%, transparent 55%),
    radial-gradient(700px 380px at -5% 15%, #d9e6ff 0%, transparent 50%),
    var(--bg);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }

/* —— Header —— */
.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.05rem; color: var(--ink);
  letter-spacing: -0.03em; text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 2rem; height: 2rem;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 10px rgba(228, 87, 46, 0.42));
}
.logo-mark svg {
  width: 100%; height: 100%;
  display: block;
}
.logo span { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-size: 0.92rem; font-weight: 500;
  padding: 0.4rem 0.75rem; border-radius: 999px; text-decoration: none;
}
.nav a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.nav a[aria-current="page"] {
  color: var(--ink); background: var(--bg-elev);
  box-shadow: 0 0 0 1px var(--line);
}

/* —— Hero (GeFei first screen) —— */
.hero {
  display: grid; gap: 2rem;
  padding: 2.25rem 0 1.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    padding: 3rem 0 2rem;
    min-height: calc(100dvh - var(--header-h) - 4rem);
  }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 0.35rem 0.7rem;
  border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  font-weight: 750; line-height: 1.08;
  letter-spacing: -0.045em; margin: 0 0 1rem;
}
.hero h1 em {
  font-style: normal; color: var(--accent);
}
.hero-lead {
  color: var(--muted); font-size: 1.08rem; max-width: 34rem;
  margin: 0 0 1.5rem;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1.25rem;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem;
  color: var(--muted); font-size: 0.88rem;
}
.hero-meta strong { color: var(--ink); font-weight: 650; }

.hero-stage {
  position: relative;
  background: radial-gradient(ellipse at 50% 30%, var(--stage-glow), var(--stage) 70%);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.75rem 1.25rem 1.35rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 320px;
  display: grid; place-items: center;
}
.hero-stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 75%);
  pointer-events: none;
}
.hero-stage canvas {
  image-rendering: pixelated;
  position: relative; z-index: 1;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.45));
}
.stage-caption {
  position: relative; z-index: 1;
  margin-top: 0.85rem; text-align: center;
  color: #c9d2e0; font-size: 0.85rem;
}
.stage-caption strong { color: #fff; font-weight: 650; }
.stage-dot {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0.7;
  animation: floaty 4s ease-in-out infinite;
}
.stage-dot:nth-child(1) { top: 18%; left: 14%; animation-delay: 0s; }
.stage-dot:nth-child(2) { top: 28%; right: 16%; animation-delay: 1.2s; }
.stage-dot:nth-child(3) { bottom: 22%; left: 22%; animation-delay: 0.6s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 0.9; }
}

/* —— Gallery section —— */
.gallery-head {
  display: flex; flex-wrap: wrap; align-items: end;
  justify-content: space-between; gap: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.gallery-head h2 {
  margin: 0; font-size: 1.45rem; letter-spacing: -0.03em; font-weight: 700;
}
.gallery-head p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }

.tabs {
  display: flex; gap: 0.3rem; flex-wrap: wrap;
  padding: 0.28rem; background: var(--bg-elev);
  border-radius: 999px; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(20,24,31,0.04);
}
.tab {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 0.9rem; font-weight: 550;
  padding: 0.5rem 1.05rem; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--ink); color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.15rem;
  padding-bottom: 2.5rem;
}

.card {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit; text-decoration: none;
  box-shadow: 0 2px 8px rgba(20,24,31,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  text-decoration: none; color: inherit;
}
.card-preview {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 40%, #3a4863 0%, #1c2333 70%);
  display: grid; place-items: center;
  position: relative;
}
.card-preview canvas { image-rendering: pixelated; }
.card-preview .pill {
  position: absolute; top: 0.7rem; left: 0.7rem;
  font-size: 0.68rem; font-weight: 650; letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
}
.card-body { padding: 1rem 1.05rem 1.15rem; }
.card-body h2 {
  font-size: 1.12rem; margin: 0 0 0.2rem;
  letter-spacing: -0.025em; font-weight: 700;
}
.meta { color: var(--muted); font-size: 0.8rem; margin: 0 0 0.45rem; }
.card-body p {
  margin: 0; color: var(--muted); font-size: 0.88rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* —— SEO / landing copy (GeFei second screen) —— */
.landing-copy {
  background: var(--bg-elev);
  border-block: 1px solid var(--line);
  padding: 3rem 0;
  margin-top: 0.5rem;
}
.landing-grid {
  display: grid; gap: 1.75rem;
}
@media (min-width: 800px) {
  .landing-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}
.landing-card h2 {
  font-size: 1.15rem; margin: 0 0 0.55rem;
  letter-spacing: -0.02em; font-weight: 700;
}
.landing-card p {
  margin: 0; color: var(--muted); font-size: 0.95rem;
}

/* —— Inner pages —— */
.page { padding: 2.25rem 0 3.5rem; }
.page h1 {
  font-size: clamp(1.85rem, 3.5vw, 2.4rem);
  margin: 0 0 0.75rem; letter-spacing: -0.035em; font-weight: 750;
}
.prose { max-width: 42rem; color: var(--muted); }
.prose h2 {
  color: var(--ink); font-size: 1.2rem; font-weight: 700;
  margin: 1.85rem 0 0.55rem; letter-spacing: -0.02em;
}
.prose code, .mono {
  font-family: var(--font-mono);
  font-size: 0.86em; background: var(--bg-soft);
  padding: 0.12em 0.4em; border-radius: 6px; color: var(--ink);
}
.prose pre {
  font-family: var(--font-mono); font-size: 0.85rem;
  background: var(--stage); color: #e8eef8;
  border: 0; padding: 1.1rem 1.2rem; border-radius: var(--radius-sm);
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.pet-layout {
  display: grid; gap: 1.75rem; grid-template-columns: 1fr;
  align-items: start;
  min-width: 0;
}
@media (min-width: 800px) {
  .pet-layout { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
}
.pet-layout > * { min-width: 0; max-width: 100%; }

.pet-info .prose { max-width: none; }
.pet-info pre {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.stage {
  background: radial-gradient(ellipse at 50% 30%, var(--stage-glow), var(--stage) 70%);
  border-radius: var(--radius); padding: 1.25rem;
  display: grid; place-items: center; gap: 0.85rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
}
.stage-frame {
  width: min(100%, 256px);
  aspect-ratio: 192 / 208;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.stage canvas {
  image-rendering: pixelated;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
}
.states { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.states button {
  appearance: none; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06); color: #b8c4d8;
  border-radius: 999px; padding: 0.35rem 0.7rem;
  font: inherit; font-size: 0.76rem; cursor: pointer;
}
.states button[aria-pressed="true"] {
  border-color: transparent; background: var(--accent); color: #fff;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.7rem 1.2rem; border-radius: 999px;
  font: inherit; font-weight: 650; font-size: 0.95rem;
  cursor: pointer; border: 0; text-decoration: none;
  transition: transform 0.12s, filter 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 22px rgba(228, 87, 46, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: var(--bg-elev); color: var(--ink);
  border: 1px solid var(--line);
}
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.75rem; }
.badge {
  font-size: 0.72rem; font-weight: 600; padding: 0.28rem 0.65rem;
  border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); background: var(--bg-elev);
}
.badge.accent {
  border-color: transparent; background: var(--accent-soft); color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line); padding: 1.6rem 0 2.4rem;
  color: var(--muted); font-size: 0.85rem; background: color-mix(in srgb, var(--bg) 60%, #fff);
}
.site-footer .inner {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
  align-items: baseline;
}
.site-footer .fine {
  font-size: 0.72rem; color: color-mix(in srgb, var(--muted) 75%, transparent);
}
.install-steps {
  list-style: none; padding: 0; margin: 1.25rem 0 1.75rem;
  counter-reset: step;
  display: grid; gap: 0.85rem;
}
.install-steps li {
  position: relative;
  padding: 0.95rem 1.05rem 0.95rem 3.1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}
.install-steps li strong {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 700;
}
.install-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0.85rem; top: 0.95rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 0.85rem;
}
.install-steps code {
  font-family: var(--font-mono);
  font-size: 0.86em; background: var(--bg-soft);
  padding: 0.12em 0.4em; border-radius: 6px;
}
.install-steps pre {
  margin: 0.55rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--stage);
  color: #e8eef8;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty { color: var(--muted); padding: 2rem 0; }

/* —— Install command block —— */
.install-cmd {
  margin: 0.75rem 0 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--stage);
  color: #e8edf5;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.install-cmd code {
  font-family: inherit;
  color: inherit;
  background: transparent;
  padding: 0;
}
