:root {
  --bg: #0f1115;
  --surface: #171a21;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #4f9cff;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* --- Background cat that chases the cursor ------------------------------- */
.cat {
  position: fixed;
  top: 0;
  left: 0;
  width: 132px;
  height: auto;
  fill: var(--text);
  stroke: var(--text);
  opacity: 0.09;            /* subtle — sits quietly in the background */
  pointer-events: none;    /* never blocks clicks */
  overflow: visible;       /* don't clip the ears when it stretches/hops mid-leap */
  z-index: 0;
  /* JS sets --x / --y; the -50% keeps the cat centered on the cursor */
  transform: translate(calc(var(--x, 50vw) - 50%), calc(var(--y, 50vh) - 50%));
  will-change: transform;
}

.cat .eye-white {
  fill: var(--bg);
  stroke: none;
}
.cat .pupil {
  fill: var(--accent);
  stroke: none;
  transition: transform 0.09s ease-out; /* JS translates these toward the cursor */
}

/* Horizontal flip toward the direction of travel (JS toggles .facing-left) */
.cat-flip {
  transform-box: view-box;
  transform-origin: 60px 39px;
  transition: transform 0.2s ease;
}
.cat.facing-left .cat-flip {
  transform: scaleX(-1);
}

/* Vertical hop during a pounce (JS drives --hop each frame). No transition —
   it's updated per-frame along an arc. */
.cat-hop {
  transform-box: view-box;
  transform: translateY(var(--hop, 0));
}

/* Butt-wiggle before the pounce: JS oscillates --wig (deg); the pivot at the
   front paws swings the rear side to side. */
.cat-wiggle {
  transform-box: view-box;
  transform-origin: 82px 74px;
  transform: rotate(var(--wig, 0deg));
}

/* Squash & stretch for the pounce phases (crouch → leap → land). Anchored to
   the feet so the cat compresses onto the ground and stretches upward. */
.cat-squash {
  transform-box: view-box;
  transform-origin: 60px 78px;
  transition: transform 0.12s ease;
}
.cat.crouch .cat-squash { transform: scale(1.18, 0.78); }
.cat.leap   .cat-squash { transform: scale(0.86, 1.18); transition: transform 0.09s ease-out; }
.cat.land   .cat-squash { transform: scale(1.22, 0.72); transition: transform 0.07s ease-out; }

/* Gentle idle bob; JS adds .running to trot the legs while moving */
.cat-bob {
  transform-box: view-box;
  transform-origin: 60px 39px;
  animation: cat-bob 2.4s ease-in-out infinite;
}
.cat-tail {
  transform-box: view-box;
  transform-origin: 20px 46px; /* base of the tail at the rear */
  animation: cat-tail 2.4s ease-in-out infinite;
}
.leg {
  transform-box: fill-box;
  transform-origin: top center;
}
.cat.running .leg-a { animation: leg-swing 0.34s linear infinite; }
.cat.running .leg-b { animation: leg-swing 0.34s linear infinite 0.17s; }

/* Head group — bobs while "chewing" its caught prey during play. */
.cat-head {
  transform-box: view-box;
  transform-origin: 94px 40px;
}

/* Play behaviour after a successful catch: the front paws bat at the prey and
   the head does a small chewing nod. No pouncing happens in this state. */
.cat.playing .leg.front { animation: paw-bat 0.5s ease-in-out infinite; }
.cat.playing .leg.front.leg-b { animation-delay: 0.25s; }
.cat.playing .cat-head { animation: chew 0.66s ease-in-out infinite; }

@keyframes cat-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
@keyframes cat-tail {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(10deg); }
}
@keyframes leg-swing {
  0%, 100% { transform: rotate(-22deg); }
  50%      { transform: rotate(22deg); }
}
@keyframes paw-bat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3.5px) rotate(-10deg); }
}
@keyframes chew {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(0.8px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cat, .cat-bob, .cat-tail, .leg, .cat-head { animation: none !important; }
}

/* --- Page content ------------------------------------------------------- */
.home {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.5rem 0 0.75rem;
}

.curio-card {
  display: block;
  background: var(--surface);
  border: 1px solid #23262e;
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.curio-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.curio-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.curio-desc {
  display: block;
  color: var(--muted);
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
