/* Layout: a field almanac for one animal — big watching cat up top, then numbered-free sections stacked on a 1100px column, cards only where an item is a discrete object */
:root {
  --bg: #F1EFF4;
  --surface: #FBFAFC;
  --ink: #241F33;
  --muted: #5E5770;
  --line: #D9D4E2;
  --amber: #D98A1F;
  --amber-soft: #F6E2C2;
  --tabby: #8A5A35;
  --pupil: #241F33;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16131E; --surface: #1F1B2A; --ink: #ECE8F3; --muted: #A69EB8; --line: #342E44;
    --amber: #F0A940; --amber-soft: #3A2C17; --tabby: #C99368; --pupil: #0D0B12; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16131E; --surface: #1F1B2A; --ink: #ECE8F3; --muted: #A69EB8; --line: #342E44;
  --amber: #F0A940; --amber-soft: #3A2C17; --tabby: #C99368; --pupil: #0D0B12; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  padding-inline: 20px; padding-block: 0 48px;
}
.wrap { max-width: 1100px; margin-inline: auto; display: flex; flex-direction: column; gap: 88px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0; }
.eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--tabby);
}
.lede { color: var(--muted); max-width: 60ch; }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* Nav */
nav {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-block: 22px; border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand span { color: var(--amber); }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; font-family: var(--mono); font-size: 0.85rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding-top: 24px; }
.hero-text { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero h1 { font-size: clamp(3rem, 8.5vw, 6.6rem); font-weight: 800; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero .lede { font-size: 1.2rem; }
.cat-stage { position: relative; aspect-ratio: 1; max-width: 100%; }
.cat-stage svg { width: 100%; height: 100%; display: block; }
.cat-caption { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: 6px; }
.ear-l, .ear-r { transform-box: fill-box; transition: transform 0.25s ease; }
.ear-l { transform-origin: 80% 100%; }
.ear-r { transform-origin: 20% 100%; }
.cat-stage.alert .ear-l { transform: rotate(-8deg); }
.cat-stage.alert .ear-r { transform: rotate(8deg); }
.lid { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); }
.cat-stage.blink .lid { animation: blink 0.22s ease; }
@keyframes blink { 50% { transform: scaleY(1); } }

/* Numbers */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.stat { padding: 22px 20px 26px 0; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat .val { font-family: var(--display); font-weight: 800; font-size: 2.6rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .val small { font-family: var(--mono); font-size: 0.85rem; font-weight: 500; color: var(--tabby); letter-spacing: 0; margin-left: 4px; }
.stat p { color: var(--muted); font-size: 0.95rem; }

/* Breeds */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  font-family: var(--mono); font-size: 0.82rem; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.breeds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.breed {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.breed-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.origin { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.breed p { font-size: 0.97rem; color: var(--muted); }
.traits { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: auto; }
.meter { display: flex; gap: 3px; }
.meter i { width: 100%; height: 6px; border-radius: 3px; background: var(--line); }
.meter i.on { background: var(--amber); }
.swatch { display: flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 0.75rem; color: var(--tabby); }

/* Age calc */
.age { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.age-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
}
.age-panel label { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); display: flex; justify-content: space-between; }
.age-panel output { color: var(--ink); font-weight: 500; }
input[type="range"] { width: 100%; accent-color: var(--amber); }
.age-result { font-family: var(--display); font-size: clamp(3.5rem, 9vw, 5.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.age-result small { font-size: 1rem; font-family: var(--mono); font-weight: 400; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.stage-pill { align-self: flex-start; background: var(--amber-soft); color: var(--ink); font-family: var(--mono); font-size: 0.8rem; padding: 5px 12px; border-radius: 999px; }
.age-notes { display: flex; flex-direction: column; gap: 14px; color: var(--muted); }
.age-notes strong { color: var(--ink); font-weight: 600; }

/* Tail decoder */
.tails { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.tail { padding: 20px 16px 22px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.tail + .tail { border-left: 1px solid var(--line); }
.tail img { width: 54px; height: 70px; }
.tail h3 { font-size: 1.05rem; }
.tail p { font-size: 0.92rem; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

@media (max-width: 900px) {
  .hero, .age { grid-template-columns: 1fr; }
  .cat-stage { max-width: 360px; margin-inline: auto; width: 100%; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .breeds { grid-template-columns: repeat(2, 1fr); }
  .tails { grid-template-columns: repeat(2, 1fr); }
  .tail:nth-child(odd) { border-left: 0; }
}
@media (max-width: 560px) {
  .wrap { gap: 64px; }
  .numbers, .breeds, .tails { grid-template-columns: 1fr; }
  .stat + .stat, .tail + .tail { padding-left: 0; border-left: 0; }
  .tail { padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ear-l, .ear-r { transition: none; }
  .cat-stage.blink .lid { animation: none; }
}
