/* Palette taken from cat coats: oyen, coklat, coklat cair, krim, hitam, kelabu, putih, plus a pink nose. */
:root {
  --oyen: #f7c873;
  --oyen-deep: #d9a03c;
  --coklat: #6b4430;       /* dark chocolate: top bar, buttons, headings */
  --coklat-gelap: #4f3222;
  --coklat-cair: #c9a07a;  /* milk chocolate: stripes, borders, accents */
  --latte: #efdcc6;
  --krim: #ecd5ab;
  --hitam: #2b2320;
  --kelabu: #8d9199;
  --putih: #ffffff;
  --hidung: #f2a0b5;

  --bg: #fbf3e6;
  --bg-grad: linear-gradient(180deg, #fdf6ea 0%, #fcefd8 45%, #f6e4d2 100%);
  --surface: #fffdf9;
  --ink: var(--hitam);
  --muted: #86664f;
  --line: #e8d4bd;
  --heading: var(--coklat);
  --hero-ink: var(--hitam);
  --shadow: 0 1px 2px rgba(43,35,32,.06), 0 6px 18px rgba(43,35,32,.07);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --heading: #e9c9a6;
    --bg: #1e1a18; --bg-grad: linear-gradient(180deg, #221d1a 0%, #1e1a18 50%, #241b1c 100%); --surface: #2a2421; --ink: #f4e9d8; --muted: #b9a999; --line: #3d3430;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --heading: #e9c9a6;
  --bg: #1e1a18; --bg-grad: linear-gradient(180deg, #221d1a 0%, #1e1a18 50%, #241b1c 100%); --surface: #2a2421; --ink: #f4e9d8; --muted: #b9a999; --line: #3d3430;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
/* Faint paw prints scattered over the page background */
:root {
  --paws: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%23b98a5e' fill-opacity='.16'%3E%3Cg transform='translate(24 30) rotate(-20)'%3E%3Cellipse cx='16' cy='21' rx='7.5' ry='6.5'/%3E%3Cellipse cx='7' cy='13' rx='3' ry='3.8'/%3E%3Cellipse cx='12.5' cy='7.5' rx='3' ry='3.8'/%3E%3Cellipse cx='19.5' cy='7.5' rx='3' ry='3.8'/%3E%3Cellipse cx='25' cy='13' rx='3' ry='3.8'/%3E%3C/g%3E%3Cg transform='translate(112 104) rotate(18)'%3E%3Cellipse cx='16' cy='21' rx='7.5' ry='6.5'/%3E%3Cellipse cx='7' cy='13' rx='3' ry='3.8'/%3E%3Cellipse cx='12.5' cy='7.5' rx='3' ry='3.8'/%3E%3Cellipse cx='19.5' cy='7.5' rx='3' ry='3.8'/%3E%3Cellipse cx='25' cy='13' rx='3' ry='3.8'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
/* Gradient sits on a fixed layer (works on iOS, unlike background-attachment: fixed).
   Paw prints get their own layer spanning the whole body, so they scroll with the page
   and paint above the gradient (::after comes later at the same z-index). */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--bg-grad), var(--bg); pointer-events: none; }
body::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--paws); pointer-events: none; }
body { margin: 0; min-height: 100vh; position: relative; color: var(--ink); font: 16px/1.6 Nunito, system-ui, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: "Baloo 2", Nunito, sans-serif; }

/* Top bar */
.topnav { background: var(--coklat); color: #fbf3e6; border-bottom: 4px solid var(--coklat-cair); }
.topnav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font: 800 20px "Baloo 2", sans-serif; text-decoration: none; }
.links { display: flex; gap: 16px; font-weight: 700; font-size: 15px; }
.links a { text-decoration: none; opacity: .85; white-space: nowrap; }
.logo { white-space: nowrap; }
.links a:hover { opacity: 1; color: var(--krim); }

/* Hero: orange tabby stripes */
.hero {
  color: var(--hero-ink); padding: 48px 0 80px;
  background:
    repeating-linear-gradient(115deg, transparent 0 40px, rgba(201,160,122,.45) 40px 52px, transparent 52px 64px, rgba(217,160,60,.28) 64px 78px),
    var(--oyen);
}
.hero-small { padding: 36px 0 44px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; }

/* Sleeping tabby in the hero */
.hero-cat { width: 240px; height: auto; margin-bottom: -12px; }
.hero-cat .body, .hero-cat .tail { fill: var(--oyen-deep); stroke: var(--oyen-deep); }
.hero-cat .tail { fill: none; transform-origin: 188px 128px; animation: wag 3s ease-in-out infinite; }
.hero-cat .ear, .hero-cat .nose { fill: var(--hidung); }
.hero-cat .stripe { fill: #b97f2a; }
.hero-cat .eye, .hero-cat .whisker { stroke: var(--hitam); }
.hero-cat .zzz { font: 800 22px "Baloo 2", sans-serif; fill: var(--hitam); opacity: 0; animation: zzz 3s ease-in-out infinite; }
.hero-cat .z2 { font-size: 16px; animation-delay: 1.2s; }
@keyframes wag { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
@keyframes zzz { 0% { opacity: 0; transform: translateY(6px); } 30%, 70% { opacity: .75; } 100% { opacity: 0; transform: translateY(-10px); } }

/* Emoji + paw helpers */
.emo { margin-right: 4px; font-size: 1.05em; }
.emo-lg { font-size: .8em; vertical-align: .05em; }
.emo-xl { display: block; font-size: 56px; line-height: 1.2; margin-bottom: 4px; }
.paw { width: 1em; height: 1em; fill: currentColor; flex: none; }
.btn-paw { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; transition: transform .2s ease; }
.btn:hover .btn-paw { transform: rotate(-18deg) scale(1.15); }
.hero h1 { font-weight: 800; font-size: clamp(36px, 7vw, 64px); line-height: 1.02; margin: 0 0 12px; }
.lede { max-width: 580px; font-size: 18px; margin: 0 0 20px; font-weight: 600; }
.hero-small .lede { margin: 0; }

.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  font: 700 16px Nunito, sans-serif; background: var(--coklat); color: #fbf3e6; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--coklat-gelap); }
.btn-light { background: var(--putih); color: var(--coklat); }
.btn-light:hover { background: var(--latte); }

/* Trivia spotlight: calico patches */
.spot {
  margin-top: -48px; border-radius: 22px; padding: 22px 24px; box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 92% 20%, var(--oyen) 0 44px, transparent 45px),
    radial-gradient(circle at 80% 95%, var(--coklat) 0 34px, transparent 35px),
    radial-gradient(circle at 98% 78%, var(--coklat-cair) 0 22px, transparent 23px),
    var(--putih);
  color: var(--hitam);
}
.spot small { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--coklat); }
.spot h2 { font-size: 26px; line-height: 1.15; margin: 4px 0 6px; padding-right: 96px; }
.spot h2 a, .spot p a { text-decoration: none; }
.spot p { margin: 0; font-weight: 700; }

/* Controls */
.controls { display: flex; gap: 8px; margin: 28px 0 12px; }
.search {
  flex: 1 1 auto; min-width: 0; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit;
}
.search:focus { outline: none; border-color: var(--oyen); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); padding: 6px 14px; border-radius: 999px; font: 700 14px Nunito, sans-serif; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--coklat-cair); }
.chip[aria-current="true"], .chip:has(input:checked) { background: var(--oyen); border-color: var(--oyen); color: var(--hitam); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 2px solid var(--hitam); outline-offset: 2px; }
.meta { color: var(--muted); font-size: 14px; margin: 6px 0 16px; font-weight: 600; }

/* Coat swatches */
.sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1.5px solid rgba(43,35,32,.25); flex: none; }
.sw-oyen { background: #f0a24e; } /* real ginger, so it stays distinct from the krim swatch */
.sw-hitam { background: var(--hitam); }
.sw-putih { background: var(--putih); }
.sw-kelabu { background: var(--kelabu); }
.sw-krim { background: var(--krim); }
.sw-belang { background: repeating-linear-gradient(45deg, #9a6b43 0 3px, var(--krim) 3px 6px); }
.sw-tompok { background: linear-gradient(90deg, var(--hitam) 50%, var(--putih) 50%); }
.sw-calico { background: conic-gradient(#f0a24e 0 33%, var(--hitam) 0 66%, var(--putih) 0); }
.swatches { display: flex; gap: 4px; align-items: center; margin-top: auto; padding-top: 8px; }
.sw-any { font-size: 12px; color: var(--muted); font-weight: 700; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding-bottom: 48px; }
.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.4deg); border-color: var(--coklat-cair); }
.card { position: relative; }
.card-paw { position: absolute; right: 12px; bottom: 12px; width: 20px; height: 20px; color: var(--oyen-deep); opacity: 0; transform: scale(.6) rotate(-20deg); transition: opacity .2s ease, transform .2s ease; }
.card:hover .card-paw, .card:focus-visible .card-paw { opacity: .8; transform: scale(1) rotate(-20deg); }
.card-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--coklat-cair); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.card-top a { text-decoration: none; }
.card h3 { font-size: 26px; line-height: 1.1; margin: 2px 0 0; color: var(--heading); }
.maksud { margin: 0; color: var(--muted); font-size: 15px; }
.g { text-transform: none; letter-spacing: 0; }
.g-jantan { color: #3b7dd8; }
.g-betina { color: #d4567d; }
.g-unisex { color: var(--muted); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 0; }

/* Detail */
.detail {
  background: var(--surface); border: 2px solid var(--line); border-radius: 24px; padding: 28px 32px;
  margin: 32px 0; box-shadow: var(--shadow); max-width: 760px; position: relative; overflow: hidden;
}
.detail { overflow: visible; border-top: 6px solid var(--oyen); margin-top: 52px; }
.detail::before { /* two cat ears poking up over the card */
  content: ""; position: absolute; top: -30px; left: 32px; width: 110px; height: 28px;
  background: var(--oyen);
  clip-path: polygon(0 100%, 18% 0, 38% 100%, 62% 100%, 82% 0, 100% 100%);
}
.detail h1 { font-size: clamp(40px, 8vw, 64px); line-height: 1; margin: 10px 0 8px; color: var(--heading); }
.detail .maksud { font-size: 19px; color: var(--ink); }
.nota { background: color-mix(in srgb, var(--hidung) 22%, var(--surface)); border-radius: 14px; padding: 12px 16px; margin: 16px 0 0; }
.suits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; font-weight: 700; }
.rujukan { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.share { display: flex; gap: 16px; font-size: 14px; margin: 16px 0 0; }
.share a, .share button { color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.section { font-size: 26px; margin: 8px 0 14px; color: var(--heading); }

/* Picker */
.picker { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 20px 24px; margin: 28px 0; box-shadow: var(--shadow); }
.picker fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.picker legend { font: 800 18px "Baloo 2", sans-serif; margin-bottom: 8px; }

/* Trivia */
.trivia { display: grid; gap: 14px; margin: 28px 0 48px; max-width: 800px; }
.tcard { background: var(--surface); border: 2px solid var(--line); border-left: 8px solid var(--oyen); border-radius: 18px; padding: 18px 22px; scroll-margin-top: 16px; }
.tcard:nth-child(3n+2) { border-left-color: var(--coklat); }
.tcard:nth-child(3n) { border-left-color: var(--coklat-cair); }
.tcard h2 { color: var(--heading); }
.tcard:target { box-shadow: 0 0 0 3px var(--oyen); }
.tcard h2 { font-size: 22px; line-height: 1.2; margin: 0 0 6px; }
.tcard h2::before { content: "🐾 "; }
.tcard p { margin: 0; }

.logo img { transition: transform .3s ease; }
.logo:hover img { animation: wiggle .5s ease-in-out; }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.paw-trail { display: flex; gap: 18px; color: var(--coklat-cair); opacity: .8; margin-bottom: 10px; }
.paw-trail .paw { width: 18px; height: 18px; }
.paw-trail .paw:nth-child(odd) { transform: rotate(80deg) translateX(-6px); }
.paw-trail .paw:nth-child(even) { transform: rotate(100deg) translateX(6px); }
/* Sibling sets */
.promo {
  display: block; margin: 14px 0 0; padding: 14px 18px; border-radius: 18px; text-decoration: none;
  background: var(--latte); border: 2px dashed var(--coklat-cair); font-weight: 600; color: var(--coklat);
}
.promo:hover { border-style: solid; }
.filter-n { margin: 28px 0 16px; }
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 48px; }
.set {
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 16px;
}
.set:target { border-color: var(--oyen); box-shadow: 0 0 0 3px var(--oyen); }
.sib-row { margin: 4px 0 0; }
.chip.sib { font: 800 17px "Baloo 2", sans-serif; padding: 4px 14px; background: color-mix(in srgb, var(--oyen) 28%, var(--surface)); border-color: transparent; }
.chip.sib:nth-child(3n+2) { background: color-mix(in srgb, var(--coklat-cair) 35%, var(--surface)); }
.chip.sib:nth-child(3n) { background: var(--latte); color: var(--coklat); }
a.chip.sib:hover { border-color: var(--oyen-deep); }
.set .share { margin-top: auto; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0 0 48px; }
.pg {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 800; text-decoration: none;
}
.pg:hover { border-color: var(--coklat-cair); }
.pg[aria-current="page"] { background: var(--coklat); border-color: var(--coklat); color: #fbf3e6; }
.pg-gap { color: var(--muted); font-weight: 800; }
.grid + .pager { margin-top: -24px; }

/* Ad slots: empty slots render nothing, so these only apply once code is pasted in */
.ad { grid-column: 1 / -1; margin: 16px 0; text-align: center; min-height: 90px; }

footer { border-top: 4px solid var(--coklat-cair); background: color-mix(in srgb, var(--latte) 55%, transparent); color: var(--muted); font-size: 14px; padding: 20px 0 36px; }

@media (prefers-reduced-motion: reduce) {
  .hero-cat .tail, .hero-cat .zzz, .logo:hover img { animation: none; }
  .hero-cat .zzz { opacity: .6; }
}
footer p { margin: 4px 0; }

@media (max-width: 600px) {
  .hero { padding: 32px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cat { width: 150px; justify-self: end; margin: -8px 0 -24px; }
  .links { gap: 12px; font-size: 14px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 12px 14px; }
  .card h3 { font-size: 21px; }
  .card .card-top .kl { display: none; } /* emoji alone is enough in the two-column grid */
  .card .card-top .emo { font-size: 16px; }
  .maksud { font-size: 13px; }
  .detail { padding: 22px 20px; }
  .spot h2 { font-size: 22px; padding-right: 70px; }
}
@media (max-width: 440px) {
  .logo-text { display: none; }
  .links { gap: 14px; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}
