/* Cat Tales companion site — zero dependencies, mobile-first, kid-friendly.
   Palette picks reuse the addon's real breed colors from tools/build_pack.py. */

:root {
  --cream: #fff6e9;
  --paper: #fffdf7;
  --ink: #2d2a32;
  --ink-soft: #57525e;
  --sun: #ffc93c;
  --coral: #ff7a5c;
  --teal: #1f7a8c;
  --leaf: #2e8b57;
  --lav: #8c7bd9;
  --sky: #7eb6e2;
  --pink: #f5c6dc;
  --gold: #e9c860;

  --card-border: 3px solid var(--ink);
  --radius: 24px;
  --pop: 0 6px 0 rgba(45, 42, 50, 0.18);
  --font: "Baloo 2", "Quicksand", ui-rounded, "Hiragino Maru Gothic ProN",
    "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(rgba(255, 201, 60, 0.16) 12px, transparent 13px);
  background-size: 90px 90px;
  line-height: 1.6;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  z-index: 50;
}
.skip:focus { left: 0.5rem; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--paper);
  border-bottom: var(--card-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.logo svg { width: 34px; height: 34px; flex: none; }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  border: 2px solid transparent;
}

.site-nav a:hover { background: var(--sun); }

.site-nav a[aria-current="page"] {
  background: var(--coral);
  color: #fff;
}

/* ---------- Focus ---------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Type ---------- */
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5rem; }
h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.2rem; }

.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 44rem; }

.section { padding: 2.5rem 0; }

.eyebrow {
  display: inline-block;
  background: var(--sun);
  border: var(--card-border);
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--pop);
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  padding: 1.25rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.hero .eyebrow { margin-bottom: 1rem; }
.hero h1 .accent { color: var(--coral); }
.hero-cat { margin: 1rem auto 0; max-width: 300px; }
.hero-cat svg { width: 100%; height: auto; }

/* ---------- Cat cards ---------- */
.cat-card { text-align: center; }
.cat-card svg {
  width: 130px;
  height: auto;
  margin: 0.25rem auto 0.5rem;
}
.cat-card .cat-fact {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 0;
}
.cat-card .chip {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  margin: 0.35rem 0.25rem 0;
}

/* ---------- Feature cards ---------- */
.feature .icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--pink);
  border: var(--card-border);
  border-radius: 16px;
  box-shadow: var(--pop);
  margin-bottom: 0.6rem;
}
.feature p { margin: 0; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  background: var(--teal);
  border: var(--card-border);
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  box-shadow: var(--pop);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(45, 42, 50, 0.18); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(45, 42, 50, 0.18); }
.btn.coral { background: var(--coral); }
.btn.small { font-size: 0.9rem; padding: 0.4rem 1rem; }

/* ---------- Steps (install) ---------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--paper);
  border: var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  padding: 1.1rem 1.25rem 1.1rem 4.5rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  background: var(--sun);
  border: var(--card-border);
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.2rem;
}
.steps li p { margin: 0.25rem 0 0; }
.steps code,
.inline-code {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.95em;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.05rem 0.4rem;
  white-space: nowrap;
}

/* ---------- Info / callout boxes ---------- */
.note {
  border: var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}
.note.sun { background: var(--sun); }
.note.pink { background: var(--pink); }
.note.sky { background: var(--sky); }
.note h2, .note h3 { margin-top: 0; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }

/* ---------- Changelog ---------- */
.log-entry { margin-bottom: 1.5rem; }
.log-entry time {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.log-entry h2 { margin-top: 0.1rem; }
.log-entry .commit {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.85rem;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.05rem 0.4rem;
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.tag.added { background: #bfe3c6; }
.tag.tested { background: #bfd9f2; }
.tag.fixed { background: #f6c9c0; }

/* ---------- Roadmap ---------- */
.roadmap-item { display: flex; gap: 1rem; align-items: flex-start; }
.roadmap-item .badge {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--sun);
  border: var(--card-border);
  border-radius: 18px;
  box-shadow: var(--pop);
}
.roadmap-item p { margin: 0.25rem 0 0; color: var(--ink-soft); }
.status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  background: var(--pink);
}

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  border: 3px dashed var(--ink-soft);
  border-radius: var(--radius);
  min-height: 200px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, 0.7);
}
.tile p { margin: 0.5rem 0 0; font-weight: 700; }
.tile svg.paw { width: 44px; height: 44px; opacity: 0.55; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  background: var(--ink);
  color: #fdf6ea;
  border-top: var(--card-border);
  padding: 2rem 0;
}
.site-footer .wrap {
  display: grid;
  gap: 1rem;
}
@media (min-width: 700px) {
  .site-footer .wrap { grid-template-columns: 2fr 1fr; align-items: center; }
}
.site-footer p { margin: 0; font-size: 0.95rem; }
.site-footer a { color: var(--sun); }
.site-footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
  font-size: 0.95rem;
}
@media (min-width: 700px) {
  .site-footer nav ul { justify-content: flex-end; }
}
.site-footer .disclaimer { opacity: 0.85; margin-top: 0.6rem; }

/* ---------- Fun micro-animations (pure CSS) ---------- */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes tail-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(14deg); }
}
@keyframes ear-twitch {
  0%, 88%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(-8deg); }
  96% { transform: rotate(5deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.hero-cat { animation: bob 3.5s ease-in-out infinite; }
.hero-cat .tail { transform-origin: 96px 86px; animation: tail-sway 3.5s ease-in-out infinite; }
.hero-cat .ear-l { transform-origin: 52px 26px; animation: ear-twitch 6s ease-in-out infinite; }

.cat-card svg .tail { transform-origin: 96px 86px; transition: transform 0.3s ease; }
.cat-card:hover svg .tail,
.cat-card:focus-within svg .tail { animation: tail-sway 1s ease-in-out infinite; }

/* Breed decorations: hidden unless the breed has them */
.cat .stripes,
.cat .stars { display: none; }
.cat.has-stripes .stripes { display: block; }
.cat.has-stars .stars { display: block; }

.stars .star { animation: twinkle 2.2s ease-in-out infinite; }
.stars .star:nth-of-type(2) { animation-delay: 0.7s; }
.stars .star:nth-of-type(3) { animation-delay: 1.3s; }

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