/* YakFamily.com — one global, fluid type system (yakdocs convention):
   rem baseline pinned on html, body at 1rem, clamp() fluid headings. */
:root {
  --bg: #1b1220;
  --bg-2: #261a2e;
  --panel: #2f2238;
  --ink: #f7f1e8;          /* body text on dark: ~15:1 on --bg */
  --ink-soft: #d9cfc2;     /* secondary text: ~11:1 on --bg */
  --gold: #f2b84b;         /* accents / links: ~9.6:1 on --bg */
  --gold-2: #ffd27a;
  --violet: #a98bff;
  --focus: #7fd1ff;
  --radius: 0.9rem;
  --max: 72rem;
  --shadow: 0 0.6rem 2rem rgb(0 0 0 / 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 15% -10%, rgb(169 139 255 / 0.18), transparent 55%),
    radial-gradient(ellipse at 90% 0%, rgb(242 184 75 / 0.14), transparent 50%),
    var(--bg);
  min-height: 100vh;
}
@media (min-width: 90em) { body { font-size: 1.0625rem; } }

h1, h2, h3, h4, h5, h6 {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 2.85rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h4 { font-size: clamp(1.15rem, 1.6vw, 1.3rem); }
h5, h6 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 0.2rem solid var(--focus); outline-offset: 0.2rem; border-radius: 0.25rem; }

.skip-link { position: absolute; left: -999rem; top: 0.5rem; background: var(--gold); color: #1b1220; padding: 0.5rem 1rem; border-radius: 0.5rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

/* Header / nav */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(27 18 32 / 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); font-family: "Fredoka", system-ui, sans-serif; font-weight: 700; font-size: 1.35rem; }
.brand img { width: 2.4rem; height: 2.4rem; border-radius: 50%; object-fit: cover; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; padding: 0.35rem 0.1rem; display: inline-block; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }
.nav .shop { color: #1b1220; background: var(--gold); border-radius: 999px; padding: 0.35rem 0.95rem; }
.nav .shop:hover { background: var(--gold-2); color: #1b1220; }

main { padding-block: 2rem 4rem; }

/* Hero */
.hero { text-align: center; padding-block: 1.5rem 1rem; }
.hero p.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 46rem; margin-inline: auto; }

/* Portrait with hoverable regions */
.portrait-tabs { display: flex; justify-content: center; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }
.portrait-tabs button {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--panel); border: 1px solid rgb(255 255 255 / 0.15);
  padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer; min-height: 2.75rem;
}
.portrait-tabs button[aria-selected="true"] { background: var(--gold); color: #1b1220; border-color: var(--gold); }

[data-portraits] { position: relative; }
.portrait { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.portrait img { display: block; width: 100%; height: auto; }
.portrait svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait .region polygon { fill: transparent; stroke: transparent; stroke-width: 4; transition: fill 0.15s, stroke 0.15s; cursor: pointer; vector-effect: non-scaling-stroke; }
.portrait .region:hover polygon, .portrait .region:focus polygon, .portrait .region.is-active polygon { fill: rgb(242 184 75 / 0.16); stroke: var(--gold-2); stroke-dasharray: 10 6; }
.portrait .region:focus { outline: none; }
.portrait-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 0.6rem));
  background: rgb(20 12 26 / 0.95); color: var(--ink); border: 1px solid var(--gold); border-radius: 0.6rem;
  padding: 0.45rem 0.75rem; font-weight: 700; font-size: 1rem; white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transition: opacity 0.12s;
}
.portrait-tip small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 0.875rem; }
.portrait-tip.show { opacity: 1; }
.portrait-hint { text-align: center; color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.75rem; }

/* Roster list (also the accessible fallback for the image map) */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.9rem; list-style: none; padding: 0; margin: 2rem 0; }
.roster a { display: block; text-decoration: none; color: var(--ink); background: var(--panel); border-radius: var(--radius); padding: 0.6rem; text-align: center; border: 1px solid transparent; height: 100%; }
.roster a:hover, .roster a:focus-visible { border-color: var(--gold); }
.roster img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0.6rem; display: block; margin-bottom: 0.45rem; background: #000; }
.roster strong { display: block; font-size: 1.05rem; }
.roster span { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.35; display: block; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.1rem; list-style: none; padding: 0; margin: 1.5rem 0; }
.card { background: var(--panel); border-radius: var(--radius); padding: 1.2rem 1.3rem; border: 1px solid rgb(255 255 255 / 0.06); height: 100%; }
.card h3 { margin-bottom: 0.4rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--gold); }
.card p { color: var(--ink-soft); margin: 0; }
.card .meta { font-size: 0.9rem; color: var(--violet); font-weight: 700; margin-bottom: 0.35rem; display: block; }

.section { margin-top: 3.5rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.cta { display: inline-block; background: var(--gold); color: #1b1220; font-weight: 800; text-decoration: none; padding: 0.8rem 1.4rem; border-radius: 999px; min-height: 2.75rem; }
.cta:hover { background: var(--gold-2); color: #1b1220; }
.cta.ghost { background: transparent; color: var(--gold); border: 2px solid var(--gold); }

.shop-banner { margin-top: 3.5rem; display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; background: linear-gradient(135deg, #2b1d4a, #3a2338); border-radius: var(--radius); padding: 1.6rem; }
.shop-banner img { width: 100%; max-width: 16rem; justify-self: center; }
@media (min-width: 48em) { .shop-banner { grid-template-columns: 16rem 1fr; padding: 2rem 2.4rem; } }

/* Article / profile pages */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.35rem; }
.breadcrumb { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 1rem; }
.breadcrumb a { color: var(--ink-soft); }

.profile { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 52em) { .profile { grid-template-columns: 22rem 1fr; } }
.profile figure { margin: 0; }
.profile figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.profile figure img + img { margin-top: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 1rem 0 1.5rem; }
.facts dt { font-weight: 800; color: var(--gold); }
.facts dd { margin: 0; }
.tag { display: inline-block; background: rgb(169 139 255 / 0.18); color: #e6dcff; border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.9rem; font-weight: 700; margin: 0 0.35rem 0.35rem 0; text-decoration: none; }
a.tag:hover { background: rgb(169 139 255 / 0.32); color: #fff; }

/* Comics */
.comic { max-width: 60rem; }
.comic-strip { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin: 1rem 0 1.5rem; }
@media (min-width: 48em) { .comic-strip.cols-3 { grid-template-columns: repeat(3, 1fr); } .comic-strip.cols-4 { grid-template-columns: repeat(2, 1fr); } }
.comic-strip img { width: 100%; display: block; border-radius: 0.6rem; border: 0.2rem solid #f7f1e8; background: #fff; }
.comic-strip img.whole { grid-column: 1 / -1; }
details.transcript { background: var(--panel); border-radius: var(--radius); padding: 0.9rem 1.2rem; }
details.transcript summary { cursor: pointer; font-weight: 800; }

/* Footer */
.site-footer { border-top: 1px solid rgb(255 255 255 / 0.08); padding-block: 2rem; color: var(--ink-soft); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--gold); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 51.99em) {
  .site-header { position: static; }
  .profile figure img + img { display: none; }
  .profile figure img { max-width: 22rem; margin-inline: auto; }
}

/* Individual mascot art (transparent) */
.profile figure img.mascot-art { box-shadow: none; background: radial-gradient(circle at 50% 45%, rgb(242 184 75 / 0.18), transparent 65%); max-height: 34rem; object-fit: contain; }
.roster img.contain { object-fit: contain; background: radial-gradient(circle at 50% 45%, rgb(169 139 255 / 0.22), #241a2c 70%); padding: 0.4rem; }
@media (max-width: 51.99em) { .profile figure img.mascot-art ~ img { display: none; } }
