:root {
  --cream:   #FFF9F4;
  --paper:   #FFFFFF;
  --blush:   #FFD9E3;
  --mint:    #C9F2E6;
  --lilac:   #E6DAFF;
  --butter:  #FFF1BF;
  --sky:     #CFE8FF;
  --peach:   #FFE0CC;
  --ink:     #4A4458;
  --muted:   #8C84A0;
  --line:    #F0E6EE;
  --shadow:  0 6px 0 rgba(145,120,160,.10), 0 14px 30px rgba(145,120,160,.12);
  --radius:  22px;
  --wrap:    1120px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.1rem 3rem;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--blush), transparent 70%),
    radial-gradient(800px 460px at 92% 4%, var(--sky), transparent 68%),
    radial-gradient(700px 400px at 50% 100%, var(--lilac), transparent 70%),
    var(--cream);
  color: var(--ink);
  font-family: Quicksand, "Trebuchet MS", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2.4rem 0 1rem;
  text-align: center;
}

h1 {
  font-family: Fredoka, Quicksand, sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  margin: 0;
  letter-spacing: -.5px;
}

.paw { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .paw { animation: wiggle 2.6s ease-in-out infinite; }
  @keyframes wiggle {
    0%, 70%, 100% { transform: rotate(0deg); }
    80% { transform: rotate(-16deg); }
    90% { transform: rotate(14deg); }
  }
}

.tagline {
  margin: .5rem auto 1.6rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- cat photos ---------- */

.photos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

/* The polaroid is a filter toggle, so it's a button — reset the UA styling. */
.polaroid {
  margin: 0;
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  background: var(--paper);
  padding: .5rem .5rem .1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 140px;
  transition: transform .18s ease, outline-color .15s ease;
  outline: 3px solid transparent;
  outline-offset: 2px;
}
/* Selected needs to read at a glance from across the page, so it's a tint and a lift
   as well as a ring — an outline alone was too easy to miss. */
.polaroid[aria-pressed="true"] {
  outline-color: var(--ink);
  background: var(--tint, var(--blush));
  transform: rotate(0) scale(1.05);
}
.polaroid[aria-pressed="true"] .cap { font-weight: 700; }
.polaroid[aria-pressed="true"]::after {
  /* Pronoun comes from the data — these cats aren't all "they". */
  content: "showing " attr(data-his) " picks";
  display: block;
  font-size: .64rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .35rem;
}
/* Inert until the sheet's "Favorite of" column has something in it. */
.polaroid:disabled { cursor: default; }
.polaroid:disabled:hover { transform: rotate(0); }
.polaroid:nth-child(odd):disabled:hover  { transform: rotate(-2.5deg); }
.polaroid:nth-child(even):disabled:hover { transform: rotate(2deg); }
.polaroid .cap {
  display: block;
  font-family: Fredoka, sans-serif;
  padding: .4rem 0 .45rem;
  font-size: .88rem;
}
.polaroid:nth-child(odd)  { transform: rotate(-2.5deg); }
.polaroid:nth-child(even) { transform: rotate(2deg); }
.polaroid:hover { transform: rotate(0) scale(1.05); }

.polaroid img,
.polaroid .fallback {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 9px;
  background: var(--butter);
}
.polaroid .fallback {
  display: grid;
  place-items: center;
  font-size: 2.8rem;
}


/* ---------- quote + monthly highlight ---------- */

.spotlight {
  display: flex;
  align-items: stretch;
  gap: 1.1rem;
  max-width: 54rem;
  margin: 0 auto;
  text-align: left;
}

.eyebrow {
  font-family: Fredoka, sans-serif;
  font-size: .68rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .45rem;
}

.highlight {
  flex: 0 0 330px;
  justify-content: center;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.highlight[hidden] { display: none; }
.hl-row { display: flex; gap: .8rem; align-items: flex-start; }
.hl-text { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.highlight .thumb {
  flex: 0 0 96px;
  width: 96px;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--cream);
  border-radius: 12px;
}
.highlight h2 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  margin: 0;
}
.highlight .why { margin: 0; font-size: .85rem; color: var(--muted); }
.highlight .go {
  margin-top: auto;
  align-self: flex-start;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 3px solid var(--mint);
  padding-top: .35rem;
}
.highlight .go:hover { border-bottom-color: var(--ink); }

.quote {
  flex: 1;
  min-width: 0;
  margin: 0;
  /* Matched heights, so whichever card has less in it centres its content rather
     than leaving a pool of empty space. Quote length varies by the day. */
  display: flex;
  flex-direction: column;
  justify-content: center;

  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem 1.2rem;
  position: relative;
}
.quote::before {
  content: "“";
  position: absolute;
  top: -.3em; left: .35rem;
  font-family: Fredoka, serif;
  font-size: 5rem;
  color: var(--blush);
  line-height: 1;
}
.quote blockquote {
  margin: 0;
  font-family: Fredoka, sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  position: relative;
}
.quote figcaption {
  margin-top: .6rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ---------- layout: filters beside results ---------- */

.layout {
  max-width: var(--wrap);
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.6rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1.3rem;
}

.sidebar h2 {
  font-family: Fredoka, sans-serif;
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.3rem 0 .55rem;
}

.search input {
  width: 100%;
  font: inherit;
  padding: .6rem .9rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: inherit;
}
.search input:focus-visible { outline: none; border-color: var(--lilac); }

.pill-col {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

button.pill {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: .34rem .8rem;
  border-radius: 999px;
  transition: border-color .12s ease, background .12s ease;
}
button.pill:hover { border-color: var(--lilac); }
button.pill[aria-pressed="true"] {
  border-color: transparent;
  background: var(--c, var(--lilac));
}

.reset {
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  margin-top: 1.2rem;
  padding: .3rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.reset:hover { color: var(--ink); }

.count { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem .2rem; }

/* ---------- cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: transform .16s ease;
}
.card:hover { transform: translateY(-4px) rotate(-.4deg); }

/* Tilted like a rubber stamp, but sat inside the card — hanging it off the corner
   left it floating in the gutter between cards, detached from either. */
.card { position: relative; }
.seal {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  transform: rotate(11deg);
  background: var(--butter);
  border: 2px dashed var(--ink);
  box-shadow: 0 3px 10px rgba(145,120,160,.25);
  font-family: Fredoka, sans-serif;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: var(--ink);
  padding: .3rem;
  hyphens: none;
}
.seal b {
  display: block;
  font-size: .48rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .15rem;
}
.card:hover .seal { transform: rotate(4deg) scale(1.06); }

.card .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--cream);
  border-radius: 14px;
  margin-bottom: .15rem;
}

.card .cat {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .22rem .6rem;
  border-radius: 999px;
  background: var(--c, var(--butter));
}
.card h3 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  margin: 0;
  font-size: 1.08rem;
}
.card p { margin: 0; font-size: .92rem; color: var(--muted); }

.card .chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  font-size: .73rem;
  font-weight: 600;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: var(--c, var(--mint));
  color: var(--ink);
}

.card .go {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 3px solid var(--blush);
  padding-top: .3rem;
}
.card .go:hover { border-bottom-color: var(--ink); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-family: Fredoka, sans-serif;
}

/* ---------- footer ---------- */

footer {
  max-width: var(--wrap);
  margin: 3rem auto 0;
  text-align: center;
  color: var(--muted);
}
footer a { color: var(--ink); }
.tiny { font-size: .82rem; }
.signoff {
  font-family: Fredoka, sans-serif;
  color: var(--ink);
  font-size: .95rem;
  margin-top: 1.2rem;
}

/* ---------- mobile: sidebar becomes a horizontal band on top ---------- */

@media (max-width: 820px) {
  /* Side by side gets too narrow to read; stack the highlight under the quote. */
  .spotlight { flex-direction: column; }
  .highlight { flex: none; }
  .layout {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin-top: 1.5rem;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .sidebar h2 { margin-top: 1.1rem; }
  /* Stacked pills would be a mile long on a phone — wrap them instead. */
  .pill-col { flex-direction: row; flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
}

@media (max-width: 480px) {
  body { padding: 0 .8rem 2.5rem; }
  .hero { padding-top: 1.8rem; }
  .polaroid { width: calc(50% - .5rem); max-width: 150px; }
  .quote { padding: 1.3rem 1.1rem 1rem; }
  .quote::before { font-size: 4rem; left: .25rem; }
  .card:hover { transform: none; }
  .polaroid:hover { transform: rotate(0); }
}
