:root{
  --accent:#ff9d5c; --accent2:#b69cff; --gold:#f6b73c;
  --text:#e9e3fb; --muted:#b6a9dc; --dim:#9a8dc4;
  --card:linear-gradient(180deg,#342d66 0%,#29234f 100%);
  --chip:#ffffff14; --line:#ffffff18;
  --max:1180px;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth; background:#14112a;}
body{
  margin:0; font-family:'Baloo 2',system-ui,sans-serif; color:var(--text);
  min-height:100vh; overflow-x:hidden;
}
body::before{content:""; position:fixed; inset:0; z-index:-1;
  background:
    radial-gradient(900px 520px at 12% -2%, rgba(126,96,206,.40), transparent 60%),
    radial-gradient(820px 600px at 90% 4%, rgba(74,118,206,.30), transparent 55%),
    radial-gradient(900px 700px at 50% 110%, rgba(196,120,92,.16), transparent 60%),
    linear-gradient(168deg,#14112a 0%,#1b1640 46%,#241d4f 100%);
}
.stars{position:fixed; inset:0; pointer-events:none; z-index:0; animation:tw 6s ease-in-out infinite;
  background-image:
    radial-gradient(2px 2px at 12% 18%,#ffffffcc 50%,transparent),
    radial-gradient(1.6px 1.6px at 28% 64%,#ffffffaa 50%,transparent),
    radial-gradient(2px 2px at 52% 24%,#ffffffbb 50%,transparent),
    radial-gradient(1.6px 1.6px at 74% 56%,#ffffffaa 50%,transparent),
    radial-gradient(2px 2px at 88% 22%,#ffffffbb 50%,transparent),
    radial-gradient(1.6px 1.6px at 42% 84%,#ffffffaa 50%,transparent),
    radial-gradient(1.6px 1.6px at 66% 78%,#ffffffaa 50%,transparent);}
@keyframes tw{0%,100%{opacity:.5}50%{opacity:1}}
a{color:inherit; text-decoration:none;}
.wrap{max-width:var(--max); margin:0 auto; padding:0 22px; position:relative; z-index:1;}
h1,h2,h3,.brand{font-family:'Fredoka',sans-serif;}
.eyebrow{font-family:'Fredoka',sans-serif; text-transform:uppercase; letter-spacing:.18em;
  font-size:13px; color:var(--gold); opacity:.95;}

/* header */
header.site{position:sticky; top:0; z-index:40; backdrop-filter:blur(12px);
  background:linear-gradient(180deg,rgba(20,16,40,.72),rgba(20,16,40,.35)); border-bottom:1px solid var(--line);}
.nav{display:flex; align-items:center; gap:20px; height:68px;}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:22px;}
.brand .logo{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;font-size:20px;
  background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 6px 16px -4px var(--accent2);}
.brand b{background:linear-gradient(90deg,#ffe1a3,#ff9d5c 55%,#c79bff);-webkit-background-clip:text;background-clip:text;color:transparent;}
.nav .links{display:flex; gap:24px; margin-left:14px; font-weight:600; color:var(--muted);}
.nav .links a:hover,.nav .links a.active{color:#fff;}
.nav .search{margin-left:auto; display:flex; align-items:center; gap:8px; background:var(--chip);
  border:1px solid var(--line); border-radius:999px; padding:9px 14px; color:var(--dim); min-width:210px;}
.nav .search input{background:none;border:none;outline:none;color:var(--text);font-family:inherit;font-size:14px;width:100%;}
.nav .signin{font-weight:600; color:var(--muted);}
.btn{font-family:'Fredoka',sans-serif; font-weight:600; cursor:pointer; border:none; border-radius:999px;
  padding:13px 22px; display:inline-flex; align-items:center; gap:9px; font-size:16px; transition:transform .15s,box-shadow .15s, background .15s;}
.btn.primary{color:#241c46; background:linear-gradient(135deg,#ffe1a3,#ff9d5c);
  box-shadow:0 12px 28px -8px #ff9d5caa;}
.btn.primary:hover{transform:translateY(-2px); box-shadow:0 16px 34px -8px #ff9d5cc0;}
.btn.ghost{color:var(--text); background:var(--chip); border:1.5px solid var(--line);}
.btn.ghost:hover{background:#ffffff22;}
.menu-toggle{display:none;}

/* hero */
.hero{display:grid; grid-template-columns:1.05fr 1fr; gap:42px; align-items:center; padding:64px 0 40px;}
.hero h1{font-size:clamp(38px,5.4vw,62px); line-height:1.04; margin:.25em 0 .35em;}
.hero h1 .g{background:linear-gradient(90deg,#ffe1a3,#ff9d5c 50%,#c79bff);-webkit-background-clip:text;background-clip:text;color:transparent;}
.hero p.lead{font-size:clamp(17px,2vw,20px); color:var(--muted); line-height:1.6; max-width:44ch; margin:0 0 26px;}
.hero .cta{display:flex; gap:14px; flex-wrap:wrap;}
.hero .badges{display:flex; gap:18px; flex-wrap:wrap; margin-top:24px; color:var(--dim); font-size:14px; font-weight:600;}
.hero .badges span{display:inline-flex; align-items:center; gap:7px;}
.hero .art{position:relative;}
.hero .art img{width:100%; aspect-ratio:2/1; object-fit:cover; border-radius:24px; border:1px solid var(--line);
  box-shadow:0 40px 90px -36px #000d, 0 1px 0 #ffffff14 inset;}
.hero .art .float{position:absolute; bottom:-18px; left:-14px; background:var(--card); border:1px solid var(--line);
  border-radius:16px; padding:12px 16px; display:flex; align-items:center; gap:10px; box-shadow:0 18px 40px -18px #000c; font-weight:600; font-size:14px;}
.hero .art .float .dot{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,var(--accent),var(--accent2));}

section{padding:46px 0;}
.sec-head{display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:22px;}
.sec-head h2{font-size:clamp(24px,3vw,34px); margin:.1em 0;}
.sec-head a.more{color:var(--muted); font-weight:600;}
.sec-head a.more:hover{color:#fff;}

/* featured */
.featured{display:grid; grid-template-columns:300px 1fr; gap:30px; background:var(--card);
  border:1px solid var(--line); border-radius:26px; overflow:hidden; box-shadow:0 30px 70px -34px #000c;}
.featured img{width:100%; height:100%; min-height:280px; object-fit:cover;}
.featured .body{padding:30px 34px 30px 6px; display:flex; flex-direction:column; justify-content:center;}
.featured h3{font-size:clamp(24px,3vw,32px); margin:.1em 0 .3em; color:#fff;}
.featured p{color:var(--muted); line-height:1.65; margin:.2em 0 18px; max-width:60ch;}
.tags{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px;}
.tag{font-size:12.5px; font-weight:600; color:var(--text); background:var(--chip); border:1px solid var(--line);
  border-radius:999px; padding:5px 11px;}
.tag.gold{background:#f6b73c22; border-color:#f6b73c55; color:#ffd98a;}

/* chips row */
.chips{display:flex; gap:12px; flex-wrap:wrap;}
.chip{background:var(--chip); border:1px solid var(--line); border-radius:16px; padding:14px 18px;
  font-weight:600; display:flex; align-items:center; gap:10px; transition:all .15s; cursor:pointer;}
.chip:hover{background:#ffffff22; transform:translateY(-2px);}
.chip .emo{font-size:20px;}
.chip small{display:block; color:var(--dim); font-weight:500; font-size:12px;}

/* story grid */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:22px;}
.card{position:relative; background:var(--card); border:1px solid var(--line); border-radius:20px; overflow:hidden;
  box-shadow:0 22px 50px -28px #000c; transition:transform .18s, box-shadow .18s; cursor:pointer; display:block;}
.card:hover{transform:translateY(-5px); box-shadow:0 30px 60px -26px #000d;}
.card .cov{position:relative; aspect-ratio:3/4; overflow:hidden;}
.card .cov img{width:100%; height:100%; object-fit:cover; display:block; transition:transform .4s;}
.card:hover .cov img{transform:scale(1.05);}
.card .play{position:absolute; right:12px; top:12px; z-index:3; width:42px;height:42px;border-radius:50%;
  background:rgba(20,16,40,.55); backdrop-filter:blur(4px); border:1px solid #ffffff44; color:#fff;
  display:grid; place-items:center; font-size:14px; padding-left:2px; transition:transform .15s ease, filter .15s ease;}
.card:hover .play{transform:scale(1.09); filter:brightness(1.08);}
.card .theme{position:absolute; left:10px; top:10px; font-size:11.5px; font-weight:600; color:#fff;
  background:rgba(20,16,40,.5); backdrop-filter:blur(4px); border:1px solid #ffffff33; border-radius:999px; padding:4px 10px;}
.card .info{position:absolute; left:0; right:0; bottom:0; z-index:1; padding:50px 16px 14px;
  background:linear-gradient(to top, rgba(0,0,0,.94) 6%, rgba(0,0,0,.8) 34%, rgba(0,0,0,.2) 72%, transparent);}
.card .info h3{font-size:18px; margin:0; color:#fff; line-height:1.22; text-shadow:0 2px 10px #000a;}
.card .info .botline{display:flex; justify-content:space-between; align-items:center; gap:12px; row-gap:4px; flex-wrap:wrap; margin-top:8px;}
.card .info .meta{color:#dbd4f2; font-size:13px; font-weight:600; display:flex; gap:9px; text-shadow:0 1px 6px #0009; white-space:nowrap;}

/* features */
.feat{display:grid; grid-template-columns:repeat(4,1fr); gap:20px;}
.feat .f{background:var(--chip); border:1px solid var(--line); border-radius:18px; padding:22px;}
.feat .f .ic{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;font-size:22px;margin-bottom:12px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));}
.feat .f h3{font-size:18px; margin:.2em 0 .4em; color:#fff;}
.feat .f p{color:var(--muted); font-size:14.5px; line-height:1.55; margin:0;}

/* newsletter */
.news{background:linear-gradient(135deg,#3a2f6b,#2a2352); border:1px solid var(--line); border-radius:26px;
  padding:44px; text-align:center; box-shadow:0 30px 70px -34px #000c; position:relative; overflow:hidden;}
.news h2{font-size:clamp(24px,3vw,32px); margin:.1em 0 .3em;}
.news p{color:var(--muted); margin:0 auto 22px; max-width:46ch;}
.news form{display:flex; gap:10px; justify-content:center; flex-wrap:wrap;}
.news input{background:#ffffff14; border:1px solid var(--line); border-radius:999px; padding:13px 20px;
  color:#fff; font-family:inherit; font-size:15px; min-width:280px; outline:none;}
.news .moon{position:absolute; font-size:120px; right:-10px; top:-30px; opacity:.18; filter:drop-shadow(0 0 30px #f6b73c);}

/* footer */
footer.site{border-top:1px solid var(--line); margin-top:30px; padding:46px 0 30px; color:var(--muted);}
.foot{display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:28px;}
.foot p{font-size:14px; line-height:1.6; max-width:34ch;}
.foot h4{font-family:'Fredoka',sans-serif; color:#fff; font-size:15px; margin:0 0 12px;}
.foot a{display:block; color:var(--muted); padding:5px 0; font-size:14px;}
.foot a:hover{color:#fff;}
.copyright{margin-top:30px; padding-top:18px; border-top:1px solid var(--line); display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; font-size:13px; color:var(--dim);}

/* ---- library page ---- */
.page-head{padding:46px 0 6px;}
.page-head h1{font-size:clamp(32px,4.6vw,52px); margin:.15em 0 .25em;}
.page-head h1 .g{background:linear-gradient(90deg,#ffe1a3,#ff9d5c 50%,#c79bff);-webkit-background-clip:text;background-clip:text;color:transparent;}
.page-head p{color:var(--muted); font-size:clamp(16px,2vw,19px); margin:0; max-width:62ch; line-height:1.55;}
.toolbar{display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin:28px 0 14px;}
.toolbar .search{flex:1 1 320px; display:flex; align-items:center; gap:10px; background:var(--chip);
  border:1px solid var(--line); border-radius:999px; padding:12px 18px; color:var(--dim);}
.toolbar .search input{flex:1; background:none; border:none; outline:none; color:var(--text); font-family:inherit; font-size:15px;}
.toolbar .sort{display:flex; align-items:center; gap:8px; color:var(--muted); font-size:14px; font-weight:600;}
.toolbar select{background:var(--chip); color:var(--text); border:1px solid var(--line); border-radius:999px;
  padding:11px 16px; font-family:inherit; font-size:14px; font-weight:600; outline:none; cursor:pointer;}
.toolbar select option{background:#241d4f;}
.filters{display:flex; flex-direction:column; gap:12px; margin-bottom:4px;}
.fgroup{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.fgroup > .lbl{font-family:'Fredoka',sans-serif; font-size:12.5px; text-transform:uppercase; letter-spacing:.12em;
  color:var(--dim); width:66px;}
.ftag{background:var(--chip); border:1px solid var(--line); border-radius:999px; padding:8px 14px;
  font-weight:600; font-size:14px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; transition:all .15s; color:var(--text);}
.ftag:hover{background:#ffffff22;}
.ftag.active{background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; border-color:transparent; box-shadow:0 6px 16px -6px var(--accent2);}
.results{display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin:22px 0 16px; color:var(--muted); font-weight:600; font-size:14px;}
.results .clear{color:var(--accent2); cursor:pointer; background:none; border:none; font-family:inherit; font-weight:600; font-size:14px;}
.results .clear:hover{color:#fff;}
.empty{text-align:center; padding:60px 20px; color:var(--muted); display:none;}
.empty .big{font-size:52px; margin-bottom:10px;}
#lib-grid{margin-bottom:24px; padding:0;}

@media (max-width:900px){
  .hero{grid-template-columns:1fr; gap:30px; padding:36px 0 20px;}
  .featured{grid-template-columns:1fr;}
  .featured img{min-height:220px; max-height:300px;}
  .featured .body{padding:6px 26px 30px;}
  .feat{grid-template-columns:repeat(2,1fr);}
  .foot{grid-template-columns:1fr 1fr;}
  .nav .links,.nav .search,.nav .signin{display:none;}
  .menu-toggle{display:grid; margin-left:auto; place-items:center; width:42px;height:42px;border-radius:12px;
    background:var(--chip); border:1px solid var(--line); color:#fff; font-size:20px;}
}
@media (max-width:520px){
  .feat{grid-template-columns:1fr;} .foot{grid-template-columns:1fr;}
  .fgroup > .lbl{width:100%;}
}
@media (prefers-reduced-motion:reduce){.stars{animation:none;}}

/* ---- library: mobile collapsible filters + compact toolbar ---- */
.filter-toggle{display:none;}
@media (max-width:720px){
  .toolbar{flex-wrap:nowrap; gap:10px; margin:24px 0 12px;}
  .toolbar .search{flex:1 1 auto; min-width:0; padding:11px 14px;}
  .toolbar .search input{min-width:0;}
  .toolbar .sort{flex:0 0 auto;}
  .toolbar .sort .sort-lbl{display:none;}
  .toolbar select{padding:11px 12px;}
  .filter-toggle{display:flex; align-items:center; gap:10px; width:100%;
    background:var(--chip); border:1px solid var(--line); color:var(--text);
    border-radius:14px; padding:13px 16px; font-family:'Fredoka',sans-serif; font-weight:600;
    font-size:15px; cursor:pointer; margin:2px 0 4px;}
  .filter-toggle svg{flex:0 0 auto; opacity:.9;}
  .filter-toggle .chev{margin-left:auto; transition:transform .2s ease;}
  .filter-toggle[aria-expanded="true"] .chev{transform:rotate(180deg);}
  .filter-toggle .fcount{background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff;
    font-size:12px; line-height:1; border-radius:999px; padding:3px 8px; font-weight:700;}
  .filter-toggle .fcount:empty{display:none;}
  .filters{display:none; margin-bottom:8px;}
  .filters.open{display:flex;}
}

/* two story columns on phones */
@media (max-width:540px){
  .grid{grid-template-columns:repeat(2,1fr); gap:14px;}
  .card .info{padding:36px 10px 10px;
    background:linear-gradient(to top, rgba(0,0,0,.92) 8%, rgba(0,0,0,.72) 40%, transparent 86%);}
  .card .info h3{font-size:14.5px; line-height:1.16; margin:0;}
  .card .info .botline{flex-wrap:nowrap; gap:6px; margin-top:6px;}
  .card .info .meta{font-size:10px; gap:5px;}
  .card .info .botline .meta:first-child{min-width:0; overflow:hidden;}
  .card .info .botline .meta:last-child{flex:0 0 auto;}
  .card .info .meta .u{display:none;}
  .card .theme{top:8px; left:8px; font-size:10px; padding:3px 8px;}
  .card .play{top:8px; right:8px; width:32px; height:32px; font-size:11px;}
}
