/* Same family as the app: Bongo Cat's mauve frame, chunky borders, paper panels.
   Clawd's orange stays on the character only. */
:root {
    --desk: #e6dbe2;
    --grid: #dccfd8;
    --frame: #6f5b5e;
    --frame-mid: #a08b8d;
    --paper: #fbf8f7;
    --paper-dim: #f1ebea;
    --ink: #4f3f42;
    --ink-soft: #7d6a6d;
    --pink: #f2a7b8;
    --green: #6fbf4a;
    --term: #2e2430;
    --term-ink: #eadfe4;
    --theme: #b28ad6;
    --color: #f2c14e;
    --accessory: #8fc6e8;
    --effect: #f2a7b8;
    --skin: #de886d;
    --display: "Pixelify Sans", "Segoe UI", sans-serif;
    --body: "Nunito", "Segoe UI", sans-serif;
    --border: 3px solid var(--frame);
    --lift: 0 4px 0 var(--frame);
    --spring: cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font: 400 17px/1.6 var(--body);
    color: var(--ink);
    background-color: var(--desk);
    /* A 16px pixel grid, like the cells Clawd is drawn on. */
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 16px 16px;
}

img { display: block; max-width: 100%; }

h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
p { margin: 0; }
code { font: 600 0.9em/1 Consolas, "Cascadia Mono", monospace; background: var(--paper-dim); padding: 2px 6px; border-radius: 5px; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--frame); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; padding: 8px 12px; background: var(--paper); border: var(--border); border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    max-width: 1160px; margin: 0 auto; padding: 18px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.35rem var(--display); text-decoration: none; }
.brand img { image-rendering: pixelated; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { padding: 6px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--ink-soft); }
.top nav a:hover { background: var(--paper); color: var(--ink); }
.top nav a.nav-dl { background: var(--frame); color: #fff; }
.top nav a.nav-dl:hover { background: var(--ink); }
h1 .line { display: inline-block; }

/* ---------- Buttons ---------- */
.button {
    display: inline-block; padding: 12px 20px; border: var(--border); border-radius: 14px;
    background: var(--frame); color: #fff; font-weight: 800; text-decoration: none;
    box-shadow: 0 4px 0 #4a3b3e; transition: transform 140ms var(--spring), box-shadow 140ms var(--spring);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #4a3b3e; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a3b3e; }
.button.ghost { background: var(--paper); color: var(--ink); box-shadow: var(--lift); }

/* ---------- Hero ---------- */
.hero {
    max-width: 1160px; margin: 0 auto; padding: 32px 24px 64px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center;
}
.hero-text { display: grid; gap: 22px; }
.lede { font-size: 1.15rem; max-width: 34em; color: var(--ink-soft); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.desk {
    display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    background: var(--paper); border: var(--border); border-radius: 22px; box-shadow: 0 8px 0 var(--frame);
    overflow: hidden; min-height: 380px;
}
.terminal { background: var(--term); color: var(--term-ink); font: 13px/1.5 Consolas, "Cascadia Mono", monospace; display: flex; flex-direction: column; min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #3a2e3c; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #6b5a6d; }
.term-bar span { margin-left: 8px; color: #b9a8bc; }
.term-lines { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; flex: 1; overflow: hidden; }
.term-lines li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.55; }
.term-lines li.now { opacity: 1; animation: line-in 260ms var(--spring); }
.term-lines .tool { color: #f2c14e; font-weight: 700; }
.term-lines .warn { color: #ff8f8f; }
.term-lines .ok { color: #9be07a; }
@keyframes line-in { from { transform: translateY(8px); opacity: 0; } }

.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; }
.pet-spot { width: min(100%, 300px); aspect-ratio: 1; }
.pet { width: 100%; height: 100%; }
/* The drawings keep room for hats and effects: zoom in so Clawd fills the stage. */
.pet-spot .pet { width: 136%; height: 136%; margin: -18%; }
.pet.swap { animation: swap 360ms var(--spring); }
@keyframes swap { 0% { transform: scale(0.86, 1.1); } 60% { transform: scale(1.06, 0.95); } 100% { transform: none; } }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pill, .bubble {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 2px solid var(--frame);
    border-radius: 999px; background: var(--paper); font-size: 0.85rem; font-weight: 700; white-space: nowrap;
}
.pill b { font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.bubble.alert .dot { background: #e5484d; }

/* ---------- Facts band ---------- */
.band { background: var(--frame); color: #fff; position: relative; overflow: hidden; }
/* Clawd walks across the band as you scroll (motion.js). */
.walker { position: absolute; left: 0; bottom: -14px; width: 96px; height: 96px; pointer-events: none; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding: 34px max(24px, calc((100vw - 1112px) / 2)); }
.facts p { color: #ecdfe2; }
.facts strong { display: block; font: 700 1.35rem var(--display); color: #fff; }

/* ---------- Sections ---------- */
.section { max-width: 1160px; margin: 0 auto; padding: 88px 24px 0; }
.section-head { display: grid; gap: 10px; max-width: 40em; margin-bottom: 28px; }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }

/* Fitting room: big mirror on the left, rack of outfits on the right. */
.fitting { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.6fr); gap: 24px; align-items: start; }
.mirror {
    position: sticky; top: 16px; margin: 0; padding: 18px; display: grid; gap: 10px; justify-items: center;
    background: var(--paper); border: var(--border); border-radius: 26px; box-shadow: 0 8px 0 var(--frame);
}
.mirror img { width: min(100%, 300px); height: auto; }
.mirror figcaption { display: grid; text-align: center; }
.mirror strong { font: 700 1.6rem var(--display); }
.mirror span { color: var(--ink-soft); font-size: 0.95rem; }
.rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.outfit {
    position: relative; padding: 6px 4px 8px; border: 2px solid transparent; border-radius: 14px;
    background: var(--paper); font: 700 0.78rem/1.2 var(--body); color: var(--ink); cursor: pointer;
    display: grid; justify-items: center; gap: 2px; transition: transform 140ms var(--spring);
}
.outfit img { width: 72px; height: 72px; }
.outfit:hover { transform: translateY(-3px); }
.outfit[aria-checked="true"] { border-color: var(--frame); box-shadow: var(--lift); }
.outfit .lvl { position: absolute; top: 4px; right: 4px; padding: 0 5px; border-radius: 6px; background: var(--frame-mid); color: #fff; font-size: 0.68rem; }
.outfit .lvl.auto { background: var(--green); }

/* Battle pass: a game-like panel. Slider = tokens spent, rail fill = progress, nodes = levels. */
.bp {
    --node: 72px; --gap: 10px;
    background: linear-gradient(160deg, #45364a, #2e2430 70%); color: #f3e9ee;
    border: var(--border); border-radius: 26px; box-shadow: 0 8px 0 var(--frame); padding: 22px; display: grid; gap: 20px;
}
.bp-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.bp-top label { font-weight: 800; }
.bp-top output { font: 700 1.15rem var(--display); white-space: nowrap; }
.bp-top output b { color: #ffd166; }
#bp-tokens { width: 100%; accent-color: #ffd166; height: 28px; cursor: pointer; }
.bp-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: stretch; }

.bp-feature { display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08); }
.bp-preview { position: relative; aspect-ratio: 1; border-radius: 16px; background: radial-gradient(circle at 50% 60%, rgba(255, 209, 102, 0.22), transparent 65%); display: grid; place-items: center; overflow: hidden; }
.bp-preview > img { width: 120%; height: 120%; margin: -10%; }
.bp-preview > img.pet-small { width: 100%; height: 100%; margin: 0 22% 0 0; }
.bp-preview .prop { position: absolute; right: 6%; bottom: 16%; width: 36%; height: auto; }
.bp-preview .glyph-big { font-size: 5.5rem; line-height: 1; color: #ffd166; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.bp-preview .mock { width: 78%; aspect-ratio: 1.1; border-radius: 14px; border: 6px solid var(--mock-frame); background: var(--mock-paper); display: grid; grid-template-rows: 16% 1fr; overflow: hidden; }
.bp-preview .mock i { background: var(--mock-frame); }
.bp-preview .mock img { width: 80%; justify-self: center; align-self: center; }
.bp-preview .float { position: absolute; bottom: 20%; font-size: 1.4rem; color: #ffd166; animation: drift-up 2.6s ease-in infinite; }
@keyframes drift-up { 0% { transform: translateY(20px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-90px); opacity: 0; } }
.bp-preview img.rainbow { animation: hue 3s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.bp-info { display: grid; align-content: start; gap: 2px; }
.bp-kind { justify-self: start; padding: 1px 8px; border-radius: 6px; background: var(--k); color: #2e2430; font-size: 0.78rem; font-weight: 800; }
.bp-info strong { font: 700 1.6rem/1.1 var(--display); margin-top: 4px; }
.bp-info > span:not(.bp-kind) { color: #cdbfc6; font-size: 0.92rem; }
.bp-info .bp-state { margin-top: 6px; font-weight: 800; color: #9be07a; }
.bp-info .bp-state.locked { color: #cdbfc6; }

.bp-lane { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 6px; min-width: 0; }
.bp-arrow { height: 64px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.1); color: #fff; font: 700 1.8rem var(--display); cursor: pointer; }
.bp-arrow:hover { background: rgba(255, 255, 255, 0.18); }
.bp-scroller { position: relative; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 10px 4px 16px; }
.bp-scroller::-webkit-scrollbar { display: none; }
/* The rail runs through the middle of the tiles: 10px padding + 22px number row + half a tile. */
.bp-rail { position: absolute; left: calc(4px + var(--node) / 2); top: calc(10px + 22px + var(--node) / 2 - 4px); height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); width: var(--rail, 0px); }
.bp-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ffb347, #ffd166); box-shadow: 0 0 12px rgba(255, 209, 102, 0.6); }
.bp-nodes { position: relative; list-style: none; margin: 0; padding: 0; display: flex; gap: var(--gap); width: max-content; }
.node { width: var(--node); display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.node .n { height: 18px; font: 700 0.85rem var(--display); color: #a998a2; }
.node .tile {
    width: var(--node); height: var(--node); border-radius: 18px; display: grid; place-items: center;
    background: #3a2e3c; border: 3px solid #56465a; position: relative; transition: transform 160ms var(--spring), background 200ms;
}
.node .tile img { width: 54px; height: 54px; filter: grayscale(1) brightness(0.6); transition: filter 200ms; }
.node .tile .fx { font-size: 1.7rem; color: #8b7b86; }
.node .tile .swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.5); opacity: 0.4; }
.node .tile::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 30px; height: 5px; margin-left: -15px; border-radius: 3px; background: var(--k); opacity: 0.45; }
.node:hover .tile { transform: translateY(-3px); }
.node.open .n { color: #ffd166; }
.node.open .tile { background: var(--paper); border-color: #ffd166; }
.node.open .tile img { filter: none; }
.node.open .tile .fx { color: #c9962b; }
.node.open .tile .swatch { opacity: 1; }
.node.open .tile::after { opacity: 1; }
.node.milestone .tile { border-radius: 50%; }
.node.crown .tile { box-shadow: 0 0 0 3px #ffd166, 0 0 22px rgba(255, 209, 102, 0.55); }
.node.next .tile { animation: next-pulse 1.4s ease-in-out infinite; }
@keyframes next-pulse { 50% { box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.5); } }
.node[aria-pressed="true"] .tile { transform: translateY(-5px) scale(1.06); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px #fff; }
.bp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: #cdbfc6; font-size: 0.88rem; margin: 0; }
.k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; }
.k.theme { background: var(--theme); } .k.color { background: var(--color); } .k.accessory { background: var(--accessory); }
.k.effect { background: var(--effect); } .k.skin { background: var(--skin); }

/* Multiplayer: copy on the left, a working mock of the room on the right. */
.multi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.multi-text { display: grid; gap: 16px; }
.multi-text p { color: var(--ink-soft); font-size: 1.08rem; }
.multi-text .small { font-size: 0.95rem; }
.room { background: var(--paper); border: var(--border); border-radius: 22px; box-shadow: 0 8px 0 var(--frame); padding: 16px; display: grid; gap: 12px; }
.room-head { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-weight: 700; }
.room-head strong { font: 700 1.4rem var(--display); color: var(--ink); letter-spacing: 0.08em; }
.copy { margin-left: auto; padding: 6px 12px; border: 2px solid var(--frame); border-radius: 10px; background: var(--paper); font: 700 0.85rem var(--body); color: var(--ink); cursor: pointer; }
.copy.done { background: var(--green); border-color: var(--green); color: #fff; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--paper-dim); }
.board li.you { background: #fff; box-shadow: inset 0 0 0 2px var(--pink); }
.rank { width: 26px; text-align: center; font-size: 1.15rem; }
.me { position: relative; }
.who { flex: 1; display: grid; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.3; }
.who strong { color: var(--ink); font-size: 1rem; }
.num { font-weight: 800; font-variant-numeric: tabular-nums; }
.pop-layer { position: absolute; left: 50%; bottom: 60%; pointer-events: none; }
.pop { position: absolute; left: 0; bottom: 0; font-size: 2rem; animation: pop 1.8s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.3); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.25); } 30% { transform: translate(-50%, -10px) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px) scale(0.9); } }
.emotes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.emotes button { aspect-ratio: 1; border: 2px solid var(--frame-mid); border-radius: 50%; background: var(--paper); font-size: 1rem; line-height: 1; padding: 0; cursor: pointer; transition: transform 120ms var(--spring); }
.emotes button:hover { transform: scale(1.15); border-color: var(--frame); }
.emotes button:active { transform: scale(0.92); }

.also ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 48px; }
.also li { padding-left: 22px; position: relative; color: var(--ink-soft); }
.also li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; background: var(--frame); }
.also strong { color: var(--ink); }

.install { padding-bottom: 72px; display: grid; gap: 16px; max-width: 760px; margin-left: max(24px, calc((100vw - 1112px) / 2)); }
.install > p { color: var(--ink-soft); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 12px 16px 12px 12px; background: var(--paper); border-radius: 14px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--frame); color: #fff; font: 700 1.3rem var(--display); }

.foot { border-top: var(--border); background: var(--paper-dim); }
.foot p { max-width: 1160px; margin: 0 auto; padding: 20px 24px; color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
    .hero, .multi, .fitting, .bp-body { grid-template-columns: minmax(0, 1fr); }
    .bp-feature { grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: none; align-items: center; }
    .hero { gap: 32px; }
    .facts { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .mirror { position: static; }
    .also ul { grid-template-columns: minmax(0, 1fr); }
    .install { margin-left: auto; }
}
@media (max-width: 560px) {
    body { font-size: 16px; }
    .top { padding: 14px 16px; }
    .top nav { display: none; }
    .hero, .section { padding-left: 16px; padding-right: 16px; }
    .desk { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .terminal { order: 2; height: 150px; }
    .pet-spot { width: 210px; }
    .emotes { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .bp { padding: 14px; }
    .bp-top { grid-template-columns: minmax(0, 1fr) auto; }
    .bp-top input { grid-column: 1 / -1; grid-row: 2; }
    .bp-lane { grid-template-columns: minmax(0, 1fr); }
    .bp-arrow { display: none; }
    .bp-feature { grid-template-columns: 110px minmax(0, 1fr); }
    .bp-info strong { font-size: 1.25rem; }
    .rack { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .outfit img { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
