/* Vanilla Pets site: warm wood and brass, like the in-game pet screen. */
:root {
  --bg: #17110c;
  --bg2: #1e1610;
  --panel: #261b13;
  --panel2: #30231a;
  --line: #4a3524;
  --text: #f3e8d6;
  --muted: #c3ad8f;
  --brass: #e8be55;
  --brass-d: #a87a22;
  --heading: #ffe3a0;
  --green: #7ad06a;
  --red: #ef6a5a;
  --blue: #6aaeff;
  --link: #f4cf6c;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --radius: 10px;
  --body: 'Roboto', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --brand: 'Pixelify Sans', var(--body);
  --mono: ui-monospace, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff0b0; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

/* Type scale (Roboto): 2.5 / 1.75 / 1.3 / 1.075 rem, tight leading and slightly negative tracking on the big sizes. */
h1, h2, h3, h4 { font-family: var(--body); line-height: 1.25; scroll-margin-top: 80px; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.5rem); font-weight: 900; letter-spacing: -.02em; margin: .1em 0 .35em; color: var(--brass); }
h2 { font-size: clamp(1.4rem, 1.2rem + .9vw, 1.75rem); font-weight: 700; letter-spacing: -.01em; margin: 2em 0 .6em; padding-bottom: .35em; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.3rem; font-weight: 700; margin: 1.6em 0 .4em; color: var(--heading); }
h4 { font-size: 1.075rem; font-weight: 700; margin: 0 0 .25em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin: .25em 0; }
li > ul, li > ol { margin: .25em 0 0; }
strong, b { font-weight: 700; }
.lead { font-size: 1.15rem; line-height: 1.6; color: var(--muted); margin-bottom: 1.4em; }
.muted { color: var(--muted); }
code, kbd {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .08em .4em;
}
kbd { border-bottom-width: 3px; color: #fff; white-space: nowrap; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; font-size: .92rem; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(#3a2818, #2a1d12);
  border-bottom: 3px solid var(--brass-d);
  box-shadow: 0 2px 0 #120c07, var(--shadow);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brass); font: 700 1.35rem var(--brand); }
.brand img { image-rendering: pixelated; border-radius: 6px; }
.topnav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { color: var(--text); text-decoration: none; font-weight: 500; letter-spacing: .01em; padding: 6px 14px; border-radius: 8px; }
.topnav a:hover, .topnav a.active { background: rgba(232, 190, 85, .15); color: var(--brass); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--brass-d); color: var(--brass); font-size: 1.3rem; line-height: 1; border-radius: 8px; padding: 6px 12px; cursor: pointer; }

/* ---------------------------------------------------------------- layout */
.page { max-width: 1240px; margin: 0 auto; display: flex; gap: 40px; padding: 0 20px; }
.content { flex: 1; min-width: 0; padding: 28px 0 64px; }
body.doc .content { max-width: 820px; }
.sidebar { width: 236px; flex-shrink: 0; position: sticky; top: 64px; align-self: flex-start; padding: 24px 0; max-height: calc(100vh - 64px); overflow-y: auto; scrollbar-width: thin; }
.side-group h5 { font: 700 .75rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 20px 0 6px 12px; }
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group li { margin: 0; }
.side-group a { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .95rem; font-weight: 500; line-height: 1.35; }
.side-group a:hover { background: var(--panel); }
.side-group a.active { background: var(--panel2); color: var(--brass); box-shadow: inset 0 0 0 1px var(--line); }
.side-sub-title { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 12px 0 2px 15px; }
.side-sub a { font-size: .9rem; padding: 4px 12px; }

/* ---------------------------------------------------------------- home */
.hero {
  position: relative; margin: 26px 0 10px; border-radius: 16px; overflow: hidden; min-height: 420px;
  display: flex; align-items: flex-end; border: 3px solid var(--brass-d); box-shadow: var(--shadow);
  background: #222 center/cover no-repeat;
}
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 6, 3, 0) 30%, rgba(10, 6, 3, .92)); }
.hero-text { position: relative; z-index: 1; padding: 34px; max-width: 720px; }
.hero h1 { font-family: var(--brand); font-weight: 700; letter-spacing: 0; font-size: clamp(2.4rem, 1.6rem + 4vw, 3.6rem); margin: 0 0 .15em; text-shadow: 0 3px 0 #000; }
.hero p { font-size: 1.2rem; margin: 0 0 18px; color: #f8eedd; text-shadow: 0 2px 6px #000; }
.btn {
  display: inline-block; font: 700 1rem var(--body); text-decoration: none; padding: 11px 20px; border-radius: 10px; margin: 0 8px 8px 0;
  background: linear-gradient(#f2cf6a, #c8951f); color: #2a1a06; border: 2px solid #5a3c08; box-shadow: 0 3px 0 #5a3c08;
}
.btn:hover { color: #1a0f02; filter: brightness(1.07); }
.btn.ghost { background: rgba(20, 12, 6, .7); color: var(--brass); border-color: var(--brass-d); box-shadow: none; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 0; }
.badge { font-size: .85rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 26px 0; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.feature img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; border-bottom: 1px solid var(--line); }
.feature div { padding: 14px 16px 16px; }
.feature h3 { margin: 0 0 4px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.55; }

/* ---------------------------------------------------------------- docs bits */
.shot { margin: 20px 0; }
.shot img { width: 100%; border-radius: var(--radius); border: 2px solid var(--line); display: block; }
.shot figcaption { color: var(--muted); font-size: .92rem; line-height: 1.5; margin-top: 6px; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 20px 0; }
.shots .shot { margin: 0; }

.callout { background: rgba(232, 190, 85, .07); border: 1px solid rgba(232, 190, 85, .28); border-radius: 8px; padding: 12px 16px; margin: 20px 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout > strong:first-child, .callout > p:first-child > strong:first-child { color: var(--brass); }
.callout.tip { background: rgba(122, 208, 106, .07); border-color: rgba(122, 208, 106, .3); }
.callout.tip > strong:first-child, .callout.tip > p:first-child > strong:first-child { color: var(--green); }
.callout.warn { background: rgba(239, 106, 90, .08); border-color: rgba(239, 106, 90, .32); }
.callout.warn > strong:first-child, .callout.warn > p:first-child > strong:first-child { color: var(--red); }

.table-wrap { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
th, td { text-align: left; padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--panel2); font-weight: 700; color: var(--brass); white-space: nowrap; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.yes { color: var(--green); font-weight: 700; }
.no { color: var(--muted); }

/* Key/value facts table at the top of each animal page. */
table.facts th { width: 34%; white-space: normal; background: var(--panel); color: var(--muted); font-weight: 500; }
table.facts td { background: transparent !important; }
table.facts .stat { margin-right: 10px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 20px 0; }
.steps > li { counter-increment: step; position: relative; padding: 4px 0 20px 58px; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; font: 900 1.2rem var(--body); color: #2a1a06;
  background: linear-gradient(#f2cf6a, #c8951f); border: 2px solid #5a3c08;
}
.steps > li > h3 { margin-top: 6px; }
.steps .time { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: .02em; }

.stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.stat img { width: 18px; height: 18px; image-rendering: pixelated; }

/* item cards */
.items { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 16px 0; }
.item-card { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.item-card h4 { margin: 2px 0 3px; }
.item-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.5; }
a.item-card { color: var(--text); text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
a.item-card:hover { border-color: var(--brass-d); background: var(--panel2); color: var(--text); transform: translateY(-1px); }
a.item-card h4 { color: var(--brass); }
.item-icon { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; }
.item-icon img { width: 40px; height: 40px; image-rendering: pixelated; }

/* crafting recipes, drawn like the crafting table */
.swatches { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin: 16px 0; }
.recipe { display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto; align-items: center; justify-content: start; gap: 6px 12px;
  background: #c6c6c6; color: #3f3f3f; border-radius: 6px; padding: 12px; border: 2px solid; border-color: #fff #555 #555 #fff; }
.recipe .grid { display: grid; grid-template-columns: repeat(3, 44px); grid-auto-rows: 44px; gap: 2px; }
.slot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; overflow: hidden; }
.slot img { width: 34px; height: 34px; image-rendering: pixelated; }
.slot.text span { font: 700 9.5px/1.05 var(--body); color: #fff; text-align: center; padding: 1px; text-shadow: 1px 1px 0 #3f3f3f; }
.slot b { position: absolute; right: 2px; bottom: 0; color: #fff; font: 700 13px var(--body); text-shadow: 1px 1px 0 #3f3f3f; }
.recipe .arrow { font-size: 34px; color: #8b8b8b; }
.recipe .result .slot { width: 56px; height: 56px; }
.recipe .result .slot img { width: 44px; height: 44px; }
.recipe-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; font-weight: 700; color: #3f3f3f; font-size: .95rem; }
.recipe-meta span { color: #6b6b6b; font-weight: 500; }

/* ---------------------------------------------------------------- animals */
.egg { width: 32px; height: 32px; image-rendering: pixelated; flex-shrink: 0; }
.egg.tiny { width: 20px; height: 20px; }
.egg.inline { width: 22px; height: 22px; vertical-align: -5px; margin-right: 2px; }
.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 14px 0 8px; }
.animal-grid.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.animal-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, background .15s, transform .15s;
}
.animal-card:hover { border-color: var(--brass-d); background: var(--panel2); color: var(--text); transform: translateY(-1px); }
.animal-card.small { align-items: center; padding: 10px 12px; }
.animal-icons { display: flex; flex-wrap: wrap; gap: 2px; max-width: 70px; flex-shrink: 0; }
.animal-icons.big { max-width: none; gap: 6px; margin: 4px 0 6px; }
.animal-icons.big .egg { width: 40px; height: 40px; }
.animal-icons.big .egg.item { width: 64px; height: 64px; }
.animal-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.animal-text strong { color: var(--brass); font-size: 1.02rem; line-height: 1.3; }
.animal-text span { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brass); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; padding: 0; list-style: none; }
.chips li { margin: 0; font-size: .85rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); }

/* ---------------------------------------------------------------- diagrams */
.diagram { margin: 20px 0 24px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.diagram svg, .diagram img { display: block; width: 100%; height: auto; max-width: 720px; margin: 0 auto; }
.diagram img { image-rendering: pixelated; border-radius: 6px; }
.diagram figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; text-align: center; }
.loop { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; margin: 18px 0 22px; }
.loop-step { --accent: var(--brass); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.loop-step h4 { color: var(--accent); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.loop-step h4::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.loop-step p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.loop-step.you { --accent: var(--green); }
.loop-step.self { --accent: var(--blue); }
.loop-arrow { align-self: center; color: var(--brass); font-size: 1.6rem; line-height: 1; }
.ladder { list-style: none; counter-reset: rung; padding: 0; margin: 16px 0 22px; }
.ladder > li { counter-increment: rung; display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-bottom-width: 0; background: var(--panel); }
.ladder > li:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.ladder > li:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom-width: 1px; }
.ladder > li::before { content: counter(rung); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #2a1a06; background: var(--brass); }
.ladder strong { color: var(--heading); }
.ladder span { color: var(--muted); font-size: .92rem; line-height: 1.5; }

/* pager */
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { flex: 1; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-weight: 700; color: var(--text); line-height: 1.4; }
.pager a span { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.pager a.next { text-align: right; }
.pager a:hover { border-color: var(--brass-d); color: var(--brass); }

.footer { border-top: 3px solid var(--brass-d); background: var(--bg2); text-align: center; padding: 22px 20px 30px; color: var(--muted); font-size: .92rem; }
.footer p { margin: 4px 0; color: var(--muted); }
.footer .fine { font-size: .8rem; opacity: .8; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .topnav { display: none; width: 100%; margin: 4px 0 2px; }
  .topnav a { flex: 1 1 auto; text-align: center; }
  .topbar-inner { flex-wrap: wrap; padding: 8px 16px; gap: 10px; }
  body.nav-open .topnav { display: flex; }
  .page { display: block; padding: 0 16px; }
  .sidebar { position: static; width: auto; max-height: none; padding: 0; display: none; border-bottom: 1px solid var(--line); }
  body.nav-open .sidebar { display: block; padding-bottom: 12px; }
  body.nav-open .side-sub ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .content { padding-top: 20px; }
  .hero { min-height: 340px; }
  .hero-text { padding: 22px; }
  .recipes { grid-template-columns: 1fr; }
  .recipe .grid { grid-template-columns: repeat(3, 38px); grid-auto-rows: 38px; }
  .slot { width: 38px; height: 38px; }
  .steps > li { padding-left: 50px; }
  .loop { grid-template-columns: 1fr; }
  .loop-arrow { transform: rotate(90deg); justify-self: center; }
}
@media (max-width: 480px) {
  body { font-size: 16px; line-height: 1.65; }
  .lead { font-size: 1.05rem; }
  h2 { margin-top: 1.7em; }
  .hero { min-height: 300px; border-radius: 12px; }
  .hero-text { padding: 18px; }
  .hero p { font-size: 1.05rem; }
  .steps > li { padding-left: 0; padding-top: 48px; }
  .steps > li::before { width: 36px; height: 36px; }
  th, td { padding: 8px 10px; }
  table { font-size: .9rem; }
  table.facts th { width: 38%; }
  .animal-grid, .animal-grid.compact { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager a.next { text-align: left; }
  .diagram { padding: 12px; }
  .brand { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animal-card, a.item-card { transition: none; }
}
