/* Jaziba website. Colours follow the books (lib/booklayout.py: INK, GOLD, TEAL) and Jaziba herself
   (teal scarf, purple dress, pink shoes). No build step: this file is served as it is. */

:root {
    --ink: #3B2A5A;
    --ink-soft: #5E4D80;
    --gold: #F2B93B;
    --gold-deep: #C98A0C;
    --teal: #1E8C84;
    --teal-soft: #5FD3C6;
    --mint: #DDF5F0;
    --purple: #8B5CC9;
    --lilac: #F1E8FC;
    --pink: #E8739F;
    --blush: #FDE8F0;
    --sky: #CDE8F8;
    --sky-2: #EEF8FE;
    --grass: #7CC66B;
    --cream: #FFF9EE;
    --paper: #FFFFFF;

    --radius: 22px;
    --radius-big: 32px;
    --lift: 0 5px 0 rgba(59, 42, 90, .12), 0 14px 32px rgba(59, 42, 90, .10);
    --lift-hover: 0 8px 0 rgba(59, 42, 90, .12), 0 22px 40px rgba(59, 42, 90, .16);
    --font-head: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
    --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { background: var(--lilac); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { padding-block: clamp(32px, 5vw, 56px); }
.sr-only, .skip:not(:focus) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 800; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Header ---------- */

.topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 0 rgba(59, 42, 90, .06);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo__star {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px;
    background: var(--gold); color: var(--paper); transform: rotate(-8deg);
    box-shadow: 0 3px 0 var(--gold-deep);
}
.logo__star .icon { width: 24px; height: 24px; }
.logo__word { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; letter-spacing: .01em; color: var(--ink); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav__link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 999px;
    font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
    color: var(--ink); text-decoration: none;
    transition: background .15s, transform .15s;
}
.nav__link .icon { color: var(--purple); }
.nav__link:hover { background: var(--lilac); transform: translateY(-1px); }
.nav__link.is-on { background: var(--ink); color: var(--paper); }
.nav__link.is-on .icon { color: var(--gold); }
.nav__link--quiet { color: var(--ink-soft); font-size: .95rem; }

/* ---------- Buttons, chips ---------- */

.btn {
    --bg: var(--paper); --fg: var(--ink); --edge: rgba(59, 42, 90, .18);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 10px 22px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: var(--bg); color: var(--fg);
    font: 600 1.05rem/1.2 var(--font-head); text-decoration: none;
    box-shadow: 0 4px 0 var(--edge);
    transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--edge); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn--big { min-height: 58px; padding: 14px 28px; font-size: 1.2rem; }
.btn--small { min-height: 40px; padding: 7px 16px; font-size: .95rem; }
.btn--gold { --bg: var(--gold); --fg: var(--ink); --edge: var(--gold-deep); }
.btn--teal { --bg: var(--teal); --fg: #fff; --edge: #126159; }
.btn--purple { --bg: var(--purple); --fg: #fff; --edge: #6A3FA6; }
.btn--pink { --bg: var(--pink); --fg: #fff; --edge: #C04F7C; }
.btn--ink { --bg: var(--ink); --fg: #fff; --edge: #22163A; }
.btn--white { --bg: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn-row--center { justify-content: center; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0 18px 18px; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px 4px 8px; border-radius: 999px;
    font-size: .85rem; font-weight: 800;
}
.chip .icon { width: 1.05em; height: 1.05em; }
.chip--watch { background: #FFF1CC; color: #8A5A00; }
.chip--read { background: var(--mint); color: #12665F; }
.chip--puzzle { background: var(--lilac); color: #6A3FA6; }
.chip--listen { background: var(--blush); color: #B0416D; }
.chip--soon { opacity: .55; }
.chip--soon span::after { content: " soon"; font-weight: 600; }

.soon-tag {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: var(--gold); color: var(--ink);
    font: 700 .8rem/1.4 var(--font-head); letter-spacing: .06em; text-transform: uppercase;
    transform: rotate(-3deg);
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-head); font-weight: 600; color: var(--teal);
    background: var(--paper); padding: 6px 14px; border-radius: 999px;
    box-shadow: 0 3px 0 rgba(59, 42, 90, .08);
}
.eyebrow .icon { color: var(--gold); }

/* ---------- Hero ---------- */

.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 70%, var(--cream) 100%);
    padding-block: clamp(36px, 6vw, 80px) clamp(48px, 7vw, 96px);
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.cloud {
    position: absolute; background: #fff; border-radius: 999px; opacity: .9;
    animation: drift 40s linear infinite alternate;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud--a { width: 160px; height: 46px; top: 12%; left: 4%; }
.cloud--a::before { width: 70px; height: 70px; top: -36px; left: 26px; }
.cloud--a::after { width: 52px; height: 52px; top: -24px; left: 84px; }
.cloud--b { width: 120px; height: 36px; top: 8%; right: 10%; animation-duration: 55s; }
.cloud--b::before { width: 54px; height: 54px; top: -28px; left: 20px; }
.cloud--b::after { width: 40px; height: 40px; top: -18px; left: 64px; }
.cloud--c { width: 90px; height: 28px; bottom: 22%; left: 46%; opacity: .7; animation-duration: 70s; }
.cloud--c::before { width: 40px; height: 40px; top: -20px; left: 16px; }
.cloud--c::after { width: 30px; height: 30px; top: -12px; left: 48px; }
@keyframes drift { from { transform: translateX(-20px); } to { transform: translateX(40px); } }

.hero__inner { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero__title { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 700; margin-top: 18px; }
.hero__lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.hero__frame {
    position: relative; display: block;
    border: 10px solid var(--paper); border-radius: var(--radius-big);
    box-shadow: var(--lift); overflow: hidden;
    transform: rotate(1.5deg); transition: transform .25s, box-shadow .25s;
    background: var(--paper);
}
.hero__frame:hover { transform: rotate(0deg) scale(1.01); box-shadow: var(--lift-hover); }
.hero__frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius-big) - 12px); }
.hero__badge {
    position: absolute; top: 14px; left: 14px;
    background: var(--pink); color: #fff; padding: 6px 14px; border-radius: 999px;
    font: 600 .95rem var(--font-head); box-shadow: 0 3px 0 #C04F7C;
}
.hero__play, .ep-card__play {
    position: absolute; display: grid; place-items: center;
    border-radius: 50%; background: var(--gold); color: var(--ink);
    box-shadow: 0 5px 0 var(--gold-deep), 0 10px 24px rgba(0, 0, 0, .2);
    transition: transform .2s;
}
.hero__play { width: 86px; height: 86px; left: 50%; top: 50%; translate: -50% -50%; }
.hero__play .icon { width: 40px; height: 40px; margin-left: 5px; }
.hero__frame:hover .hero__play { transform: scale(1.1); }
.hero__caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 20px 14px;
    background: linear-gradient(transparent, rgba(59, 42, 90, .75));
    color: #fff; font: 600 1.4rem var(--font-head);
}

/* ---------- Sections ---------- */

.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section__title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; text-decoration: none; }
.link-more:hover { text-decoration: underline; }

.ways { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.way {
    display: flex; flex-direction: column; gap: 4px;
    padding: 22px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--lift);
}
.way strong { font: 600 1.35rem var(--font-head); }
.way span:last-child { color: var(--ink-soft); font-size: .98rem; }
.way em { display: block; font-style: normal; font-weight: 800; color: var(--gold-deep); margin-top: 4px; }
.way__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; margin-bottom: 8px; }
.way__icon .icon { width: 30px; height: 30px; }
.way--watch .way__icon { background: #FFF1CC; color: var(--gold-deep); }
.way--read .way__icon { background: var(--mint); color: var(--teal); }
.way--puzzle .way__icon { background: var(--lilac); color: var(--purple); }
.way--listen .way__icon { background: var(--blush); color: var(--pink); }

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

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(18px, 2.5vw, 28px); }
.ep-card {
    display: flex; flex-direction: column;
    background: var(--paper); border-radius: var(--radius); box-shadow: var(--lift);
    transform: rotate(var(--tilt, 0deg)); transition: transform .2s, box-shadow .2s;
}
.ep-card:hover, .ep-card:focus-within { transform: rotate(0deg) translateY(-4px); box-shadow: var(--lift-hover); }
.ep-card__link { display: block; color: inherit; text-decoration: none; flex: 1; }
.ep-card__link:focus-visible { outline-offset: -4px; }
.ep-card__art { position: relative; display: block; padding: 10px 10px 0; }
.ep-card__art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--sky); }
.ep-card__num {
    position: absolute; top: 2px; left: 2px;
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--gold); color: var(--ink); font: 700 1.3rem var(--font-head);
    border: 4px solid var(--paper); box-shadow: 0 3px 0 rgba(59, 42, 90, .15);
}
.ep-card__play { width: 54px; height: 54px; right: 20px; bottom: 10px; }
.ep-card__play .icon { width: 26px; height: 26px; margin-left: 3px; }
.ep-card:hover .ep-card__play { transform: scale(1.12); }
.ep-card__body { display: block; padding: 14px 18px 12px; }
.ep-card__title { display: block; font: 600 1.35rem/1.2 var(--font-head); margin-bottom: 4px; }
.ep-card__moral { display: block; color: var(--ink-soft); font-size: .98rem; }

/* ---------- Friends ---------- */

.band--friends { background: var(--mint); border-radius: var(--radius-big); margin-inline: 16px; }
.friends-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: clamp(14px, 3vw, 32px); justify-content: center; }
.friend-dot { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 600 1.1rem var(--font-head); }
.friend-dot img {
    width: clamp(96px, 13vw, 140px); aspect-ratio: 1; object-fit: cover; object-position: top;
    border-radius: 50%; border: 6px solid var(--paper); box-shadow: var(--lift);
    transition: transform .2s;
}
.friend-dot:hover img { transform: translateY(-4px) rotate(-3deg); }
.friends-row--small { justify-content: flex-start; }
.friends-row--small .friend-dot img { width: 96px; }

.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.friend {
    display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: start;
    padding: 18px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--lift);
    scroll-margin-top: 90px;
}
.friend:target { outline: 4px solid var(--gold); }
.friend__img { width: 140px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; }
.friend__name { font-size: 1.6rem; margin-bottom: .25em; }
.friend__in { font-weight: 800; margin: 0 0 6px; font-size: .9rem; color: var(--teal); }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px;
    background: var(--sky-2); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem;
}
.tag-list a span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); font-size: .8rem; }
.tag-list a:hover { background: var(--sky); }

/* ---------- Page heads ---------- */

.page-head { background: linear-gradient(180deg, var(--sky), var(--cream)); padding-block: clamp(32px, 5vw, 64px) 8px; }
.page-head__title { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
.page-head__lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 40em; }
.page-head--ink { background: linear-gradient(180deg, var(--lilac), var(--cream)); }

.ep-head { background: linear-gradient(180deg, var(--sky), var(--cream)); padding-block: 24px 28px; text-align: center; }
.ep-head .back { float: left; }
.ep-head--compact { padding-bottom: 8px; }
.ep-head__num { clear: both; display: inline-block; margin: 8px 0 6px; padding: 4px 14px; border-radius: 999px; background: var(--gold); font: 600 1rem var(--font-head); }
.ep-head--compact .ep-head__title { clear: both; padding-top: 12px; }
.ep-head__title { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; margin-bottom: .2em; }
.ep-head__moral { display: inline-flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700; color: var(--teal); margin: 0; }
.ep-head__moral .icon { color: var(--pink); }
.back {
    display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px 6px 8px;
    border-radius: 999px; background: var(--paper); color: var(--ink);
    font-weight: 800; text-decoration: none; box-shadow: 0 3px 0 rgba(59, 42, 90, .1);
}
.back:hover { background: var(--lilac); }

/* ---------- Player ---------- */

.player {
    border: 10px solid var(--paper); border-radius: var(--radius-big); overflow: hidden;
    background: var(--ink); box-shadow: var(--lift);
}
.player video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player--empty { position: relative; }
.player--empty img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .5; }
.player--empty p { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 600 1.6rem var(--font-head); margin: 0; }
.player__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin: 14px 0 0; color: var(--ink-soft); font-weight: 700; }
.player__meta span { display: inline-flex; align-items: center; gap: 6px; }
.player__meta .icon { color: var(--teal); }

/* ---------- Formats ---------- */

.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.format {
    position: relative; display: flex; flex-direction: column;
    padding: 26px 24px 24px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--lift);
    border-top: 8px solid var(--c, var(--teal));
}
.format h3 { font-size: 1.5rem; margin-bottom: .3em; }
.format p { color: var(--ink-soft); }
.format__icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; margin-bottom: 12px; background: var(--bgc); color: var(--c); }
.format__icon .icon { width: 32px; height: 32px; }
.format__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.format__fine { font-size: .9rem; margin: 14px 0 0; }
.format .soon-tag { position: absolute; top: 22px; right: 20px; }
.format--read { --c: var(--teal); --bgc: var(--mint); }
.format--puzzle { --c: var(--purple); --bgc: var(--lilac); }
.format--listen { --c: var(--pink); --bgc: var(--blush); }
.format.is-soon { background: repeating-linear-gradient(-45deg, #fff 0 14px, #FCFAFF 14px 28px); }

.pager { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; }
.pager__link {
    display: inline-flex; align-items: center; gap: 12px; max-width: 48%;
    padding: 14px 20px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--lift);
    color: var(--ink); text-decoration: none; font: 600 1.15rem/1.25 var(--font-head);
}
.pager__link small { display: block; font: 700 .85rem var(--font-body); color: var(--teal); }
.pager__link .icon { width: 28px; height: 28px; color: var(--gold-deep); }
.pager__link--next { text-align: right; margin-left: auto; }
.pager__link:hover { box-shadow: var(--lift-hover); transform: translateY(-2px); }

/* ---------- Reader ---------- */

.reader { padding-block: 20px 40px; }
.reader__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.reader__tools { display: flex; gap: 8px; }
.reader__stage { position: relative; width: min(1180px, 100% - 32px); margin-inline: auto; }
.book {
    position: relative; margin-inline: auto;
    width: min(100%, calc((100vh - 260px) * 16 / 9)); min-width: min(100%, 320px);
    aspect-ratio: 16 / 9;
    border: 10px solid var(--paper); border-radius: var(--radius-big); overflow: hidden;
    background: var(--ink); box-shadow: var(--lift); cursor: pointer;
}
.book__page { margin: 0; position: absolute; inset: 0; }
.book__page img { width: 100%; height: 100%; object-fit: cover; }
.book__end {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px; text-align: center; cursor: default;
    background: radial-gradient(circle at 50% 40%, #fff 0%, var(--lilac) 70%);
}
.book__the-end { font: 700 clamp(2.4rem, 7vw, 4.6rem)/1 var(--font-head); color: var(--purple); margin-bottom: .2em; }
.book__moral { display: inline-flex; align-items: center; gap: 8px; font: 600 clamp(1.1rem, 2.6vw, 1.6rem) var(--font-head); color: var(--teal); }
.book__moral .icon { color: var(--pink); }
.turn-in-next { animation: in-next .35s ease-out; }
.turn-in-prev { animation: in-prev .35s ease-out; }
@keyframes in-next { from { opacity: 0; transform: translateX(6%) rotate(1deg); } }
@keyframes in-prev { from { opacity: 0; transform: translateX(-6%) rotate(-1deg); } }

.turn {
    position: absolute; top: 50%; translate: 0 -50%;
    display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--gold); color: var(--ink); box-shadow: 0 5px 0 var(--gold-deep), 0 10px 20px rgba(0, 0, 0, .15);
    transition: transform .12s, opacity .2s;
}
.turn .icon { width: 36px; height: 36px; }
.turn:hover { transform: scale(1.08); }
.turn:active { transform: scale(.95); }
.turn:disabled { opacity: 0; pointer-events: none; }
.turn--prev { left: -18px; }
.turn--next { right: -18px; }

.reader__foot { text-align: center; margin-top: 18px; }
.reader__count { font: 600 1.2rem var(--font-head); margin-bottom: 10px; }
.dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dots button {
    width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: #DCD3EA; transition: transform .15s, background .15s;
}
.dots button:hover { transform: scale(1.3); }
.dots button[aria-current="true"] { background: var(--purple); transform: scale(1.35); }
.reader__hint { margin-top: 12px; color: var(--ink-soft); font-size: .92rem; }

.reader__stage:fullscreen { width: 100%; display: grid; place-items: center; background: var(--ink); padding: 24px 90px; }
.reader__stage:fullscreen .book { width: min(100%, calc((100vh - 48px) * 16 / 9)); }
.reader__stage:fullscreen .turn--prev { left: 14px; }
.reader__stage:fullscreen .turn--next { right: 14px; }

/* ---------- Coming-soon panels ---------- */

.soon-panel {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center;
    padding: clamp(20px, 4vw, 44px); border-radius: var(--radius-big); background: var(--paper); box-shadow: var(--lift);
}
.soon-panel__text h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-top: 14px; }
.soon-panel__text p { color: var(--ink-soft); font-size: 1.1rem; }

.puzzle-tease {
    display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 5px;
    aspect-ratio: 16 / 9; padding: 10px; border-radius: 22px;
    background: repeating-linear-gradient(45deg, var(--lilac) 0 12px, #F8F3FE 12px 24px);
}
.puzzle-tease__tile {
    border-radius: 8px;
    background-image: var(--img);
    background-size: calc(var(--cols) * 100% + (var(--cols) - 1) * 5px) calc(var(--rows) * 100% + (var(--rows) - 1) * 5px);
    background-position: calc(var(--x) / (var(--cols) - 1) * 100%) calc(var(--y) / (var(--rows) - 1) * 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5);
}
.puzzle-tease__tile.is-loose {
    transform: translate(var(--dx), var(--dy)) rotate(var(--r));
    box-shadow: 0 10px 18px rgba(59, 42, 90, .3), inset 0 0 0 3px #fff;
    animation: wobble 3s ease-in-out infinite alternate;
    z-index: 1;
}
.puzzle-tease__tile.is-loose:nth-child(odd) { animation-delay: -1.5s; }
@keyframes wobble { to { transform: translate(calc(var(--dx) * .6), calc(var(--dy) * .6)) rotate(calc(var(--r) * -.5)); } }

.record {
    position: relative; width: min(100%, 380px); aspect-ratio: 1; margin-inline: auto; border-radius: 50%;
    background: repeating-radial-gradient(circle, #3B2A5A 0 3px, #4A3870 3px 6px);
    box-shadow: var(--lift), inset 0 0 0 10px #2C1F45;
}
.record::after { content: ""; position: absolute; inset: 47%; border-radius: 50%; background: var(--cream); }
.record__label {
    position: absolute; inset: 28%; border-radius: 50%;
    background-size: cover; background-position: 60% 40%; border: 6px solid var(--gold);
}
.record.is-spinning { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fake-player {
    display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; padding: 12px 18px 12px 12px;
    border-radius: 999px; background: var(--sky-2); opacity: .8;
}
.fake-player__btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #E2DAEE; color: #fff; }
.fake-player__btn .icon { margin-left: 3px; }
.fake-player__track { flex: 1; height: 10px; border-radius: 999px; background: #E2DAEE; overflow: hidden; }
.fake-player__track span { display: block; width: 0; height: 100%; background: var(--pink); }
.fake-player__time { font-weight: 800; color: var(--ink-soft); }
.audio { width: 100%; margin-top: 8px; }

/* ---------- Grown-ups ---------- */

.grownups-teaser {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding: clamp(22px, 4vw, 40px); border-radius: var(--radius-big);
    background: var(--ink); color: #fff;
}
.grownups-teaser h2 { color: var(--gold); font-size: 1.9rem; }
.grownups-teaser p { margin: 0; max-width: 40em; color: #E8E1F5; }
.grownups-teaser .btn--ink { --bg: var(--gold); --fg: var(--ink); --edge: var(--gold-deep); }
.grownups-teaser--soft { background: var(--mint); color: var(--ink); }
.grownups-teaser--soft h2 { color: var(--teal); }
.grownups-teaser--soft p { color: var(--ink-soft); }

.prose-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.prose h2 { font-size: 1.7rem; margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.ticks, .beats { padding-left: 0; list-style: none; }
.ticks li, .beats li { position: relative; padding-left: 38px; margin-bottom: 12px; }
.ticks li::before {
    content: ""; position: absolute; left: 0; top: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E8C84' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.beats { counter-reset: beat; }
.beats li::before {
    counter-increment: beat; content: counter(beat);
    position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; background: var(--gold); font: 700 .9rem var(--font-head);
}
.morals { position: sticky; top: 90px; padding: 24px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--lift); }
.morals h2 { font-size: 1.4rem; }
.morals ol { list-style: none; margin: 0; padding: 0; }
.morals a { display: flex; gap: 12px; padding: 10px 6px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.morals a:hover { background: var(--sky-2); }
.morals strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; }
.morals em { font-style: normal; color: var(--teal); font-weight: 700; }
.morals__num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); font: 700 1rem var(--font-head); }

.empty { text-align: center; padding: 48px 24px; background: var(--paper); border-radius: var(--radius-big); box-shadow: var(--lift); }

/* ---------- Footer ---------- */

.footer { margin-top: 48px; }
.footer__hills { display: block; width: 100%; height: clamp(50px, 8vw, 110px); }
.footer__body { background: var(--grass); padding-block: 8px 28px; color: #1F4A18; }
.footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; }
.footer__brand { display: flex; align-items: center; gap: 6px; font: 700 1.6rem var(--font-head); margin: 0; color: #fff; text-shadow: 0 2px 0 rgba(31, 74, 24, .25); }
.footer__brand .icon { color: var(--gold); }
.footer__tag { margin: 0; font-weight: 700; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__links a { color: #1F4A18; font-weight: 800; text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__fine { grid-column: 1 / -1; margin: 12px 0 0; font-size: .9rem; opacity: .85; }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
    .hero__inner, .soon-panel, .prose-grid { grid-template-columns: 1fr; }
    .hero__frame { transform: none; }
    .ways { grid-template-columns: repeat(2, 1fr); }
    .formats { grid-template-columns: 1fr; }
    .morals { position: static; }
}
@media (max-width: 600px) {
    body { font-size: 1rem; }
    .topbar__inner { padding-block: 8px; justify-content: center; }
    .nav__link { padding: 8px 12px; }
    .ways { grid-template-columns: 1fr 1fr; gap: 10px; }
    .way { padding: 16px; }
    .way span:last-child { font-size: .9rem; }
    .band--friends { margin-inline: 0; border-radius: 0; }
    .friend { grid-template-columns: 96px 1fr; gap: 14px; }
    .friend__img { width: 96px; }
    .ep-head { text-align: left; }
    .ep-head .back { float: none; }
    .ep-head__moral { font-size: 1.05rem; }
    .pager { flex-direction: column; }
    .pager__link { max-width: none; }
    .player, .hero__frame, .book { border-width: 6px; border-radius: 20px; }
    .turn { width: 48px; height: 48px; }
    .turn .icon { width: 26px; height: 26px; }
    .turn--prev { left: -8px; }
    .turn--next { right: -8px; }
    .reader__stage:fullscreen { padding: 12px 56px; }
    .footer__inner { grid-template-columns: 1fr; }
}

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