/* Riddle & Pun – shared stylesheet. Mobile-first. Tokens documented in /CLAUDE.md */
:root {
  --bg: #FFFBF5;
  --surface: #FFFFFF;
  --surface-alt: #F6F1E9;
  --border: #ECE4D6;
  --ink: #1F1B2E;
  --ink-muted: #5B5670;
  --brand: #5B3FD9;
  --brand-strong: #4628B8;
  --sun: #FFC93C;
  --ok: #15803D;
  --adult-panel: #2B2B33;
  --adult-badge: #B91C1C;

  --cat-tint: #EEE9FF;
  --cat-accent: #7C5CFF;
  --cat-ink: #5B3FD9;

  --font-head: "Fredoka", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
  --r-sm: 8px; --r: 16px; --r-lg: 24px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgb(31 27 46 / .06), 0 4px 12px rgb(31 27 46 / .06);
  --sh-2: 0 8px 24px rgb(31 27 46 / .12);
  --gutter: 16px;
  --max: 1120px;
}
[data-cat="jokes"]   { --cat-tint: #FFF4D6; --cat-accent: #FFC93C; --cat-ink: #A15C00; }
[data-cat="pickup"]  { --cat-tint: #FFE4EC; --cat-accent: #FF6B8B; --cat-ink: #C2185B; }
[data-cat="riddles"] { --cat-tint: #EEE9FF; --cat-accent: #7C5CFF; --cat-ink: #5B3FD9; }
[data-cat="puns"]    { --cat-tint: #DDF6F2; --cat-accent: #2EC4B6; --cat-ink: #0F766E; }
[data-cat="puzzles"] { --cat-tint: #E0ECFF; --cat-accent: #4C8DFF; --cat-ink: #1D4ED8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  overflow-x: hidden;
}
@media (min-width: 768px) { body { font-size: 1.0625rem; } :root { --gutter: 24px; } }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 var(--s-4); color: var(--ink); }
h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--s-4); }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
ul, ol { padding: 0; margin: 0; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); }
.skip-link:focus { top: var(--s-2); color: #fff; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 64px; gap: var(--s-2); }
.logo { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--ink); min-height: 44px; }
.logo-text { font-family: var(--font-head); font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; }
.logo-text .amp { color: var(--brand); }
.nav-toggle {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4);
  border: 2px solid var(--ink); border-radius: var(--r-pill); background: var(--surface);
  color: var(--ink); font: 700 .95rem var(--font-body); text-decoration: none; cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-alt); color: var(--ink); }
.site-nav { display: none; width: 100%; padding-bottom: var(--s-4); }
.site-nav.is-open { display: block; }
.nav-list { list-style: none; display: flex; flex-direction: column; gap: var(--s-1); }
.nav-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px;
  padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: none;
  color: var(--ink); font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer; text-align: left;
}
.nav-link:hover, .nav-link[aria-current="page"], .has-sub.is-active > .nav-link { background: var(--surface-alt); color: var(--ink); }
.caret { width: 0; height: 0; margin-left: var(--s-2); border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; transition: transform .15s; }
.sub-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.sub { list-style: none; display: none; padding: var(--s-1) 0 var(--s-2) var(--s-4); }
.sub-toggle[aria-expanded="true"] + .sub { display: block; }
.sub a { display: flex; align-items: center; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.sub a:hover, .sub a[aria-current="page"] { background: var(--surface-alt); }
.sub li:first-child a { font-weight: 700; }
.sub-adult { border-top: 1px solid var(--border); margin-top: var(--s-1); padding-top: var(--s-1); }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; width: auto; padding: 0; }
  .nav-list { flex-direction: row; gap: var(--s-1); }
  .nav-link { width: auto; padding: 0 var(--s-3); }
  .has-sub { position: relative; }
  .sub {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px; z-index: 60;
    padding: var(--s-2); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); box-shadow: var(--sh-2);
  }
  .sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
  .has-sub:last-child .sub { left: auto; right: 0; }
}
@media (min-width: 960px) and (hover: hover) {
  .has-sub:hover > .sub { display: block; }
}
html:not(.js) .has-sub:focus-within > .sub { display: block; }

/* ---------- page scaffolding ---------- */
main { display: block; padding-bottom: var(--s-8); }
.breadcrumb { padding: var(--s-4) 0 0; font-size: .9rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink-muted); }
.breadcrumb li + li::before { content: "›"; color: var(--ink-muted); }
.breadcrumb a { color: var(--brand); }
.page-head { padding: var(--s-6) 0 var(--s-2); max-width: 760px; }
.page-emoji {
  display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: var(--s-3);
  border-radius: 50%; background: var(--cat-tint); font-size: 1.75rem;
}
.lede { font-size: 1.125rem; }
.page-meta { color: var(--ink-muted); font-size: .95rem; font-weight: 700; }
.block { padding-top: var(--s-7); }
.back-home { margin-top: var(--s-5); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s-5);
  border-radius: var(--r-pill); border: 2px solid var(--brand); font: 700 1rem var(--font-body);
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--brand); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--brand-strong); }

/* ---------- item cards ---------- */
.cards { list-style: none; display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards-2, .cards-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-4); background: var(--surface);
  border: 1px solid var(--border); border-top: 4px solid var(--cat-accent);
  border-radius: var(--r); box-shadow: var(--sh-1);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.num {
  align-self: flex-start; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--cat-tint); color: var(--cat-ink); font-size: .8rem; font-weight: 700;
}
.card p { margin: 0; font-size: 1.125rem; }
.qa .punch, .kk .punch { font-weight: 700; margin-top: var(--s-2); }
.kk-line { display: block; }
.kk-line:nth-child(odd) { color: var(--ink); }
.kk-line:nth-child(even) { color: var(--ink-muted); font-style: italic; }
.kk .kk-line.punch { color: var(--ink); font-style: normal; }
.q { font-weight: 700; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: auto; padding-top: var(--s-2); flex-wrap: wrap; }
.copy-btn {
  margin-left: auto; min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-pill);
  border: 2px solid var(--border); background: var(--surface); color: var(--brand);
  font: 700 .95rem var(--font-body); cursor: pointer;
}
.copy-btn:hover { border-color: var(--brand); }
.copy-btn.is-copied { border-color: var(--ok); color: var(--ok); }
html:not(.js) .copy-btn { visibility: hidden; }
.src { font-weight: 700; font-size: .95rem; color: var(--cat-ink); }

/* answer reveal */
.reveal summary {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4);
  border-radius: var(--r-pill); background: var(--cat-tint); color: var(--cat-ink);
  font-weight: 700; cursor: pointer; list-style: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before { content: ""; border: 5px solid transparent; border-left-color: currentColor; border-right: 0; transition: transform .15s; }
.reveal[open] summary::before { transform: rotate(90deg); }
.answer { margin-top: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--cat-tint); color: var(--ink); }
.answer p { font-size: 1.05rem; }

/* ---------- category + link cards ---------- */
.cat-grid { list-style: none; display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-card {
  display: flex; flex-direction: column; gap: var(--s-2); height: 100%; padding: var(--s-5);
  border-radius: var(--r-lg); background: var(--cat-tint); color: var(--ink); text-decoration: none;
  border: 2px solid transparent; transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.cat-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--cat-accent); }
.cc-emoji { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); font-size: 1.6rem; }
.cc-title { font-family: var(--font-head); font-size: 1.35rem; font-weight: 600; }
.cc-desc { color: var(--ink); }
.cc-count { margin-top: auto; font-weight: 700; color: var(--cat-ink); }
.cat-card-adult { background: var(--surface-alt); }
.badge-18 { display: inline-block; margin-left: var(--s-1); padding: 0 8px; border-radius: var(--r-pill); background: var(--adult-badge); color: #fff; font: 700 .8rem var(--font-body); vertical-align: middle; }

.link-cards { list-style: none; display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .link-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .link-cards { grid-template-columns: repeat(4, 1fr); } }
.link-card {
  display: flex; flex-direction: column; gap: var(--s-1); height: 100%; padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--ink); text-decoration: none; box-shadow: var(--sh-1);
}
.link-card:hover { color: var(--ink); border-color: var(--brand); }
.lc-title { font-weight: 700; color: var(--brand); }
.lc-desc { font-size: .95rem; color: var(--ink-muted); }
.chip { align-self: flex-start; padding: 0 10px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 700; background: var(--cat-tint); color: var(--cat-ink); }
.chip-jokes { --cat-tint: #FFF4D6; --cat-ink: #A15C00; }
.chip-pickup { --cat-tint: #FFE4EC; --cat-ink: #C2185B; }
.chip-riddles { --cat-tint: #EEE9FF; --cat-ink: #5B3FD9; }
.chip-puns { --cat-tint: #DDF6F2; --cat-ink: #0F766E; }
.chip-puzzles { --cat-tint: #E0ECFF; --cat-ink: #1D4ED8; }

/* ---------- FAQ ---------- */
.faq-item { max-width: 760px; padding: var(--s-4) 0; border-bottom: 1px solid var(--border); }
.faq-item h3 { margin-bottom: var(--s-2); }
.faq-item p { margin: 0; }

/* ---------- home ---------- */
.hero { padding: var(--s-7) 0 var(--s-2); max-width: 820px; }
.hero h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
@media (min-width: 1040px) { .cat-grid-5 { grid-template-columns: repeat(5, 1fr); } }
.daily-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 860px) { .daily-grid { grid-template-columns: 1fr 1fr; } }
.daily { padding: var(--s-5); border-radius: var(--r-lg); background: var(--cat-tint); scroll-margin-top: 90px; }
.daily h2 { font-size: 1.5rem; }
.about-band { max-width: 820px; }

/* ---------- prose (utility pages) ---------- */
.prose { max-width: 760px; }
.prose-section { padding-top: var(--s-5); }
.bullets { padding-left: 1.25rem; margin-bottom: var(--s-4); }
.bullets li { margin-bottom: var(--s-2); }
.updated { color: var(--ink-muted); font-weight: 700; }

/* ---------- 18+ ---------- */
.age-notice {
  margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4); border-radius: var(--r);
  background: var(--adult-panel); color: #fff;
}
.age-gate { position: relative; }
.age-check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.age-overlay {
  position: absolute; z-index: 5; top: var(--s-5); left: 0; right: 0; margin: 0 auto; max-width: 30rem;
  padding: var(--s-5); border-radius: var(--r-lg); background: var(--adult-panel); color: #fff;
  text-align: center; box-shadow: var(--sh-2);
}
.age-overlay p { color: #fff; }
.age-title { font-family: var(--font-head); font-size: 1.4rem; }
.age-overlay .btn { margin: var(--s-2) var(--s-1) 0; }
.age-overlay .btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.age-overlay .btn-ghost:hover { background: rgb(255 255 255 / .1); color: #fff; }
.age-overlay :focus-visible, .age-check:focus-visible + .age-overlay label { outline: 3px solid var(--sun); outline-offset: 3px; }
.age-check:not(:checked) ~ .age-content {
  max-height: 34rem; overflow: hidden; filter: blur(10px); pointer-events: none; user-select: none;
}
.age-check:checked + .age-overlay { display: none; }

/* ---------- 404 results ---------- */
.results { list-style: none; display: grid; gap: var(--s-4); max-width: 760px; }
.results li { padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.results a { display: inline-flex; flex-direction: column; text-decoration: none; }
.r-title { font-weight: 700; font-size: 1.15rem; text-decoration: underline; text-underline-offset: 3px; }
.r-url { color: var(--ok); font-size: .9rem; }
.results p { margin: var(--s-1) 0 0; color: var(--ink-muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--surface-alt); border-top: 1px solid var(--border); padding: var(--s-7) 0 var(--s-5); font-size: .95rem; }
.footer-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: repeat(6, 1fr); } }
.footer-title { font-size: 1.05rem; margin-bottom: var(--s-2); }
.footer-col ul { list-style: none; }
.footer-col a { display: inline-block; padding: 5px 0; color: var(--ink); text-decoration: none; }
.footer-col a:hover, .footer-col a[aria-current="page"] { color: var(--brand); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--border); color: var(--ink-muted); }
.footer-bottom p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .cat-card:hover { transform: none; }
}
