/*
 * CodexPetHub — PetDex-inspired green refresh
 * Tokens keep the lightweight PostHog structure while shifting the surface
 * palette toward mint, olive, and lime for the gallery experience.
 */

:root {
  /* Colors — surfaces and backgrounds */
  --bg: #f6fbf2;
  --surface-sage: #eef8e8;
  --surface-light-sage: #e2f2d8;
  --surface-tan: #d8e8c6;

  /* Colors — text */
  --text: #263428;
  --text-deep: #07170c;
  --text-muted: #58665a;
  --text-placeholder: #8b9a8e;

  /* Colors — borders */
  --border: #c6d8c1;
  --border-light: #d9e6d5;

  /* Colors — accents */
  --accent-orange: #16a34a;
  --accent-gold: #84cc16;
  --accent-gold-border: #2f7d32;

  /* Colors — CTAs and interactive */
  --cta-dark: #06140a;
  --focus-blue: #3b82f6;
  --hover-bg: #edf8e9;

  /* Radii — keep corners subtle and functional */
  --r-2: 2px;
  --r-4: 4px;
  --r-6: 6px;
  --r-pill: 9999px;

  /* Fonts */
  --font-ui: "IBM Plex Sans Variable", "IBM Plex Sans", -apple-system, system-ui, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Source Code Pro", monospace;

  /* Elevation — only one shadow per PostHog system */
  --shadow-elevated: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);
  --hero-gradient: linear-gradient(115deg, #eaf8e4 0%, #f9fbf5 42%, #78d875 100%);
  --card-glow: radial-gradient(circle at 50% 40%, rgba(121, 220, 105, 0.28), rgba(255, 255, 255, 0) 58%);
}

/* Self-hosted IBM Plex Sans Variable.
   The .woff2 file ships at /static/fonts/ibm-plex-sans-var.woff2 once a
   subset has been generated; until then the local() fallback or system
   font stack is used (font-display: swap keeps text visible). */
@font-face {
  font-family: "IBM Plex Sans Variable";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: local("IBM Plex Sans"),
       url("/static/fonts/ibm-plex-sans-var.woff2") format("woff2");
}

/* Reset minimal — keep deliberate for SSR HTML-first site */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.50;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings — bold, confident, dominant per spec */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text-deep);
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.40;
}

h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.20;
  letter-spacing: 0;
}

h2 {
  font-size: 36px;
  line-height: 1.50;
}

h3 {
  font-size: 24px;
  line-height: 1.33;
}

h4 {
  font-size: 20px;
  line-height: 1.40;
  letter-spacing: 0;
}

p {
  margin: 0 0 16px 0;
}

/* Links — deep olive at rest, green accent on hover */
a {
  color: var(--text-deep);
  text-decoration: none;
}

a:hover {
  color: var(--accent-orange);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
  border-radius: var(--r-2);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.43;
}

/* Buttons — base shared styles */
.btn-dark,
.btn-sage,
.btn-tan,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.50;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease;
  text-decoration: none;
}

.btn-dark:focus-visible,
.btn-sage:focus-visible,
.btn-tan:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

/* Dark Primary — the main CTA stays fully opaque on hover so it never reads disabled. */
.btn-dark {
  background: var(--cta-dark);
  color: #ffffff;
  border-radius: var(--r-6);
  padding: 10px 12px;
}

.btn-dark:hover {
  opacity: 1;
  color: #ffffff;
  background: #0a2410;
  border-color: var(--pixel-lime, var(--accent-gold));
  text-decoration: none;
}

.btn-dark:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* Sage Light — compact utility button */
.btn-sage {
  background: var(--surface-light-sage);
  color: var(--text);
  border-radius: var(--r-4);
  padding: 4px 8px;
}

.btn-sage:hover {
  background: var(--hover-bg);
  color: var(--accent-orange);
  text-decoration: none;
}

/* Warm Tan Featured — premium actions */
.btn-tan {
  background: var(--surface-tan);
  color: var(--text-deep);
  border-radius: 0;
  padding: 10px 12px;
}

.btn-tan:hover {
  color: var(--accent-orange);
  text-decoration: none;
}

/* Near-white Ghost — minimal presence */
.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border-radius: var(--r-4);
  border: 1px solid transparent;
  padding: 4px 8px;
}

.btn-ghost:hover {
  color: var(--accent-orange);
  text-decoration: none;
}

/* Cards — bordered + sage variant */
.card {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 12px;
}

.card-sage {
  background: var(--surface-sage);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 12px;
}

/* Elevated surface — modals, dropdowns; the only shadow we use */
.elevated {
  box-shadow: var(--shadow-elevated);
}

/* Inputs */
.input {
  display: inline-block;
  width: 100%;
  background: var(--surface-sage);
  color: var(--text-deep);
  border: 1px solid var(--border-light);
  border-radius: var(--r-4);
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.50;
}

.input::placeholder {
  color: var(--text-placeholder);
}

.input:focus,
.input:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 0;
  outline-color: rgba(59, 130, 246, 0.5);
}

/* Tags / pills */
.tag {
  display: inline-block;
  background: var(--surface-sage);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.50;
}

.tag:hover {
  color: var(--accent-orange);
  text-decoration: none;
}

/* Sprite preview helper — used by pet cards (Task 7) and pet pages (Task 9).
   The base frame is static; the gallery refresh layer below turns on idle
   animation for pet-heavy surfaces. */
.sprite-preview {
  --sprite-frames: 6;
  --sprite-end-x: -1152px;
  display: block;
  width: 192px;
  height: 208px;
  background-image: var(--sprite-url);
  background-repeat: no-repeat;
  background-size: 1536px 1872px;
  background-position: 0 0;
  image-rendering: pixelated;
}

@keyframes sprite-idle {
  from { background-position-x: 0; }
  to   { background-position-x: var(--sprite-end-x, -1152px); }
}

.sprite-preview:hover,
.sprite-preview:focus-visible,
.pet-card:hover .sprite-preview,
.pet-card:focus-within .sprite-preview {
  animation: sprite-idle 1.1s steps(var(--sprite-frames, 6)) infinite;
}

/* Pet card — Architecture §6.4 + DESIGN-posthog.md.
   Base card keeps the original SSR shape; the refresh layer below upgrades it
   into the rounded PetDex-style gallery card.
   \`position: relative\` anchors the catalog-number / featured-star badges
   added in Task 15 (ReBuild.md §3.2). */
.pet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  gap: 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 12px;
  transition: border-color 120ms ease;
}

.pet-card:hover,
.pet-card:focus-within {
  border-color: var(--border-light);
}

.pet-card-preview-link {
  display: block;
  width: 192px;
  height: 208px;
  align-self: center;
  text-decoration: none;
  outline: none;
}

.pet-card-preview {
  width: 192px;
  height: 208px;
}

.pet-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.40;
  color: var(--text-deep);
}

.pet-card-name {
  color: var(--text-deep);
  text-decoration: none;
}

.pet-card:hover .pet-card-name,
.pet-card:focus-within .pet-card-name {
  color: var(--accent-orange);
}

.pet-card-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pet-card-actions {
  margin-top: 4px;
}

.pet-card-cta {
  width: 100%;
}

/* Catalog-number badge (Task 15 / ReBuild.md §3.2). Pokédex-style "No. 001"
   pinned to the top-left corner of the card. Uses the mono font for the
   numeric look and the gold-border ink so it reads as metadata without
   competing with the title. Pointer-events disabled so it never intercepts
   the click target underneath. */
.pet-card-catalog-number {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold-border);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 1;
}

/* Featured-star pill (Task 15). Sage-cream surface with the gold accent so
   the star reads as a soft trophy, not an alert. Sits opposite the catalog
   number in the top-right corner. */
.pet-card-featured-star {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold-border);
  background: var(--surface-sage);
  border: 1px solid var(--accent-gold-border);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 1;
}

/* States pill — sits next to the tag chips in the card body. Sage surface +
   muted ink so it reads as metadata about the atlas, not a clickable tag. */
.pet-card-states-pill {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-light-sage);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  line-height: 1.50;
}

/* Vibe chips (Task 15 + Task 23). The base \`.vibe-chip\` rule mirrors the
   \`.tag\` chip shape so vibes feel adjacent to tags but distinguishable —
   solid color border + matching ink instead of the sage default. Each
   \`vibe-chip-*\` variant overrides border-color and color; backgrounds stay
   sage for legibility on the parchment surface. */
.pet-card-vibes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vibe-chip {
  display: inline-block;
  background: var(--surface-sage);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.50;
  text-decoration: none;
}

.vibe-chip:hover,
.vibe-chip:focus-visible {
  color: var(--accent-orange);
  text-decoration: none;
}

.vibe-chip-amber-gold {
  color: var(--accent-gold-border);
  border-color: var(--accent-gold-border);
}

.vibe-chip-orange-subtle {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.vibe-chip-deep-olive {
  color: var(--text-deep);
  border-color: var(--text-deep);
}

.vibe-chip-tan {
  color: var(--text);
  background: var(--surface-tan);
  border-color: var(--surface-tan);
}

.vibe-chip-sage-placeholder {
  color: var(--text-placeholder);
  border-color: var(--text-placeholder);
}

.vibe-chip-olive-ink {
  color: var(--text);
  border-color: var(--text);
}

.vibe-chip-gold-border {
  color: var(--accent-gold-border);
  background: var(--surface-light-sage);
  border-color: var(--accent-gold-border);
}

.vibe-chip-border-light {
  color: var(--text-muted);
  border-color: var(--border-light);
}

.vibe-chip-cta-dark {
  color: #ffffff;
  background: var(--cta-dark);
  border-color: var(--cta-dark);
}

.vibe-chip-focus-blue {
  color: var(--focus-blue);
  border-color: var(--focus-blue);
}

.vibe-chip-muted-olive {
  color: var(--text-muted);
  border-color: var(--text-muted);
}

.vibe-chip-orange-deep {
  color: #ffffff;
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

/* Pet grid — content-visibility:auto keeps off-screen cards out of layout/
   paint until they scroll close. contain-intrinsic-size reserves space so
   the scrollbar doesn't jump as cards realize. */
.pet-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.pet-grid-item {
  display: flex;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

.pet-grid-empty {
  color: var(--text-muted);
  font-size: 15px;
}

/* Homepage sections — hero, how-it-works, feeds, collections, tags, FAQ.
   PostHog parchment bg already inherited from body; sections use generous
   vertical rhythm and a max-width container to stay legible on wide screens. */
.page-home main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 48px 0 16px;
}

.home-hero-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-deep);
  line-height: 1.1;
  margin: 0;
}

.home-hero-subhead {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  max-width: 60ch;
  margin: 0;
}

.home-hero-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.home-hero-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.home-hero-search-input {
  flex: 1 1 280px;
  min-width: 240px;
}

.home-hero-install {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
}

.home-hero-install-label {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-hero-install-cmd {
  flex: 1 1 280px;
  min-width: 240px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-deep);
  background: transparent;
  padding: 0;
  user-select: all;
  white-space: nowrap;
  overflow: auto;
}

.home-hero-install-copy {
  flex: 0 0 auto;
}

.home-hero-install-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 60ch;
}

.home-hero-copy-status {
  margin: 4px 0 0;
  min-height: 1.4em;
  color: var(--text-muted);
  font-size: 13px;
}

.home-hero-ctas {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.home-feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.home-feed-more {
  font-size: 14px;
  color: var(--text-muted);
}

.home-how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.home-how-step {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 16px;
}

.home-how-step-n {
  font-family: var(--font-mono);
  color: var(--accent-gold-border);
  font-size: 13px;
  font-weight: 700;
}

.home-how-step-title {
  margin: 4px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-deep);
}

.home-how-step-body {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

/* Featured-pets carousel (Task 16). Horizontal scroll-snap rail; cards keep
   their normal width and overflow scrolls. The whole rail is keyboard-
   reachable because the card body still contains anchor links. */
.home-featured-rail {
  list-style: none;
  margin: 0;
  padding: 4px 0 12px;
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.home-featured-item {
  flex: 0 0 260px;
  min-width: 260px;
  scroll-snap-align: start;
}

/* Filter toolbar above the trending grid (Task 16). Stacks search + two facet
   axes; chip rows wrap so the toolbar grows vertically on narrow viewports
   instead of demanding horizontal scroll. */
.home-toolbar {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-toolbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-deep);
}

.home-toolbar-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-toolbar-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.home-toolbar-search-input {
  flex: 1 1 240px;
  min-width: 240px;
}

.home-toolbar-form > .home-toolbar-search-input,
.home-toolbar-form > .home-toolbar-submit {
  align-self: flex-start;
}

.home-toolbar-facet {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-toolbar-facet legend {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.home-toolbar-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-toolbar-radio,
.home-toolbar-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.home-toolbar-noscript {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.chip:hover {
  color: var(--accent-orange);
}

.chip.is-active {
  background: var(--cta-dark);
  color: var(--bg);
  border-color: var(--cta-dark);
}

.chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.chip.is-active .chip-count {
  color: var(--bg);
  opacity: 0.8;
}

/* Browse-page filter toolbar (Task 17). Mirrors the homepage \`.home-toolbar\`
   markup so the two surfaces share visual identity — kind chips, vibe chips,
   and the search input use the same \`.chip\` / \`.vibe-chip-*\` classes; only
   the wrapping selectors differ. */
.pets-toolbar {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pets-toolbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-deep);
}

.pets-toolbar-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pets-toolbar-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pets-toolbar-search-input {
  flex: 1 1 240px;
  min-width: 240px;
}

.pets-toolbar-form > .pets-toolbar-search-input,
.pets-toolbar-form > .pets-toolbar-submit {
  align-self: flex-start;
}

.pets-toolbar-facet {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pets-toolbar-facet legend {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pets-toolbar-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pets-toolbar-radio,
.pets-toolbar-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pets-toolbar-noscript {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.home-collections-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.home-collection {
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg);
}

.home-collection-link {
  display: block;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
}

.home-collection-link:hover {
  color: var(--accent-orange);
}

.home-collection-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-deep);
}

.home-collection-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.home-tags-cloud {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-publish {
  background: var(--surface-light-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.home-agents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.home-agents-list a {
  font-size: 15px;
}

.home-faq-list {
  margin: 0;
}

.home-faq-q {
  font-weight: 700;
  color: var(--text-deep);
  margin-top: 16px;
}

.home-faq-a {
  margin: 4px 0 0;
  color: var(--text);
}

/* Pet detail page (Task 9, architecture §6.5).
   Two-column hero, breadcrumb, state-selector chips, install-modal placeholder,
   agent-resources card, instructions list, details table, related-pets strip. */
.page-pet main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.pet-breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
}

.pet-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pet-breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--text-placeholder);
}

.pet-breadcrumb a {
  color: var(--text-muted);
}

.pet-breadcrumb [aria-current="page"] {
  color: var(--text-deep);
  font-weight: 600;
}

.pet-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 720px) {
  .pet-hero {
    grid-template-columns: 1fr;
  }
}

.pet-hero-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.pet-preview {
  --sprite-frames: 6;
  --sprite-end-x: -1380px;
  width: 230px;
  height: 250px;
  background-image: var(--sprite-url);
  background-repeat: no-repeat;
  background-size: 1840px 2250px;
  background-position: 0 0;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background-color: var(--surface-sage);
}

.pet-preview:hover,
.pet-preview:focus-visible {
  animation: sprite-idle 1.1s steps(var(--sprite-frames, 6)) infinite;
}

.pet-state-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  justify-content: center;
  width: min(100%, 520px);
}

.pet-state-btn {
  --state-frames: 6;
  --state-end-x: -1152px;
  font-family: var(--font-ui);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-sage);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.pet-state-btn-preview {
  grid-row: 1 / 3;
  width: 54px;
  height: 59px;
  background-image: var(--sprite-url);
  background-repeat: no-repeat;
  background-size: 432px 531px;
  background-position: 0 var(--state-y, 0);
  image-rendering: pixelated;
  animation: sprite-idle 1.1s steps(var(--state-frames, 6)) infinite;
}

.pet-state-btn-label {
  min-width: 0;
  color: var(--text-deep);
  font-weight: 700;
  line-height: 1.15;
  text-transform: capitalize;
}

.pet-state-btn-meta {
  min-width: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
}

.pet-state-btn:hover,
.pet-state-btn:focus-visible {
  color: var(--accent-orange);
}

.pet-state-btn[aria-pressed="true"] {
  background: var(--cta-dark);
  color: #ffffff;
  border-color: var(--cta-dark);
}

.pet-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pet-hero-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-deep);
}

.pet-hero-description {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  max-width: 60ch;
}

.pet-hero-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pet-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pet-hero-share-status {
  margin: 4px 0 0;
  min-height: 1.4em;
  font-size: 13px;
  color: var(--text-muted);
}

.pet-hero-share-status:empty {
  margin: 0;
  min-height: 0;
}

/* Trust badges in the hero meta column (Task 19, ReBuild.md §3.2 row 4).
   ★ Featured uses the amber-gold accent so it tracks the same visual signal
   as the pet-card featured-star pill; ✓ Curated uses the deep-olive accent
   to read as "editorially vouched for." Inline pills, no creator surfaces. */
.pet-hero-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pet-hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.pet-hero-badge-featured {
  color: var(--amber-gold-text, var(--text-deep));
  border-color: var(--amber-gold, var(--border));
  background: var(--amber-gold-bg, var(--bg));
}

.pet-hero-badge-curated {
  color: var(--olive-ink, var(--text-deep));
  border-color: var(--olive-ink, var(--border));
  background: var(--sage-cream, var(--bg));
}

/* Stats pair near the install steps (Task 19). Two count tokens separated
   by a middot — no third creator stat (ReBuild.md §3.2 row 4). Inline so it
   stays under the description without wasting vertical space. */
.pet-hero-stats {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.pet-hero-stat strong {
  color: var(--text-deep);
  font-weight: 700;
  margin-right: 2px;
}

.pet-hero-stats-sep {
  color: var(--text-muted);
}

/* Install modal — Task 10. The only elevated surface in the page; uses the
   shared --shadow-elevated. Centered via fixed positioning + transform so the
   <dialog> renders above everything without depending on the browser-native
   <dialog> top-layer (we toggle [hidden] manually for cross-browser parity).
   Focus ring is the only blue on the site, used at 50% opacity per spec. */
.pet-install-modal {
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: min(480px, calc(100vw - 32px));
  max-width: 480px;
  padding: 24px;
  border-radius: var(--r-6);
  box-shadow: var(--shadow-elevated);
  z-index: 100;
}

.pet-install-modal[hidden] {
  display: none;
}

.pet-install-modal:focus,
.pet-install-modal:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.pet-install-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.pet-install-modal-close:hover {
  color: var(--accent-orange);
  background: var(--hover-bg);
}

.pet-install-modal-close:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.pet-install-steps {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--text);
}

.pet-install-modal-status {
  margin: 0 0 8px;
  min-height: 1.5em;
  font-size: 14px;
  color: var(--text-muted);
}

.pet-install-modal-status:empty {
  margin: 0;
  min-height: 0;
}

.pet-install-modal-links {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.pet-install-modal-links a {
  color: var(--text-deep);
}

/* Install steps (Task 18 / ReBuild.md §3.2.3). Two stacked step cards on
   the pet detail page: Step 1 holds the InstallTabToggle, Step 2 walks the
   user through Codex Settings → Appearance → Pets. Sage-cream surface +
   dark CTA badge so the steps read as a unified instructional block, not a
   row of card-shaped buttons. */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.install-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface-sage);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: 20px;
}

.install-step-badge {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cta-dark);
  color: #ffffff;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.install-step-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.install-step-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-deep);
  line-height: 1.4;
}

.install-step-bullets {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-step-bullets strong {
  color: var(--text-deep);
}

.install-step-bullets code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}

/* Install tab toggle (Task 18). Two tabs above two panels — Codex prompt
   vs CLI command. Both panels render server-side; the CLI panel ships with
   the \`hidden\` attribute so a no-JS user sees the default Codex tab. Client
   JS in app.js reads localStorage (\`cph:install-tab\`) and swaps panels +
   \`aria-selected\` on tab change, persisting the user's choice. */
.install-tab-toggle {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-tab-toggle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.install-tab-toggle-tab {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  margin-bottom: -1px;
  cursor: pointer;
}

.install-tab-toggle-tab:hover {
  color: var(--accent-orange);
}

.install-tab-toggle-tab:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}

.install-tab-toggle-tab[aria-selected="true"],
.install-tab-toggle-tab.is-active {
  color: var(--text-deep);
  border-bottom-color: var(--cta-dark);
}

.install-tab-toggle-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-tab-toggle-panel[hidden] {
  display: none;
}

.install-tab-toggle-hint {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.install-tab-toggle-hint code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}

.install-tab-toggle-cmd {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-deep);
  overflow-x: auto;
  white-space: nowrap;
}

.install-tab-toggle-copy {
  align-self: flex-start;
}

.install-tab-toggle-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 13px;
  color: var(--text-muted);
}

.install-tab-toggle-status:empty {
  margin: 0;
  min-height: 0;
}

.pet-agents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 15px;
}

.pet-instructions-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-instructions-steps strong {
  color: var(--text-deep);
}

.pet-instructions-steps code {
  background: var(--surface-sage);
  padding: 1px 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}

.pet-details-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pet-details-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.pet-details-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.pet-details-row dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.pet-details-row dd {
  margin: 0;
  color: var(--text-deep);
  font-size: 14px;
  word-break: break-all;
}

.pet-details-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-sage);
  padding: 1px 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}

.pet-not-found {
  text-align: center;
  padding: 64px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.page-pet-not-found main {
  max-width: 720px;
  margin: 0 auto;
}

.pet-not-found-slug {
  font-family: var(--font-mono);
  background: var(--surface-sage);
  padding: 1px 6px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}

.pet-not-found-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Generic 404 page (Task 21). Used by the global app.notFound handler for
   any HTML route that didn't match. Mirrors the centered hero shape of
   .pet-not-found and surfaces a search box + popular-pets rail underneath. */
.page-not-found main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

.not-found-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.not-found-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding: 24px 0 0;
}

.not-found-header h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.not-found-lede {
  color: var(--text-muted);
  margin: 0;
  max-width: 56ch;
}

.not-found-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

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

.not-found-search-input {
  min-width: 280px;
}

.not-found-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.not-found-popular {
  margin-top: 16px;
}

.not-found-popular h2 {
  margin: 0 0 16px;
}

/* Manual download landing page (Task 15). PostHog tokens — warm parchment
   background already inherited from body, sage card surfaces for the
   contents and security panels. */
.page-pet-download main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px;
}

.pet-download-header h1 {
  margin: 12px 0 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.pet-download-lede {
  color: var(--text-muted);
  margin: 0 0 24px;
}

.pet-download-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.pet-download-pending {
  flex-basis: 100%;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.pet-download-contents,
.pet-download-security {
  margin-bottom: 24px;
  padding: 20px;
}

.pet-download-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-download-list code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
}

.pet-download-hashes {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Confirmation toast (Task 22). One container per page (\`#cph-toast\` in
   layout). The container is \`[hidden]\` until \`showToast()\` strips that
   attribute and adds \`.is-visible\`; the visible state fades in via opacity
   + translate, then the JS handler reverses the class after 2.5 s and
   re-applies \`[hidden]\` once the fade-out completes. Sage-cream surface +
   olive ink keeps the toast in the same palette as cards and chips, so it
   reads as system feedback rather than an alert. Pointer events stay on so
   a user could tap to dismiss in a future iteration; today the timer owns
   dismissal exclusively. */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  max-width: 320px;
  padding: 10px 14px;
  background: var(--surface-sage);
  color: var(--text-deep);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  box-shadow: var(--shadow-elevated);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: auto;
}

.toast[hidden] {
  display: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* PetDex-inspired green gallery refresh. This layer intentionally reuses the
   existing SSR hooks instead of adding framework JS. */
body {
  background: #f3f8f0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding-left: max(24px, calc((100vw - 1380px) / 2 + 24px));
  padding-right: max(24px, calc((100vw - 1380px) / 2 + 24px));
  background: rgba(246, 251, 242, 0.76);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(198, 216, 193, 0.62);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-deep);
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
}

.site-logo:hover {
  color: var(--text-deep);
  text-decoration: none;
}

.site-logo-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #2f7d32, #07170c);
  color: #ffffff;
  box-shadow: var(--shadow-elevated);
  font-size: 18px;
}

.site-nav ul,
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: rgba(7, 23, 12, 0.72);
  font-size: 15px;
  font-weight: 560;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent-orange);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(198, 216, 193, 0.82);
  color: var(--text-deep);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.site-cta,
.site-header .btn-dark {
  border-radius: var(--r-pill);
  padding: 8px 18px;
}

.site-footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.footer-credit {
  margin: 18px 0 0;
  font-size: 14px;
}

.page-home main {
  max-width: none;
  padding: 0 0 72px;
  gap: 72px;
}

.home-hero {
  position: relative;
  min-height: 680px;
  margin-top: -64px;
  padding: 142px 24px 56px;
  display: flex;
  align-items: center;
  text-align: center;
  background: var(--hero-gradient);
  overflow: hidden;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(7, 23, 12, 0.1);
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero-eyebrow,
.home-gallery-eyebrow,
.pets-eyebrow,
.home-surprise-eyebrow {
  margin: 0;
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-hero-title {
  font-size: 78px;
  line-height: 0.95;
  font-weight: 850;
  letter-spacing: 0;
}

.home-hero-subhead {
  max-width: 560px;
  margin: 0 auto;
  color: rgba(7, 23, 12, 0.78);
  font-size: 18px;
  line-height: 1.55;
}

.home-hero-install {
  width: min(520px, 100%);
  margin: 8px auto 0;
  padding: 0;
  gap: 0;
  border: 1px solid rgba(198, 216, 193, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  overflow: hidden;
}

.home-hero-install-label {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  letter-spacing: 0;
}

.home-hero-install-cmd {
  min-width: 0;
  padding: 10px 0;
  color: var(--text-deep);
  font-size: 16px;
}

.home-hero-install-copy {
  align-self: stretch;
  min-width: 118px;
  border: 0;
  border-left: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-hero-install-copy:hover {
  color: var(--accent-orange);
}

.home-hero-pets {
  list-style: none;
  margin: 22px 0 4px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.home-hero-pet-card {
  position: relative;
  width: 144px;
  height: 176px;
  display: block;
  padding: 8px 10px 12px;
  border: 1px solid rgba(198, 216, 193, 0.88);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--text-deep);
  text-decoration: none;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: var(--shadow-elevated);
  transition: transform 160ms ease, background-color 160ms ease;
  animation: pixel-card-pop 520ms steps(5, end) var(--pop-delay, 0ms) both;
}

.home-hero-pet-card:hover {
  background: #ffffff;
  border-color: var(--pixel-border);
  color: var(--text-deep);
  text-decoration: none;
  transform: translateY(-6px) rotate(var(--tilt, 0deg));
}

.home-hero-pet-sprite {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 1;
  transform: translateX(-50%) scale(0.52);
  transform-origin: center bottom;
  margin: 0;
}

.home-hero-pet-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  z-index: 2;
  display: block;
  max-width: none;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  max-height: 26px;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}

.home-hero-ctas {
  justify-content: center;
  margin-top: 18px;
}

.home-hero-ctas .btn-dark,
.home-hero-ctas .btn-sage,
.home-surprise-actions .btn-dark,
.home-surprise-actions .btn-sage,
.pets-load-more {
  min-height: 42px;
  border-radius: var(--r-pill);
  padding: 9px 22px;
}

.home-hero-copy-status {
  margin: 0;
}

.home-surprise {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 20;
  width: min(360px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid rgba(198, 216, 193, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-elevated);
}

.home-surprise-title {
  margin: 4px 0 14px;
  font-size: 18px;
  line-height: 1.2;
}

.home-surprise-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.home-surprise-close:hover {
  color: var(--accent-orange);
}

.home-surprise-body {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: center;
}

.home-surprise-sprite {
  transform: scale(0.43);
  transform-origin: center center;
  margin: -58px -54px;
  border-radius: 14px;
  background-color: var(--surface-sage);
}

.home-surprise h3 {
  font-size: 16px;
}

.home-surprise p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.home-surprise-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.home-gallery,
.home-feed,
.home-how,
.home-tags,
.home-publish,
.home-agents,
.home-faq,
.pets-page,
.page-pet main {
  width: min(1380px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}

.home-gallery {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.home-gallery-header,
.pets-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-gallery h2,
.pets-header h1 {
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.home-gallery-more {
  margin: 4px 0 0;
  text-align: center;
}

.home-toolbar,
.pets-toolbar {
  padding: 16px;
  border-color: rgba(198, 216, 193, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.home-toolbar-title,
.pets-toolbar-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.home-toolbar-form,
.pets-toolbar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.home-toolbar-search-input,
.pets-toolbar-search-input,
.input {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border);
  color: var(--text-deep);
}

.home-toolbar-form > .home-toolbar-search-input,
.pets-toolbar-form > .pets-toolbar-search-input {
  width: 100%;
  align-self: stretch;
}

.home-toolbar-submit,
.pets-toolbar-submit {
  align-self: start;
  border-radius: var(--r-pill);
  padding: 8px 18px;
}

.home-toolbar-facet,
.pets-toolbar-facet {
  grid-column: 1 / -1;
  display: block;
}

.home-toolbar-facet legend,
.pets-toolbar-facet legend {
  margin: 0 0 8px;
  padding-top: 0;
  color: var(--text-muted);
  letter-spacing: 0.18em;
}

.chip,
.vibe-chip,
.tag,
.pets-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
}

.chip::before,
.vibe-chip::before,
.pets-sort-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--accent-orange);
}

.tag::before {
  content: "#";
  color: var(--accent-orange);
  font-weight: 700;
}

.chip:hover,
.vibe-chip:hover,
.tag:hover,
.pets-sort-link:hover {
  color: var(--text-deep);
  border-color: var(--accent-orange);
  text-decoration: none;
}

.chip.is-active,
.vibe-chip.is-active,
.tag.is-active,
.pets-sort-link.is-active {
  background: var(--cta-dark);
  color: #ffffff;
  border-color: var(--cta-dark);
}

.chip-count {
  font-size: 10px;
  color: var(--text-muted);
}

.pet-grid {
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 20px;
}

.pet-grid-item {
  display: flex;
  contain-intrinsic-size: 420px;
}

.pet-card {
  width: 100%;
  height: 100%;
  min-height: 388px;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(198, 216, 193, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.pet-card:hover,
.pet-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--pixel-border);
  box-shadow: var(--shadow-elevated);
}

.pet-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2f7d32, #84cc16);
}

.pet-card-topline {
  min-height: 44px;
  padding: 12px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pet-card-catalog-number {
  position: static;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  letter-spacing: inherit;
}

.pet-card-install-count {
  white-space: nowrap;
}

.pet-card-featured-star {
  top: 48px;
  right: 10px;
  padding: 4px 8px;
  background: #f8a70a;
  border-color: #f8a70a;
  color: #06140a;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.pet-card-preview-link {
  width: 100%;
  height: 232px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-glow);
  overflow: visible;
}

.pet-card-preview {
  width: 192px;
  height: 208px;
}

.pet-card-body {
  padding: 16px 18px 18px;
  gap: 10px;
  border-top: 1px solid rgba(198, 216, 193, 0.64);
}

.pet-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pet-card-title {
  min-width: 0;
  font-size: 19px;
  line-height: 1.15;
}

.pet-card-kind {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pet-card-description {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pet-card-tags,
.pet-card-vibes {
  gap: 6px;
}

.pet-card-actions {
  margin-top: auto;
}

.pet-card-cta {
  min-height: 38px;
  border-radius: var(--r-pill);
}

.sprite-preview,
.pet-card .sprite-preview,
.home-hero .sprite-preview,
.home-surprise .sprite-preview,
.pet-preview {
  animation: sprite-idle 1.1s steps(var(--sprite-frames, 6)) infinite;
}

.pets-page {
  padding: 48px 0 72px;
}

.pets-header {
  margin-bottom: 22px;
}

.pets-lede {
  max-width: 680px;
  color: var(--text-muted);
}

.pets-sort {
  margin: 14px 0 12px;
}

.pets-sort-list,
.pets-tags-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pets-tags {
  margin-bottom: 18px;
}

.pets-active-query {
  color: var(--text-muted);
  font-size: 14px;
}

.home-how-steps {
  gap: 18px;
}

.home-how-step,
.home-publish {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border-light);
}

.home-agents-list {
  gap: 10px;
}

.home-agents-list a {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.7);
}

.pet-hero {
  padding: 26px;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
}

.pet-preview {
  border-radius: 22px;
  background-color: var(--surface-sage);
  box-shadow: var(--shadow-elevated);
}

.install-step,
.pet-agents,
.pet-details {
  border-radius: 20px;
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
    height: auto;
    min-height: 64px;
  }

  .site-nav {
    display: none;
  }

  .site-mini-pill {
    display: none;
  }

  .home-hero {
    min-height: 620px;
    padding-top: 118px;
  }

  .home-hero-title {
    font-size: 48px;
  }

  .home-hero-subhead {
    font-size: 16px;
  }

  .home-surprise {
    display: none;
  }

  .home-toolbar-facet,
  .pets-toolbar-facet {
    grid-template-columns: 1fr;
  }

  .home-toolbar-facet legend,
  .pets-toolbar-facet legend {
    padding-top: 0;
  }

  .home-gallery,
  .home-feed,
  .home-how,
  .home-tags,
  .home-publish,
  .home-agents,
  .home-faq,
  .pets-page,
  .page-pet main {
    width: min(100% - 28px, 1380px);
  }
}

/* Reduced motion — disable sprite animation and active scale.
   Users who set prefers-reduced-motion get a static thumbnail only. */
@media (prefers-reduced-motion: reduce) {
  .sprite-preview,
  .sprite-preview:hover,
  .sprite-preview:focus-visible,
  .pet-card:hover .sprite-preview,
  .pet-card:focus-within .sprite-preview,
  .pet-preview,
  .pet-preview:hover,
  .pet-preview:focus-visible {
    animation: none;
  }

  .btn-dark:active,
  .btn-sage:active,
  .btn-tan:active,
  .btn-ghost:active {
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────
 * Editorial: /docs index + /docs/:slug guides (Task 21).
 * Uses PostHog tokens — warm parchment background, olive ink,
 * sage rail card, single elevation shadow. Wide-comfortable
 * measure (~70ch) on the prose column.
 * ───────────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.docs-page {
  max-width: 1100px;
  margin: 24px auto 64px;
  padding: 0 24px;
}

.docs-breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.docs-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.docs-breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border-light);
}

.docs-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--accent-orange);
}

.docs-header {
  margin-bottom: 32px;
}

.docs-h1 {
  font-family: var(--font-ui);
  font-size: 36px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-deep);
  margin: 0 0 12px;
}

.docs-lede {
  max-width: 70ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 8px;
}

.docs-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.docs-alt-link {
  font-size: 14px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 880px) {
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.docs-body {
  max-width: 70ch;
}

.docs-body > * + * {
  margin-top: 16px;
}

.docs-section {
  margin-top: 32px;
}

.docs-section + .docs-section {
  margin-top: 40px;
}

.docs-h2 {
  font-family: var(--font-ui);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-deep);
  margin: 0 0 12px;
}

.docs-h3 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-deep);
  margin: 16px 0 8px;
}

.docs-anchor {
  color: var(--border-light);
  text-decoration: none;
  margin-right: 8px;
  font-weight: 400;
}

.docs-anchor:hover {
  color: var(--accent-orange);
}

.docs-paragraph {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.docs-list {
  margin: 0;
  padding-left: 20px;
}

.docs-list li {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  margin: 4px 0;
}

.docs-code {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-deep);
  overflow-x: auto;
}

.docs-callout {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--r-4);
  padding: 12px 14px;
  background: var(--surface-sage);
}

.docs-callout-warning {
  border-left-color: var(--accent-orange);
}

.docs-callout-info {
  border-left-color: var(--accent-gold-border);
}

.docs-callout p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.docs-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.docs-toc,
.docs-rail-card {
  padding: 16px;
}

.docs-toc h2,
.docs-rail-card h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.docs-toc ol,
.docs-rail-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.docs-toc li a,
.docs-rail-card li a {
  color: var(--text);
  text-decoration: none;
}

.docs-toc li a:hover,
.docs-rail-card li a:hover {
  color: var(--accent-orange);
}

.docs-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.docs-card {
  padding: 20px;
}

.docs-card-title {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-deep);
}

.docs-card-title a {
  color: inherit;
  text-decoration: none;
}

.docs-card-title a:hover {
  color: var(--accent-orange);
}

.docs-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.docs-card-description {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 12px;
}

.docs-card-links {
  display: flex;
  gap: 8px;
  margin: 0;
}

/* Publish page (Task 26) — single-column editorial layout. No upload controls.
   Renders the Turnstile widget and the "Create publish prompt" CTA. */
.publish-page,
.publish-result,
.publish-not-found {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 16px;
}

.publish-lead,
.publish-result-lead {
  font-size: 18px;
  line-height: 1.50;
  color: var(--text);
  margin-top: 16px;
}

.publish-secondary {
  font-size: 14px;
  color: var(--text-muted);
}

.publish-form {
  margin-top: 32px;
  display: grid;
  gap: 16px;
}

.publish-cta {
  justify-self: start;
}

.publish-form-status,
.publish-result-status {
  min-height: 1.5em;
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.publish-noscript-warning,
.publish-test-mode {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.publish-rules {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.publish-rules ul {
  padding-left: 20px;
  margin: 0;
}

.publish-result-meta {
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.publish-result-meta code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-sage);
  padding: 2px 6px;
  border-radius: var(--r-2);
}

.publish-result-copy,
.publish-result-open {
  margin-right: 8px;
}

.publish-result-next {
  margin-top: 32px;
}

.publish-result-next ol {
  padding-left: 20px;
}

/* Mystery Hatch (Task 35) — three closed cards reveal three random pets.
   Reveal animation uses a staggered fade + lift; @media (prefers-reduced-motion: reduce)
   skips the animation entirely so the cards render fully open from frame 0. */
.page-hatch main,
.page-hatch-empty main,
.page-hatch-not-found main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hatch-hero {
  text-align: center;
}

.hatch-hero h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.hatch-hero-body {
  margin: 8px auto 0;
  max-width: 60ch;
  color: var(--text-muted);
}

.hatch-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

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

.hatch-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background: var(--bg);
  padding: 16px;
  min-height: 280px;
  overflow: hidden;
  contain: layout paint;
}

.hatch-card-shell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sage);
  border-radius: var(--r-6);
  font-size: 64px;
  font-weight: 800;
  color: var(--text-muted);
  animation: hatch-shell-fade 720ms ease-out forwards;
  animation-delay: var(--hatch-reveal-delay, 0ms);
  z-index: 1;
}

.hatch-card-shell-glyph {
  transform: scale(1);
  animation: hatch-shell-pop 720ms ease-out forwards;
  animation-delay: var(--hatch-reveal-delay, 0ms);
}

.hatch-card-inner {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  opacity: 0;
  transform: translateY(8px);
  animation: hatch-reveal 600ms ease-out forwards;
  animation-delay: calc(var(--hatch-reveal-delay, 0ms) + 200ms);
}

.hatch-card-preview-link {
  display: block;
}

.hatch-card-preview {
  width: 192px;
  height: 208px;
  background-image: var(--sprite-url);
  background-repeat: no-repeat;
  background-size: 1536px 1872px;
  background-position: 0 0;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  background-color: var(--surface-sage);
  display: block;
}

.hatch-card-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.hatch-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-deep);
}

.hatch-card-name {
  color: inherit;
  text-decoration: none;
}

.hatch-card-name:hover,
.hatch-card-name:focus-visible {
  color: var(--accent-orange);
}

.hatch-card-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

@keyframes hatch-shell-fade {
  0% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes hatch-shell-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(0.85); }
}

@keyframes hatch-reveal {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hatch-card-shell,
  .hatch-card-shell-glyph {
    animation: none;
    opacity: 0;
    visibility: hidden;
  }
  .hatch-card-inner {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hatch-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hatch-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hatch-actions-status {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  min-height: 1.5em;
}

.hatch-actions-details {
  background: var(--surface-sage);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: 12px 16px;
}

.hatch-actions-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-deep);
}

.hatch-actions-manifests {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 14px;
}

.hatch-actions-manifest-url {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

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

.hatch-empty,
.hatch-not-found {
  text-align: center;
}

.hatch-empty h1,
.hatch-not-found h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

/* Skill hub (Task 35b) — \`/skills/codexpethub\`. PostHog editorial layout
   matching /docs and /publish. */
.page-skill-hub main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.skill-hub-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-hub-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-deep);
  margin: 0;
}

.skill-hub-tagline {
  font-size: 18px;
  line-height: 1.50;
  color: var(--text);
  margin: 0;
  max-width: 60ch;
}

.skill-hub-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-hub-copy-disabled {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--r-6);
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

.skill-hub-copy-status {
  min-height: 1.5em;
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.skill-hub-install,
.skill-hub-capabilities,
.skill-hub-paths,
.skill-hub-verify,
.skill-hub-resources {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-hub-install h2,
.skill-hub-capabilities h2,
.skill-hub-paths h2,
.skill-hub-verify h2,
.skill-hub-resources h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--text-deep);
}

.skill-hub-install-lead {
  margin: 0;
  color: var(--text);
}

.skill-hub-commands {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.skill-hub-command {
  padding: 16px;
}

.skill-hub-command-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-deep);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-hub-command-body {
  margin: 0 0 8px;
  padding: 12px;
  background: var(--surface-sage);
  border-radius: var(--r-4);
  overflow-x: auto;
}

.skill-hub-command-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-deep);
}

.skill-hub-command-note {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.skill-hub-release-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.skill-hub-release-meta code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-sage);
  padding: 2px 6px;
  border-radius: var(--r-2);
}

.skill-hub-sha {
  word-break: break-all;
}

.skill-hub-capability-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.skill-hub-capability {
  padding: 16px;
}

.skill-hub-capability h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-deep);
}

.skill-hub-capability p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.skill-hub-paths-list,
.skill-hub-resources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-hub-paths-list code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-sage);
  padding: 2px 6px;
  border-radius: var(--r-2);
}

.skill-hub-verify-list {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-hub-verify-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-deep);
}

.skill-hub-verify-list p {
  margin: 0;
  color: var(--text);
}

.skill-hub-interim {
  padding: 16px;
}

.skill-hub-interim h3 {
  margin: 0 0 8px;
  color: var(--text-deep);
}

.skill-hub-interim p {
  margin: 0 0 8px;
  color: var(--text);
}

/* Current gallery polish overrides. Kept at the end so the PetDex-inspired
   refresh wins over the older MVP blocks above without a broad CSS rewrite. */
.home-hero-install {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  overflow: visible;
}

.home-hero-install-cmd {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  color: #ef426f;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow: visible;
}

.pet-state-selector {
  width: min(100%, 340px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pet-state-btn {
  display: flex;
  min-height: 112px;
  padding: 8px 6px 9px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  text-align: center;
  border-radius: 16px;
}

.pet-state-btn-preview {
  grid-row: auto;
  width: 66px;
  height: 72px;
  background-size: 528px 648px;
}

.pet-state-btn-label {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.1;
}

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

.pet-state-btn[aria-pressed="true"] .pet-state-btn-label {
  color: #ffffff;
}

/* Pixel-art UI pass — modern blocky surfaces, crisp borders, and a pixelated
   hero gradient that matches the sprite-based catalog without going full retro. */
:root {
  --pixel-border: #13361d;
  --pixel-shadow: #b7dca7;
  --pixel-shadow-dark: #07170c;
  --pixel-lime: #a7f071;
  --pixel-mint: #dff7d5;
}

body {
  background:
    linear-gradient(rgba(19, 54, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 54, 29, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 18px 18px;
}

.site-header {
  border-bottom: 2px solid var(--pixel-border);
  background: rgba(246, 251, 242, 0.94);
  box-shadow: 0 4px 0 rgba(19, 54, 29, 0.1);
}

.site-logo-mark,
.home-hero-install,
.home-hero-pet-card,
.pet-card,
.card,
.card-sage,
.home-toolbar,
.pets-toolbar,
.pet-preview,
.pet-state-btn,
.install-steps,
.pet-details,
.pet-agents,
.home-gallery,
.home-feed,
.home-how,
.home-tags,
.home-agents,
.home-faq {
  border-width: 2px;
  border-color: var(--pixel-border);
  border-radius: 8px;
  box-shadow: 6px 6px 0 var(--pixel-shadow);
}

.home-hero {
  isolation: isolate;
  border-bottom: 2px solid var(--pixel-border);
  background:
    linear-gradient(135deg, rgba(167, 240, 113, 0.72), rgba(246, 251, 242, 0.64) 42%, rgba(73, 198, 89, 0.78)),
    repeating-linear-gradient(0deg, rgba(7, 23, 12, 0.09) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(90deg, rgba(7, 23, 12, 0.08) 0 2px, transparent 2px 16px);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 50%, transparent 50% 100%),
    linear-gradient(0deg, rgba(6, 20, 10, 0.07) 0 50%, transparent 50% 100%);
  background-size: 24px 24px;
  mix-blend-mode: multiply;
  opacity: 0.55;
  image-rendering: pixelated;
}

.home-hero::after {
  height: 2px;
  background: var(--pixel-border);
}

.home-hero-title {
  text-shadow: 4px 4px 0 rgba(167, 240, 113, 0.72);
}

.home-hero-install {
  border-color: var(--pixel-border);
  background: rgba(246, 251, 242, 0.92);
  box-shadow: 5px 5px 0 var(--pixel-shadow-dark);
}

.home-hero-install-label,
.pet-card-catalog-number,
.pet-card-kind,
.home-gallery-eyebrow,
.pets-eyebrow,
.home-hero-eyebrow {
  letter-spacing: 0.12em;
}

.btn-dark,
.btn-sage,
.btn-ghost,
.chip,
.tag,
.vibe-chip,
.pets-load-more,
.home-hero-install-copy {
  border-width: 2px;
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(19, 54, 29, 0.24);
}

.btn-dark:hover,
.btn-sage:hover,
.btn-ghost:hover,
.chip:hover,
.tag:hover,
.vibe-chip:hover,
.home-hero-pet-card:hover,
.pet-state-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(19, 54, 29, 0.28);
}

.pet-card:hover,
.pet-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--pixel-border);
  box-shadow: 6px 6px 0 rgba(19, 54, 29, 0.28);
}

.pet-card,
.pet-state-btn,
.home-hero-pet-card {
  border-color: var(--pixel-border);
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
    repeating-linear-gradient(135deg, rgba(167, 240, 113, 0.12) 0 8px, transparent 8px 16px);
}

@keyframes pixel-card-pop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.88) rotate(var(--tilt, 0deg));
    clip-path: inset(100% 0 0 0);
    filter: saturate(0.7) contrast(1.2);
  }
  40% {
    opacity: 1;
    clip-path: inset(42% 0 0 0);
  }
  72% {
    transform: translateY(-4px) scale(1.03) rotate(var(--tilt, 0deg));
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 1;
    transform: rotate(var(--tilt, 0deg));
    clip-path: inset(0 0 0 0);
    filter: none;
  }
}

.pet-card-preview-link {
  background:
    radial-gradient(circle at 50% 42%, rgba(167, 240, 113, 0.32), transparent 46%),
    repeating-linear-gradient(0deg, rgba(19, 54, 29, 0.05) 0 4px, transparent 4px 12px),
    var(--surface-sage);
}

.pet-preview {
  background-color: var(--surface-sage);
  background-image: var(--sprite-url);
}

.pet-state-btn[aria-pressed="true"] {
  box-shadow: 5px 5px 0 var(--pixel-shadow);
}

.home-agents-note {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-hero-install-copy {
  min-width: 174px;
  min-height: 48px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 18px;
  border: 2px solid var(--pixel-border);
  background:
    linear-gradient(180deg, #ffffff, #e4f9d9);
  color: var(--text-deep);
  box-shadow: 4px 4px 0 var(--pixel-shadow-dark);
}

.home-hero-install-copy:hover,
.home-hero-install-copy:focus-visible {
  background:
    linear-gradient(180deg, #f9fff6, #b7f284);
  color: var(--text-deep);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(7, 23, 12, 0.78);
}

.home-hero-install-heart {
  position: relative;
  width: 52px;
  height: 42px;
  flex: 0 0 52px;
  image-rendering: pixelated;
}

.home-hero-install-heart::before,
.home-hero-install-heart::after {
  content: "";
  position: absolute;
  image-rendering: pixelated;
}

.home-hero-install-heart::before {
  left: 9px;
  top: 4px;
  width: 5px;
  height: 5px;
  background: #9f173f;
  box-shadow:
    5px 0 #9f173f,
    20px 0 #9f173f,
    25px 0 #9f173f,
    -5px 5px #9f173f,
    0 5px #9f173f,
    5px 5px #9f173f,
    10px 5px #9f173f,
    15px 5px #9f173f,
    20px 5px #9f173f,
    25px 5px #9f173f,
    30px 5px #9f173f,
    -5px 10px #9f173f,
    0 10px #9f173f,
    5px 10px #9f173f,
    10px 10px #9f173f,
    15px 10px #9f173f,
    20px 10px #9f173f,
    25px 10px #9f173f,
    30px 10px #9f173f,
    0 15px #9f173f,
    5px 15px #9f173f,
    10px 15px #9f173f,
    15px 15px #9f173f,
    20px 15px #9f173f,
    25px 15px #9f173f,
    5px 20px #9f173f,
    10px 20px #9f173f,
    15px 20px #9f173f,
    20px 20px #9f173f,
    10px 25px #9f173f,
    15px 25px #9f173f,
    15px 30px #9f173f;
}

.home-hero-install-heart::after {
  left: 10px;
  top: 5px;
  width: 3px;
  height: 3px;
  background: #ff84a3;
  box-shadow:
    5px 0 #ff84a3,
    20px 0 #ff84a3,
    25px 0 #ff5d87,
    -5px 5px #ff84a3,
    0 5px #ff5d87,
    5px 5px #ff5d87,
    10px 5px #ef426f,
    15px 5px #ef426f,
    20px 5px #ff5d87,
    25px 5px #ef426f,
    30px 5px #d72b5e,
    -5px 10px #ff5d87,
    0 10px #ef426f,
    5px 10px #ef426f,
    10px 10px #ef426f,
    15px 10px #ef426f,
    20px 10px #ef426f,
    25px 10px #d72b5e,
    30px 10px #c72252,
    0 15px #ef426f,
    5px 15px #ef426f,
    10px 15px #ef426f,
    15px 15px #ef426f,
    20px 15px #d72b5e,
    25px 15px #c72252,
    5px 20px #ef426f,
    10px 20px #ef426f,
    15px 20px #d72b5e,
    20px 20px #c72252,
    10px 25px #d72b5e,
    15px 25px #c72252,
    15px 30px #b51f4b;
}

.pets-pagination {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.pets-load-more {
  min-width: min(260px, 100%);
}

.pet-hero .install-steps {
  margin-top: 10px;
  gap: 12px;
}

.pet-hero .install-step {
  padding: 16px;
  border-width: 2px;
  border-color: var(--pixel-border);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(135deg, rgba(167, 240, 113, 0.12) 0 8px, transparent 8px 16px);
  box-shadow: 4px 4px 0 var(--pixel-shadow);
}

.pet-hero .install-tab-toggle-copy {
  align-self: flex-start;
  width: auto;
  min-width: min(260px, 100%);
}

.seo-landing {
  display: grid;
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.seo-landing-hero,
.seo-landing-copy,
.seo-landing-links,
.seo-landing-grid {
  border: 2px solid var(--pixel-border);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)),
    repeating-linear-gradient(135deg, rgba(167, 240, 113, 0.12) 0 8px, transparent 8px 16px);
  box-shadow: 6px 6px 0 var(--pixel-shadow);
}

.seo-landing-hero {
  padding: clamp(28px, 5vw, 56px);
  background:
    linear-gradient(135deg, rgba(167, 240, 113, 0.72), rgba(246, 251, 242, 0.7) 48%, rgba(73, 198, 89, 0.72)),
    repeating-linear-gradient(0deg, rgba(7, 23, 12, 0.08) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(90deg, rgba(7, 23, 12, 0.07) 0 2px, transparent 2px 16px);
}

.seo-landing-eyebrow {
  margin: 0 0 10px;
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.seo-landing h1 {
  max-width: 820px;
  font-size: clamp(40px, 7vw, 86px);
  line-height: 0.95;
  text-shadow: 4px 4px 0 rgba(167, 240, 113, 0.72);
}

.seo-landing-lede {
  max-width: 780px;
  margin: 20px 0 0;
  color: var(--text);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
}

.seo-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.seo-landing-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.seo-landing-copy {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.seo-landing-copy p {
  max-width: 860px;
  margin: 0;
  color: var(--text-muted);
}

.seo-landing-links {
  padding: clamp(18px, 3vw, 28px);
}

.seo-landing-link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.seo-landing-link-list li {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(7, 23, 12, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.seo-landing-link-list a {
  color: var(--text);
  font-weight: 800;
}

.seo-landing-link-list p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.seo-landing-grid {
  padding: clamp(18px, 3vw, 28px);
}

.seo-landing-section-heading {
  margin-bottom: 18px;
}

.seo-landing-section-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}
