/* Embed Your Pet — stop-motion marketplace theme */
:root {
    color-scheme: dark;
    --bg: #161514;
    --surface: #1d1c1a;
    --surface-2: #24221f;
    --field: #191816;
    --line: #34312d;
    --line-strong: #4a4640;
    --text: #f2eadb;
    --text-2: #d9d0c1;
    --muted: #a69e92;
    --subtle: #92897e;
    --rust: #ae4b26;
    --rust-hover: #b34d28;
    --on-rust: #fff4e6;
    --gold: #e3a53a;
    --gold-hover: #eeb44d;
    --on-gold: #1c1407;
    --orange: #e8823e;
    --ok: #48c774;
    --danger: #f08a73;
    --radius: 6px;
    --radius-lg: 8px;
    --container: 1360px;
    --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.5; }
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: var(--radius); font-weight: 700; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { color: var(--text); font-weight: 800; font-size: 26px; letter-spacing: -0.03em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.header-search { flex: 1 1 320px; max-width: 560px; margin: 0 auto; }
.search-field { display: flex; align-items: center; gap: 10px; background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0 14px; min-height: 40px; }
.search-field svg { flex: none; color: var(--muted); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; min-height: 38px; }
.search-field:focus-within { border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--subtle); }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { color: var(--text-2); padding: 10px 14px; font-size: 16px; font-weight: 500; }
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .divider { width: 1px; height: 26px; background: var(--line-strong); }
.header-actions .link { color: var(--text-2); font-weight: 500; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 6px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.8); display: flex; flex-direction: column; }
.user-menu .menu a, .user-menu .menu button { text-align: left; background: none; border: 0; color: var(--text-2); padding: 10px 12px; border-radius: var(--radius); font-size: 15px; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); color: var(--text); }
.user-menu .menu .menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius); border: 1px solid transparent; font-weight: 700; font-size: 16px; line-height: 1; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, color .15s ease; text-decoration: none; }
.btn-rust { background: var(--rust); color: var(--on-rust); }
.btn-rust:hover { background: var(--rust-hover); color: var(--on-rust); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); color: var(--on-gold); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--text-2); }
.btn-outline:hover { border-color: var(--text); color: var(--text); background: rgba(242,234,219,.05); }
.btn-line { background: transparent; color: var(--orange); border-color: var(--rust); }
.btn-line:hover { color: var(--gold); border-color: var(--orange); }
.btn-quiet { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn-quiet:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: transparent; border: 1px solid transparent; color: var(--text); }
.icon-btn:hover { border-color: var(--line-strong); color: var(--text); }

/* ---------- Tabs and chips ---------- */
.tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs a, .tabs button { background: none; border: 0; color: var(--text-2); padding: 10px 10px 12px; font-size: 16px; font-weight: 500; box-shadow: inset 0 -2px 0 transparent; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--orange); font-weight: 600; box-shadow: inset 0 -2px 0 var(--orange); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); color: var(--text-2); font-size: 15px; background: transparent; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-current="true"], .chip.is-active { background: var(--orange); border-color: var(--orange); color: var(--on-gold); font-weight: 600; }

/* ---------- Typography blocks ---------- */
.display { font-size: clamp(44px, 6vw, 76px); font-weight: 800; letter-spacing: -0.04em; line-height: .98; }
.page-title { font-size: clamp(40px, 5vw, 64px); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.page-lede { font-size: clamp(18px, 2vw, 24px); color: var(--text-2); margin-top: 8px; }
.section-title { font-size: 24px; font-weight: 700; }
.section-title-lg { font-size: 30px; font-weight: 800; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.breadcrumb { display: flex; gap: 10px; font-size: 16px; color: var(--muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Sprite ---------- */
.sprite {
    --s: 1;
    width: calc(var(--cw) * var(--s) * 1px);
    height: calc(var(--ch) * var(--s) * 1px);
    background-image: var(--sheet);
    background-repeat: no-repeat;
    background-size: calc(var(--cw) * var(--cols) * var(--s) * 1px) calc(var(--ch) * var(--rows) * var(--s) * 1px);
    background-position: 0 calc(var(--row) * var(--ch) * var(--s) * -1px);
    animation: sprite-play calc(var(--frames) / var(--fps) * 1s) steps(var(--frames)) infinite;
    animation-play-state: var(--play, running);
    flex: none;
}
@keyframes sprite-play {
    from { background-position-x: 0; }
    to { background-position-x: calc(var(--frames) * var(--cw) * var(--s) * -1px); }
}
.wakes:hover .sprite[data-wake], .wakes:focus-within .sprite[data-wake] { --row: var(--wake-row); --frames: var(--wake-frames); --fps: var(--wake-fps); }
@media (prefers-reduced-motion: reduce) { .sprite { animation: none; } }

/* Paper backdrop the puppets stand on */
.art {
    --backdrop: #c9ae8a;
    position: relative;
    display: grid;
    place-items: end center;
    overflow: hidden;
    background-color: var(--backdrop);
    background-image:
        radial-gradient(ellipse 70% 60% at 50% 32%, rgba(255,248,235,.22), transparent 70%),
        linear-gradient(to bottom, transparent 62%, rgba(0,0,0,.14) 62.4%, rgba(0,0,0,.05) 100%),
        url("../img/paper.svg");
    background-size: auto, auto, 240px 240px;
}
.art::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(0,0,0,.22); }
.art .sprite { position: relative; z-index: 1; }
.art .shadow { position: absolute; z-index: 0; left: 50%; bottom: var(--shadow-bottom, 14%); width: 46%; height: 7%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(28,18,8,.42), transparent); }

/* ---------- Pet cards ---------- */
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.pet-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s ease, transform .15s ease; }
.pet-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.pet-card .art { height: 200px; padding-bottom: 6px; }
.pet-card .art-link { display: block; }
.pet-card-body { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 16px; }
.pet-card-name { color: var(--text); font-weight: 700; font-size: 17px; }
.pet-card-name:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.pet-card-handle { color: var(--muted); font-size: 14px; }
.pet-card-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--text-2); }
.pet-card-meta .sep { width: 1px; height: 14px; background: var(--line-strong); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.pet-card .badge { position: absolute; top: 10px; left: 10px; z-index: 2; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(22,21,20,.82); color: var(--text); border-radius: var(--radius); padding: 5px 10px; font-size: 12px; font-weight: 600; }
.badge-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.pick-row { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 14px; align-items: center; }
.pick-card .art { height: 252px; }
.pick-card.is-featured .art { height: 268px; }
.pick-card .pet-card-body { align-items: center; }

/* ---------- Avatars ---------- */
.avatar { --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); font-weight: 700; font-size: calc(var(--size) * .36); }
.avatar .art { position: relative; display: block; width: 100%; height: 100%; }
.avatar .art::after { box-shadow: none; }
.avatar .shadow { display: none; }
.avatar .sprite { position: absolute; left: 50%; top: -6%; transform: translateX(-50%); animation: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 46px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--field); padding: 10px 14px; font-size: 16px; color: var(--text); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d9d0c1' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227,165,58,.18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 12px; min-height: 36px; font-size: 16px; color: var(--text-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--orange); flex: none; }
.error-text { color: var(--danger); font-size: 14px; }
.alert { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--surface); display: flex; gap: 12px; align-items: flex-start; }
.alert-error { border-color: rgba(240,138,115,.5); }
.alert-success { border-color: rgba(72,199,116,.45); }
.flash { margin-top: 16px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-pad { padding: 22px; }
.panel-title { font-size: 22px; font-weight: 700; }

/* ---------- Home ---------- */
.home-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 30px 0 34px; }
.home-intro .lede { font-size: 20px; color: var(--text-2); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.carousel-controls { display: flex; gap: 4px; }
.explore-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.explore-head .chips { margin-left: auto; }
.creator-strip { display: flex; align-items: center; gap: 22px; padding: 22px 0 30px; flex-wrap: wrap; }
.creator-strip .people { display: flex; gap: 28px; flex-wrap: wrap; flex: 1; }
.creator-chip { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; }
.creator-chip:hover { color: var(--text); }
.how-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.how-strip > div { background: var(--surface); padding: 20px 22px; display: flex; gap: 14px; }
.how-strip .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); font-weight: 700; flex: none; }

/* ---------- Explore ---------- */
.explore-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 28px 0; }
.collection-banner { position: relative; display: flex; align-items: stretch; height: 176px; border-radius: var(--radius-lg); overflow: hidden; color: var(--on-gold); }
.collection-banner .art { position: absolute; inset: 0; place-items: end end; padding: 0 28px 10px 0; }
.collection-banner .copy { position: relative; z-index: 2; padding: 26px 28px; display: flex; flex-direction: column; gap: 6px; max-width: 60%; }
.collection-banner h2 { font-size: clamp(24px, 2.2vw, 30px); font-weight: 800; }
.collection-banner p { font-size: 17px; line-height: 1.35; }
.collection-banner.is-dark { color: var(--text); }
.collection-banner:hover { color: inherit; }
.explore-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 48px; }
.filters { flex: 1 1 220px; max-width: 250px; padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.filters fieldset { border: 0; margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.filters legend { font-size: 17px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.explore-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.explore-toolbar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.explore-toolbar .search-field { flex: 1 1 280px; max-width: 470px; min-height: 44px; }
.explore-toolbar .count { margin-left: auto; color: var(--text-2); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- Pet detail ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; padding: 18px 0 40px; }
.stage { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.stage .art { height: 450px; --shadow-bottom: 9%; padding-bottom: 20px; }
.stage .badge { position: absolute; top: 16px; left: 16px; z-index: 2; font-size: 14px; padding: 7px 12px; }
.stage-controls { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stage-controls .moves { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); display: grid; place-items: center; }
.move-btn { min-height: 42px; padding: 0 20px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-weight: 500; }
.move-btn[aria-pressed="true"] { border-color: var(--orange); color: var(--text); box-shadow: inset 0 0 0 1px var(--orange); }
.speed { width: auto; min-height: 42px; }
.detail-info { display: flex; flex-direction: column; gap: 18px; }
.detail-title { font-size: clamp(40px, 4vw, 54px); font-weight: 800; letter-spacing: -0.035em; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; font-size: 18px; color: var(--text-2); }
.facts { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); flex-wrap: wrap; }
.facts > div { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-size: 15px; color: var(--text-2); flex: 1 1 auto; }
.facts > div + div { border-left: 1px solid var(--line); }
.behavior-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.behavior-tile { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); text-align: left; padding: 0; color: var(--text); }
.behavior-tile .art { height: 104px; padding-bottom: 2px; }
.behavior-tile span { display: block; padding: 8px 12px; font-size: 15px; }
.behavior-tile[aria-pressed="true"] { border-color: var(--orange); }
.tab-panel[hidden] { display: none; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; font-size: 15px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.more-card { display: grid; grid-template-columns: 46% 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 150px; }
.more-card .art { height: 100%; min-height: 150px; }
.more-card .body { padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }

/* ---------- Code ---------- */
.code { position: relative; display: flex; align-items: center; gap: 12px; background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 12px 12px 12px 18px; }
.code code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 14px; color: #8fb8e8; }
.code code .str { color: var(--orange); }
.code-block { background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; color: var(--text-2); margin: 0; }

/* ---------- Builder ---------- */
.builder-head { display: flex; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; padding: 14px 0 22px; }
.steps { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 17px; }
.steps .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 700; }
.steps [aria-current="step"] { color: var(--orange); }
.steps [aria-current="step"] .dot { background: var(--orange); border-color: var(--orange); color: var(--on-gold); }
.steps .bar { width: 40px; height: 1px; background: var(--line-strong); }
.builder-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.55fr) minmax(300px, .95fr); gap: 14px; align-items: start; padding-bottom: 48px; }
.builder-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.builder-panel { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.asset-preview { display: flex; gap: 16px; align-items: flex-start; }
.asset-thumb { width: 150px; height: 190px; border-radius: var(--radius); flex: none; background-color: #c9ae8a; background-size: contain; background-repeat: no-repeat; background-position: center; border: 1px solid var(--line-strong); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grid-4 .input { padding: 8px 10px; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 15px; cursor: pointer; }
.segmented label:has(input:checked) { border-color: var(--orange); color: var(--text); box-shadow: inset 0 0 0 1px var(--orange); }
.segmented input { accent-color: var(--orange); }
.browser { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; background: #201f1d; }
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #1a1917; }
.browser-bar .dots { display: flex; gap: 7px; }
.browser-bar .dots span { width: 11px; height: 11px; border-radius: 50%; }
.browser-bar .url { flex: 1; max-width: 440px; margin-left: 12px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 12px; font-size: 13px; color: var(--text-2); }
.fake-site { position: relative; height: 380px; padding: 22px 26px; background: #232220; overflow: hidden; touch-action: none; }
.fake-site .site-nav { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }
.fake-site .site-nav strong { font-size: 18px; color: var(--text); }
.fake-site .site-hero { margin-top: 18px; background: #2a2926; border-radius: var(--radius); padding: 22px 24px; max-width: 70%; }
.fake-site .site-hero h3 { font-size: 30px; font-weight: 800; }
.fake-site .site-hero p { margin-top: 8px; color: var(--text-2); font-size: 15px; }
.fake-site .skeleton { display: flex; gap: 12px; margin-top: 14px; }
.fake-site .skeleton span { flex: 0 1 170px; height: 64px; border-radius: var(--radius); background: #2a2926; }
.preview-pet { position: absolute; left: 0; top: 0; cursor: grab; touch-action: none; user-select: none; border-radius: 12px; }
.preview-pet:focus-visible { outline-offset: 4px; }
.preview-pet.is-dragging { cursor: grabbing; }
.preview-pet .preview-sprite { width: 100%; height: 100%; background-repeat: no-repeat; filter: drop-shadow(0 10px 10px rgba(0,0,0,.35)); }
.preview-bubble { position: absolute; right: 100%; bottom: 72%; margin-right: -14px; background: #2b2a27; border: 1px solid var(--line-strong); color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: 14px; white-space: nowrap; pointer-events: none; }
.behavior-buttons { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.behavior-buttons .move-btn { min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.behavior-buttons .move-btn[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--on-gold); box-shadow: none; font-weight: 600; }
.frame-strip { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.frame-strip .frames { display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: 6px; }
.frame-strip .frame { aspect-ratio: 192 / 208; border-radius: 4px; background-color: #c9ae8a; background-repeat: no-repeat; border: 1px solid transparent; }
.frame-strip .frame.is-current { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.mapping-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.mapping-table th { text-align: left; font-size: 14px; color: var(--text-2); font-weight: 600; padding: 0 4px; }
.mapping-table td { padding: 0 4px; }
.mapping-table td:first-child { font-size: 15px; white-space: nowrap; }
.mapping-table .input { min-height: 40px; padding: 6px 10px; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-size: 15px; }
.status-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }

/* ---------- Creators ---------- */
.creator-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; }
.creator-card { display: grid; grid-template-columns: 42% 1fr; gap: 14px; padding: 10px; }
.creator-card > a > .art { border-radius: var(--radius); min-height: 190px; height: 100%; }
.creator-card .thumbs .art { border-radius: 4px; }
.creator-card .body { display: flex; flex-direction: column; gap: 8px; padding: 6px 4px; min-width: 0; }
.creator-card .thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; }
.creator-card .thumbs .art { min-height: 70px; height: 76px; }
.creator-card .foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 4px 6px 4px; color: var(--text-2); font-size: 15px; }
.creator-card .foot .btn { margin-left: auto; }
.creator-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; }
.creator-row { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 8px; }
.creator-row > a > .art { min-height: 136px; height: 100%; border-radius: var(--radius); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 30px; margin: 22px 0 48px; }

.profile-banner { position: relative; border-radius: var(--radius-lg); overflow: hidden; color: #1d1409; }
.profile-banner > .art { position: absolute; inset: 0; place-items: end end; padding: 0 40px 18px 0; gap: 6px; display: flex; justify-content: flex-end; align-items: flex-end; }
.profile-banner > .art .sprite { z-index: 1; }
.profile-banner .inner { position: relative; z-index: 2; display: flex; gap: 22px; align-items: center; padding: 22px 26px; flex-wrap: wrap; }
.profile-banner .avatar { --size: 150px; border: 3px solid rgba(255,248,235,.75); }
.profile-banner h1 { font-size: 44px; font-weight: 800; color: #1d1409; }
.profile-banner .handle { font-size: 22px; font-weight: 600; color: #3b2a17; }
.profile-banner .tagline { font-size: 19px; color: #2c1f10; margin-top: 4px; }
.profile-banner .counts { display: flex; align-items: center; gap: 20px; margin-top: 12px; }
.profile-banner .counts strong { display: block; font-size: 24px; color: #1d1409; }
.profile-banner .counts span { color: #3b2a17; }
.profile-banner .counts .vr { width: 1px; height: 44px; background: rgba(29,20,9,.25); }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 22px; align-items: start; padding: 20px 0 48px; }
.profile-aside { display: flex; flex-direction: column; gap: 16px; }
.facts-list { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; color: var(--text-2); font-size: 15px; }
.facts-list li { display: flex; align-items: center; gap: 10px; }

/* ---------- Share ---------- */
.share-steps { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 18px; list-style: none; margin: 22px 0 18px; padding: 0; max-width: 1110px; }
.share-steps li { display: flex; align-items: center; gap: 16px; font-size: 19px; color: var(--muted); }
.share-steps .dot { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-weight: 700; }
.share-steps [aria-current="step"] { color: var(--text); font-weight: 700; }
.share-steps [aria-current="step"] .dot { background: var(--orange); border-color: var(--orange); color: var(--on-gold); }
.share-steps .done .dot { background: var(--surface-2); color: var(--ok); }
.share-steps .track { height: 2px; background: var(--line-strong); position: relative; }
.share-steps .track.is-half::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: var(--orange); }
.share-steps .track.is-full { background: var(--orange); }
.share-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 14px; align-items: start; padding-bottom: 48px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 46px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--field); }
.tag-input:focus-within { border-color: var(--gold); }
.tag-input input { flex: 1 1 120px; min-width: 120px; border: 0; outline: 0; background: transparent; font-size: 16px; min-height: 32px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 15px; }
.tag button { border: 0; background: none; color: var(--text-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 4px; }
.tag button:hover { background: var(--line); color: var(--text); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 16px; color: var(--text-2); }
.checklist li { display: flex; align-items: center; gap: 12px; }
.checklist .ok { width: 22px; height: 22px; border-radius: 4px; background: var(--ok); color: #0c2414; display: grid; place-items: center; flex: none; }
.checklist .todo { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line-strong); flex: none; }

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 220px; gap: 0; align-items: start; }
.docs-nav { border-right: 1px solid var(--line); padding: 28px 16px 40px 0; position: sticky; top: 69px; max-height: calc(100vh - 69px); overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.docs-nav h2 { font-size: 17px; color: var(--text-2); font-weight: 700; padding: 0 8px; margin-bottom: 6px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a { display: block; padding: 9px 16px; border-radius: var(--radius); color: var(--text-2); font-size: 16px; border-left: 3px solid transparent; }
.docs-nav a:hover { color: var(--text); background: var(--surface); }
.docs-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); border-left-color: var(--orange); font-weight: 600; }
.docs-content { padding: 24px 32px 48px; min-width: 0; }
.docs-toc { position: sticky; top: 69px; padding: 32px 0 0 24px; border-left: 1px solid var(--line); margin-top: 28px; }
.docs-toc h2 { font-size: 17px; margin-bottom: 12px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.docs-toc a { display: block; padding: 7px 0 7px 16px; border-left: 2px solid var(--line); color: var(--text-2); font-size: 15px; margin-left: -1px; }
.docs-toc a:hover { color: var(--text); border-left-color: var(--orange); }
/* Shared typography for authored pages and rendered Markdown guides. */
.prose { color: var(--text-2); font-size: 16px; line-height: 1.75; max-width: 860px; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { color: var(--text); font-size: 24px; line-height: 1.3; margin: 40px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.prose > h2:first-child { padding-top: 0; border-top: 0; }
.prose h3 { color: var(--text); font-size: 19px; line-height: 1.4; margin: 28px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { padding-left: 4px; margin: 7px 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; font-size: .85em; color: var(--text); }
.prose pre { background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 20px; margin: 20px 0 24px; max-width: 100%; overflow-x: auto; line-height: 1.65; tab-size: 2; }
.prose pre code { display: block; background: none; border: 0; padding: 0; font-size: 13px; white-space: pre; overflow-wrap: normal; word-break: normal; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.docs-table-scroll { max-width: 100%; overflow-x: auto; margin: 20px 0 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); }
.prose table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.prose th, .prose td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 700; }
.prose td:first-child { color: var(--text); font-weight: 600; width: 19%; }
.prose tbody tr:nth-child(even) { background: var(--surface); }
.prose tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) {
    .prose h2 { font-size: 22px; margin-top: 32px; }
    .prose pre { padding: 14px; }
    .prose th, .prose td { padding: 12px; }
}
.doc-step { display: grid; grid-template-columns: 40px 1fr; gap: 18px; margin-top: 22px; }
.doc-step .num { width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: var(--on-gold); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.doc-step h2 { font-size: 21px; margin: 6px 0 4px; color: var(--text); }
.doc-pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }

/* ---------- Auth ---------- */
.auth-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1310px; margin: 0 auto; padding: 44px 32px 56px; }
.auth-card { padding: 56px 56px 40px; display: flex; flex-direction: column; gap: 22px; }
.auth-card h1 { font-size: 52px; font-weight: 800; letter-spacing: -0.035em; }
.auth-show { padding: 34px 40px; display: flex; flex-direction: column; gap: 22px; }
.auth-show h2 { font-size: 46px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auth-grid .pet-card .art { height: 196px; }
.password-field { position: relative; }
.password-field .input { padding-right: 52px; }
.password-field button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; min-height: 76px; padding-top: 16px; padding-bottom: 16px; }
.site-footer nav { display: flex; gap: 0; flex-wrap: wrap; }
.site-footer nav a { color: var(--text-2); padding: 4px 18px; border-left: 1px solid var(--line-strong); }
.site-footer nav a:first-child { border-left: 0; }
.site-footer nav a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .profile-banner > .art { display: none; }
    .builder-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .builder-grid .preview-col { grid-column: 1 / -1; order: -1; }
    .docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .docs-toc { display: none; }
    .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .container { padding: 0 20px; }
    .home-intro, .detail-layout, .share-layout, .auth-layout { grid-template-columns: 1fr; }
    .pick-row { grid-template-columns: 1fr; }
    .explore-hero { grid-template-columns: 1fr; }
    .how-strip { grid-template-columns: 1fr; }
    .explore-head .chips { margin-left: 0; }
    .filters { max-width: none; }
    .behavior-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .builder-grid { grid-template-columns: 1fr; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-nav { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; }
    .docs-content { padding: 20px 0 40px; }
    .share-steps { grid-template-columns: auto 1fr auto 1fr auto; gap: 10px; }
    .share-steps li span.label { display: none; }
    .auth-card, .auth-show { padding: 28px 22px; }
    .auth-card h1 { font-size: 40px; }
    .profile-banner > .art { display: none; }
}
@media (max-width: 640px) {
    .site-header .container { gap: 12px; }
    .brand { font-size: 22px; }
    .main-nav a { padding: 8px 10px; }
    .header-search { order: 5; flex-basis: 100%; }
    .creator-card, .creator-row { grid-template-columns: 1fr; }
    .more-card { grid-template-columns: 1fr; }
    .facts > div + div { border-left: 0; border-top: 1px solid var(--line); }
    .fake-site .site-hero { max-width: 100%; }
    .grid-2 { grid-template-columns: 1fr; }
    .steps .bar { display: none; }
    .header-actions .divider { display: none; }
}

/* Backdrop swatches on the share page */
input.sr-only:checked + span { box-shadow: 0 0 0 3px var(--orange); border-color: var(--bg) !important; }
input.sr-only:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Both builder views share form values, preview, and export. */
.builder-view-bar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.builder-view-switch { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); gap: 4px; }
.builder-view-switch .btn { background: transparent; color: var(--text-2); border: 0; }
.builder-view-switch .btn[aria-pressed="true"] { background: var(--rust, #b45d35); color: #fff; }
#generator-form[data-builder-view="simple"] [data-advanced-only] { display: none !important; }
#generator-form[data-builder-view="simple"] .builder-grid { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr); }
#generator-form[data-builder-view="simple"] .preview-col { grid-column: 2; grid-row: 1 / span 2; }
#generator-form[data-builder-view="simple"] .export-col { grid-column: 1; }
#generator-form[data-builder-view="simple"] .builder-source .asset-thumb { width: 64px; height: 64px; flex-basis: 64px; }

@media (max-width: 900px) {
    #generator-form[data-builder-view="simple"] .builder-grid { grid-template-columns: minmax(0, 1fr); }
    #generator-form[data-builder-view="simple"] .preview-col { grid-column: 1; grid-row: auto; order: 0; }
    #generator-form[data-builder-view="simple"] .export-col { grid-column: 1; }
    .builder-view-bar { gap: 10px; }
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 54px; height: 54px; object-fit: contain; flex-shrink: 0; }
.brand-footer { font-size: 20px; }
.brand-footer img { width: 44px; height: 44px; }
@media (max-width: 600px) { .brand { gap: 7px; font-size: 20px; } .brand img { width: 42px; height: 42px; } }

.home-intro { padding-top:46px; padding-bottom:28px; }
.home-intro .display { font-size:clamp(38px,4.2vw,64px); }
.usage-banner { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:22px 26px; border:1px solid #353b3d; border-radius:12px; margin:24px 0 30px; background:rgba(181,84,44,.07); }
.usage-banner strong { font-size:20px; }
.usage-banner p { margin:6px 0 0; }
.pet-downloads { padding:18px; border:1px solid #353b3d; border-radius:10px; }
.pet-downloads p { margin:6px 0 12px; }
.pet-downloads .row { gap:10px; }
.codex-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
.codex-card { overflow:hidden; }
.codex-card>.stack { padding:20px; gap:12px; }
.codex-card p { margin:0; }
.codex-stage { display:grid; place-items:center; height:230px; background:#d7c6aa; }
.codex-sprite { width:192px; height:208px; background-size:1536px 1872px; background-position:0 0; background-repeat:no-repeat; }
.codex-install { margin:32px 0; padding:28px; scroll-margin-top:100px; }
.codex-install li { margin:12px 0; }
@media(max-width:1000px) { .codex-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .main-nav { gap:14px; } }
@media(max-width:600px) { .usage-banner { align-items:flex-start; flex-direction:column; padding:20px; } .codex-grid { grid-template-columns:1fr; } .home-intro { padding-top:28px; } }
@media(max-width:640px) {
    .site-header .brand { order:0; }
    .site-header .header-actions { order:1; margin-left:auto; }
    .site-header .header-actions>.btn { display:none; }
    .site-header .main-nav { order:2; width:100%; justify-content:space-between; gap:0; }
    .site-header .main-nav a { padding:6px 8px; }
    .site-header .header-search { order:3; }
    .home-intro { gap:20px; }
}
.pet-demo-button { margin:0 16px 16px; }
.pet-demo-button[aria-pressed="true"] { border-color:var(--gold); color:var(--gold); }
/* Clearer choose, customize, install journey. */
.home-intro { align-items:center; }
.home-demo { display:grid; gap:16px; }
.home-demo p { margin:0; }
.mini-website { position:relative; min-height:200px; border:1px solid var(--line); border-radius:12px; padding:20px; background:var(--surface); overflow:hidden; }
.mini-website>strong { display:block; border-bottom:1px solid var(--line); padding-bottom:12px; margin-bottom:15px; }
.mini-website [data-home-character] { position:absolute; bottom:0; right:8px; width:145px; height:145px; }
.mini-website[data-corner="left"] [data-home-character] { right:auto; left:8px; }
.mini-website .art { height:100%; background:transparent; }
.mini-website .shadow { display:none; }
.mini-controls { gap:12px; }
.mini-controls label { flex:1; font-size:14px; }
.mini-controls .select { margin-top:5px; }
.gallery-filter-toggle { display:none; }
.starting-choice { display:flex; gap:10px; margin-bottom:20px; }
.starting-choice .btn { flex:1; min-width:0; white-space:normal; }
.starting-choice [aria-pressed="true"] { border-color:var(--gold); color:var(--gold); }
#generator-form[data-start-choice="choose"] [data-upload-field] { display:none; }
#generator-form[data-start-choice="upload"] .field:has(#starter-pet) { display:none; }
#get-widget { scroll-margin-top:100px; }
.install-steps { padding-left:22px; }
.install-steps li { margin:12px 0; font-size:15px; }
.technical-download { margin-top:12px; }
.technical-download summary { cursor:pointer; color:var(--text-2); }
.technical-download button { margin-top:12px; }
.demo-dismiss { position:fixed; right:16px; bottom:16px; z-index:10001; background:var(--bg); }
.demo-dismiss[hidden] { display:none; }
.export-highlight { outline:2px solid var(--gold); }
@media(max-width:900px) {
    .gallery-hero .collection-banner { display:none; }
    .gallery-hero { padding:24px 0; }
    .gallery-filter-toggle { display:block; justify-self:start; }
    .explore-layout .filters { display:none; }
    .explore-layout .filters.filters-open { display:block; }
    #generator-form[data-builder-view="simple"] .preview-col { grid-row:1; order:-1; }
    #generator-form[data-builder-view="simple"] .builder-col:first-child { grid-row:2; }
    #generator-form[data-builder-view="simple"] .export-col { grid-row:3; }
    .builder-head .breadcrumb, .builder-head .steps { display:none; }
    .builder-head .btn-outline { font-size:14px; padding:8px 12px; }
    .builder-head .page-title { font-size:32px!important; }
    .builder-head .page-lede { font-size:17px; }
    .builder-head { padding:20px 0 12px; }
    .builder-view-bar { margin-bottom:14px; }
    .builder-view-bar p { display:none; }
    .home-intro { gap:24px; }
}
@media(max-width:600px) {
    .fake-site { min-height:240px; }
    .fake-site .site-hero { padding:20px; }
    .demo-dismiss { bottom:12px; right:12px; }
    .site-footer nav { flex-wrap:wrap; }
}
@media(max-width:600px) {
    body[data-section="builder"] .header-search, body[data-section="explore"] .header-search { display:none; }
    #generator-form[data-builder-view="simple"] .fake-site { height:240px; padding:14px; }
    #generator-form[data-builder-view="simple"] .fake-site .site-hero { padding:12px; margin-top:12px; max-width:75%; }
    #generator-form[data-builder-view="simple"] .fake-site .site-hero h3 { font-size:20px; }
    #generator-form[data-builder-view="simple"] .fake-site .site-hero p, #generator-form[data-builder-view="simple"] .fake-site .skeleton { display:none; }
    .mini-website .art::before, .mini-website .art::after { display:none; }
}
.home-heading { display:grid; gap:18px; }
.home-heading .lede { font-size:20px; max-width:480px; }
.home-heading .btn { justify-self:start; }
.codex-home-callout { display:grid; grid-template-columns:1fr 1.2fr; gap:28px; align-items:center; padding:28px; border:1px solid var(--line); border-radius:14px; background:var(--surface); margin:20px 0 30px; }
.codex-home-callout p { margin:10px 0 18px; }
.codex-home-pets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.codex-home-pets a { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px; border-radius:10px; background:#302c26; text-align:center; overflow:hidden; }
.codex-home-pets .codex-sprite { display:block; transform:scale(.75); margin:-20px -24px; flex-shrink:0; }
.codex-home-pets .muted { font-size:13px; }
@media(max-width:900px) { .codex-home-callout { grid-template-columns:1fr; padding:20px; } }
@media(max-width:600px) { .codex-home-pets { grid-template-columns:1fr; } .codex-home-pets a { flex-direction:row; flex-wrap:wrap; justify-content:center; } .codex-home-pets .codex-sprite { margin:-20px -30px; } }
.codex-available { color:var(--gold); font-size:13px; font-weight:600; }
.pet-downloads .codex-available { flex-basis:100%; margin-top:8px; }
.codex-inline-install { width:100%; font-size:14px; }
.codex-inline-install summary { cursor:pointer; color:var(--text-2); padding:6px 0; }
.codex-inline-install li { margin:8px 0; }

body[data-motion="paused"] .sprite { animation-play-state: paused; }

/* Keep the full pet and its controls inside narrow detail-page columns. */
.detail-layout > * { min-width: 0; }
@media (max-width: 600px) {
    .detail-layout { grid-template-columns: minmax(0, 1fr); }
    .stage .sprite { --s: 1.2 !important; }
    .stage .art { height: 320px; }
    .stage-controls .moves { min-width: 0; }
    .codex-inline-install code { overflow-wrap: anywhere; }
}
.doc-step > .stack { min-width: 0; flex: 1; }
.docs-content code { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .docs-content .browser { overflow: hidden; }
    .docs-content .browser .row { flex-wrap: wrap; gap: 12px !important; }
    .docs-content .browser .url { min-width: 0; overflow: hidden; }
}
@media (max-width: 600px) {
    .doc-pager { flex-wrap: wrap; gap: 12px; }
    .doc-pager .btn { flex: 1 1 100%; }
}
