@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito+Sans:wght@400;600;700;800&display=swap');

/* Shared styles for Anime Mochi content pages (About, Privacy, Terms, Contact)
   and the guides section, plus the shared footer + cookie banner. The candy-arcade
   design tokens below mirror the homepage (index.html) - keep the two in sync. */

/* ---- design tokens (candy arcade - keep in sync with index.html + game-info.css) ---- */
:root {
  color-scheme: light;
  --grid-max: 1600px;
  --paper:     oklch(98.2% 0.018 60);
  --paper-2:   oklch(95.4% 0.030 52);
  --surface:   oklch(99.5% 0.008 80);
  --ink:       oklch(34% 0.072 350);
  --ink-body:  oklch(45% 0.052 350);
  --ink-soft:  oklch(57% 0.040 350);
  --pink:      oklch(66% 0.205 6);
  --pink-ink:  oklch(49% 0.165 7);
  --teal:      oklch(80% 0.108 195);
  --teal-2:    oklch(72% 0.108 198);
  --teal-ink:  oklch(47% 0.082 200);
  --line:      oklch(89% 0.028 350);
  --line-soft: oklch(93% 0.018 350);
  --on-pink:   oklch(99% 0.012 350);
  --on-teal:   oklch(27% 0.060 205);
  --edge-2:    oklch(82% 0.040 350);
  --scrim:     oklch(24% 0.050 350);

  /* pastel accent set (category/shelf hues - guides.css + categories.css) */
  --sun:      oklch(86% 0.115 85);
  --sun-ink:  oklch(50% 0.105 70);
  --lav:      oklch(80% 0.095 300);
  --lav-ink:  oklch(47% 0.125 300);
  --mint:     oklch(86% 0.105 150);
  --mint-ink: oklch(44% 0.090 155);
  --sky:      oklch(82% 0.085 250);
  --sky-ink:  oklch(46% 0.105 255);

  --font-display: "Fredoka", "Nunito Sans", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --radius-sm: 12px; --radius-md: 16px; --radius-lg: 22px; --radius-pill: 999px;
  --shadow-sm: 0 2px 0 oklch(72% 0.06 350 / 0.30), 0 8px 20px oklch(45% 0.07 350 / 0.10);
  --shadow-md: 0 14px 36px oklch(45% 0.09 350 / 0.18);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-1: 140ms; --dur-2: 260ms;
}
* { box-sizing: border-box; }
/* Offset in-page anchor jumps so a target heading clears the sticky top-nav
   (nav wraps the search onto a 2nd row below 768px, so it's taller there). */
html { overflow-x: clip; scroll-padding-top: 124px; }
@media (min-width: 768px) { html { scroll-padding-top: 84px; } }

body {
  margin: 0; min-height: 100dvh; overflow-x: clip;
  font-family: var(--font-body); color: var(--ink-body);
  background: var(--paper); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column;
}
a { color: var(--teal-ink); }
a:hover { color: var(--ink); }
::selection { background: var(--pink); color: var(--on-pink); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 6px; }

/* ---- top navigation: candy slab with a pink underline + mochi mascot (shared with index.html) ---- */
.topnav {
  position: sticky; top: 0; z-index: 40; width: 100%;
  background: var(--paper); border-bottom: 3px solid var(--pink);
}
.topnav-inner {
  position: relative; max-width: var(--grid-max); margin: 0 auto;
  padding: var(--space-3) var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
}
.topnav-brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.005em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; flex: none; min-width: 0; white-space: nowrap;
}
.topnav-brand .mochi { width: 36px; height: 36px; object-fit: contain; display: block; flex: none; transition: transform var(--dur-2) var(--ease-spring); }
.mochi .m-body { fill: var(--surface); stroke: var(--ink); stroke-width: 2.4; }
.mochi .m-eye { fill: var(--ink); }
.mochi .m-blush { fill: var(--pink); opacity: 0.55; }
.mochi .m-mouth { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) { .topnav-brand:hover .mochi { transform: rotate(-9deg) scale(1.07); } }

.topnav-menu {
  margin-left: 0; width: 44px; height: 44px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.topnav-menu:hover { background: var(--paper-2); transform: translateY(-1px); }
.topnav-menu svg { width: 24px; height: 24px; }
.topnav-menu .i-close { display: none; }
.topnav.open .topnav-menu .i-burger { display: none; }
.topnav.open .topnav-menu .i-close { display: block; }
.topnav-links {
  display: none; position: absolute; top: calc(100% + 10px); right: var(--space-4); z-index: 41;
  min-width: 210px; padding: var(--space-2); flex-direction: column; gap: 2px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
.topnav.open .topnav-links { display: flex; animation: topnav-pop 0.16s var(--ease-out); }
@keyframes topnav-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.topnav-links a {
  color: var(--ink-body); text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  padding: 11px 14px; border-radius: var(--radius-sm); white-space: nowrap;
}
.topnav-links a:hover { color: var(--ink); background: var(--paper-2); }
.topnav-links a[aria-current="page"] { color: var(--pink-ink); background: color-mix(in oklch, var(--pink) 14%, transparent); }

/* Nav search - on every page. On the homepage it filters the grid live; anywhere
   else the form's GET action carries the term to /?q=… and lands pre-filtered. */
.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;
}
/* mobile: brand + Surprise me + burger keep row 1; search takes its own row below */
.topnav-search { flex: 1 1 100%; min-width: 0; order: 9; }
.q-field {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-pill);
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.q-field:focus-within { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in oklch, var(--pink) 26%, transparent); }
.q-icon { width: 17px; height: 17px; flex: none; color: var(--ink-soft); }
#q {
  flex: 1 1 auto; min-width: 0; border: 0; background: none; outline: none;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--ink);
}
#q::placeholder { color: var(--ink-soft); font-weight: 400; }
#q::-webkit-search-cancel-button { display: none; }   /* we ship our own clear button */
#q-clear {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  cursor: pointer; color: var(--ink); background: var(--paper-2); border: 0; border-radius: 50%;
}
#q-clear[hidden] { display: none; }
#q-clear svg { width: 13px; height: 13px; }
#q-clear:hover { background: var(--pink); color: var(--on-pink); }

/* "Surprise me" candy pill - same component on every page */
.lucky {
  display: inline-flex; align-items: center; gap: 7px; flex: none; margin-left: auto;
  white-space: nowrap; font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  color: var(--on-pink); background: var(--pink); border: 2px solid var(--pink-ink);
  border-radius: var(--radius-pill); padding: 8px 16px; text-decoration: none;
  box-shadow: 0 3px 0 var(--pink-ink); transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.lucky svg { width: 17px; height: 17px; }
.lucky:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--pink-ink); }
.lucky:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--pink-ink); }
@media (min-width: 768px) {
  .topnav-menu { display: none; }
  .topnav-links {
    display: flex; position: static; flex-direction: row; align-items: center;
    min-width: 0; padding: 0; gap: 2px; margin-left: auto;
    background: none; border: none; box-shadow: none; animation: none;
  }
  .topnav-links a { font-size: 1rem; padding: 8px 12px; }
  /* desktop: search sits inline between the links and Surprise me (DOM order) */
  .topnav-search { flex: 0 1 240px; order: 0; }
  .lucky { margin-left: var(--space-3); }
}
@media (max-width: 419px) {
  .lucky-label { display: none; }
  .lucky { padding: 9px 11px; }
}

/* ---- article / page body ---- */
.page { width: 100%; max-width: 760px; margin: 0 auto; flex: 1 0 auto; padding: var(--space-7) var(--space-5) var(--space-8); }
.page h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; font-size: clamp(2rem, 5vw, 2.6rem); margin: var(--space-2) 0 var(--space-3); line-height: 1.08; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.page h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; font-size: 1.5rem; margin: var(--space-7) 0 var(--space-3); color: var(--ink); }
.page h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; margin: var(--space-5) 0 var(--space-2); color: var(--ink); }
.page p, .page li { font-size: 1.0625rem; color: var(--ink-body); }
.page ul { padding-left: 22px; }
.page li { margin: 6px 0; }
.page strong { color: var(--ink); }
.page a { color: var(--teal-ink); }
.page a:hover { color: var(--ink); }
.page .updated { color: var(--ink-soft); font-size: 0.9rem; margin: var(--space-2) 0; }

/* ---- footer (shared site-wide, injected by site.js) ------------------------
   A four-column "studio sign-off": brand + socials, Explore, Support, Studio,
   then a divider and a bottom bar. Locally-scoped colour vars (--ft-*) map to the
   global tokens, so the whole footer is themeable in one place / dark-mode ready
   (override them under :root[data-theme="dark"] and everything follows). */
.site-footer {
  --ft-surface-0: var(--paper);
  --ft-surface-1: var(--paper-2);
  --ft-card: var(--surface);
  --ft-head: var(--ink);
  --ft-link: var(--ink-body);
  --ft-link-hover: var(--pink-ink);
  --ft-muted: var(--ink-soft);
  --ft-line: var(--line);
  width: 100%; flex-shrink: 0; position: relative; overflow: hidden;
  border-top: 3px solid var(--pink);
  background: linear-gradient(180deg, var(--ft-surface-0), var(--ft-surface-1));
  color: var(--ft-link);
}
.footer-inner {
  position: relative; z-index: 1;
  max-width: var(--grid-max); margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-6);
}

/* top: brand column (wider) + three link columns */
.footer-top {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-7) var(--space-6);
}

/* brand */
.footer-brand { max-width: 30ch; }
.footer-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.35rem;
  color: var(--ft-head); text-decoration: none;
}
.footer-logo img { width: 40px; height: 40px; object-fit: contain; }
.footer-tagline {
  margin: var(--space-3) 0 0; font-family: var(--font-display); font-weight: 500;
  font-size: 1.05rem; color: var(--ft-head); line-height: 1.4;
}
.footer-tagline .nowrap { white-space: nowrap; }
.footer-made { margin: var(--space-2) 0 0; font-size: 0.92rem; color: var(--ft-muted); line-height: 1.5; }

/* socials */
.footer-social { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  background: var(--ft-card); border: 2px solid var(--ft-line); color: var(--ft-muted);
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.footer-social a svg { width: 19px; height: 19px; }
.footer-social a:hover, .footer-social a:focus-visible {
  transform: translateY(-3px); background: var(--pink); border-color: var(--pink-ink);
  color: var(--on-pink); box-shadow: 0 4px 0 var(--pink-ink);
}

/* link columns */
.footer-col h2 {
  margin: 0 0 var(--space-3); font-family: var(--font-display); font-weight: 600;
  font-size: 1.02rem; color: var(--ft-head);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.footer-col a {
  display: inline-block; padding: 6px 0; font-family: var(--font-body); font-weight: 600;
  font-size: 0.98rem; color: var(--ft-link); text-decoration: none;
  transition: color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.footer-col a:hover, .footer-col a:focus-visible { color: var(--ft-link-hover); transform: translateX(3px); }

/* bottom bar */
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--ft-line);
}
.footer-copy { margin: 0; font-size: 0.9rem; color: var(--ft-muted); }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-5); }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 560px) {
  .footer-inner { padding: var(--space-7) var(--space-5) var(--space-5); }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
}
/* dark-mode ready: retheme by flipping these - the footer follows automatically */
:root[data-theme="dark"] .site-footer {
  --ft-surface-0: oklch(26% 0.045 340); --ft-surface-1: oklch(22% 0.04 340);
  --ft-card: oklch(31% 0.05 340); --ft-head: oklch(96% 0.02 350);
  --ft-link: oklch(84% 0.03 350); --ft-muted: oklch(70% 0.03 350);
  --ft-line: oklch(40% 0.04 350);
}

/* ---- cookie banner (shared site-wide) ---- */
#cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 860px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
  font-size: 0.9rem; color: var(--ink-body);
}
#cookie-banner p { margin: 0; flex: 1 1 280px; }
#cookie-banner a { color: var(--teal-ink); }
#cookie-banner button {
  font-family: var(--font-display); border: none; border-radius: var(--radius-pill); padding: 10px 22px; font-weight: 600; font-size: 1rem;
  background: var(--pink); color: var(--on-pink); cursor: pointer; box-shadow: 0 4px 0 var(--pink-ink);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
#cookie-banner button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--pink-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
