:root {
  --ink: #2a1e17;
  --muted: #6d5b4f;
  --paper: #fff8ee;
  --paper-2: #ffeedd;
  --accent: #ff5a36;
  --accent-2: #ffb703;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(42, 30, 23, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
h1, h2, h3 { font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; line-height: 1.1; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--accent); font-weight: 700; margin: 0; }
.hero h1 { font-size: clamp(3rem, 8vw, 5.5rem); margin: .2rem 0 1rem; }
.hero h1 span { color: var(--accent); display: inline-block; transform: rotate(-3deg); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-art { display: grid; place-items: center; }
.kitten { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.kitten.big { max-width: 380px; filter: drop-shadow(0 12px 0 rgba(42, 30, 23, .1)); }

.btn {
  font: inherit; font-weight: 700; font-size: 1.1rem;
  background: var(--accent); color: #fff;
  border: 3px solid var(--ink); border-radius: 999px;
  padding: .8rem 1.6rem; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 4px solid var(--accent-2); outline-offset: 3px; }
.btn[disabled] { opacity: .7; cursor: wait; }
.joke-out { min-height: 3.2em; font-size: 1.15rem; font-weight: 700; margin-top: 1.2rem; }

/* Sections */
.section { max-width: 1100px; margin: 0 auto; padding: 3.5rem 1.5rem; }
.section.alt { max-width: none; background: var(--paper-2); }
.section.alt > * { max-width: 1052px; margin-left: auto; margin-right: auto; }
.section h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 .4rem; }
.section-lede { color: var(--muted); margin: 0 0 2rem; }

/* Kitten cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.4rem; box-shadow: var(--shadow);
  transition: transform .2s;
}
.card:hover { transform: rotate(-1deg) translateY(-4px); }
.card .kitten { max-width: 170px; margin: 0 auto .5rem; }
.card h3 { margin: .3rem 0 .4rem; font-size: 1.3rem; }
.card p { margin: 0 0 .8rem; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; font-size: .9rem; }
.card dt { font-weight: 700; color: var(--accent); }
.card dd { margin: 0; color: var(--muted); }

/* Jokes */
.jokes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.joke {
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 1rem 1.2rem; cursor: pointer; box-shadow: var(--shadow); min-height: 100%;
}
.joke:focus-visible { outline: 4px solid var(--accent-2); outline-offset: 3px; }
.joke .q { font-weight: 700; display: block; }
.joke .a { display: block; margin-top: .5rem; color: var(--accent); font-weight: 700; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
.joke .hint { display: block; margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.joke[aria-expanded="true"] .a { opacity: 1; transform: none; }
.joke[aria-expanded="true"] .hint { display: none; }

/* Rules */
.rules { padding-left: 1.4rem; max-width: 46rem; font-size: 1.08rem; }
.rules li { margin-bottom: .8rem; }
.rules li::marker { color: var(--accent); font-weight: 700; }

.footer { text-align: center; padding: 2.5rem 1.5rem 3rem; color: var(--muted); border-top: 3px dashed rgba(42, 30, 23, .2); }
.footer .small { font-size: .85rem; }

/* Fuse + explosion */
.spark { transform-box: fill-box; transform-origin: center; animation: flicker .6s infinite alternate; }
@keyframes flicker { from { opacity: .75; transform: scale(.85); } to { opacity: 1; transform: scale(1.15); } }
.hero-art.lit .kitten { animation: shake .12s infinite; }
@keyframes shake { 0%,100% { transform: translate(0,0) rotate(0); } 25% { transform: translate(-3px,1px) rotate(-1deg); } 75% { transform: translate(3px,-1px) rotate(1deg); } }
.hero-art.boom .kitten { animation: boom .5s ease-out; }
@keyframes boom { 0% { transform: scale(1); } 40% { transform: scale(1.25); filter: brightness(1.4); } 100% { transform: scale(1); } }

#burst { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.bit { position: absolute; font-size: 1.4rem; will-change: transform, opacity; animation: fly 1.4s ease-out forwards; }
.bit.dot { width: 12px; height: 12px; border-radius: 50%; }
@keyframes fly {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 2.5rem; }
  .lede { margin: 0 auto 1rem; }
  .hero-art { order: -1; }
  .kitten.big { max-width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
