@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --cream: #FFF8EC;
  --paper: #FFFFFF;
  --ink: #2B2D5C;
  --ink-soft: #5A5C86;
  --night: #1E2350;
  --sun: #FFC94D;
  --sun-deep: #F5A623;
  --coral: #FF7A6B;
  --mint: #3CB98A;
  --sky: #4FB3E8;
  --line: #F0E3CC;
  --radius: 26px;
  --pop: 0 6px 0 rgba(43, 45, 92, .12);
  --head: "Fredoka", "Nunito", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 500 1.0625rem/1.6 var(--body);
  background-image: radial-gradient(circle at 1px 1px, rgba(43,45,92,.07) 1.5px, transparent 0);
  background-size: 26px 26px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); text-align: center; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--sun); padding: 8px 14px; border-radius: 12px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 10px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100% - 1180px) / 2));
  background: rgba(255, 248, 236, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark { width: 44px; height: 38px; }
.wordmark { font: 700 1.7rem/1 var(--head); letter-spacing: -.02em; }
.wordmark span { display: inline-block; transition: transform .2s; }
.logo:hover .wordmark span:nth-child(odd) { transform: translateY(-3px) rotate(-4deg); }
.logo:hover .wordmark span:nth-child(even) { transform: translateY(2px) rotate(4deg); }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: #FFEBC2; }
.langpick { position: relative; }
.langpick summary {
  list-style: none; cursor: pointer; font-weight: 800; padding: 8px 14px; border-radius: 999px;
  background: var(--paper); border: 2px solid var(--line); box-shadow: var(--pop); white-space: nowrap;
}
.langpick summary::-webkit-details-marker { display: none; }
.langpick ul {
  position: absolute; right: 0; top: calc(100% + 10px); margin: 0; padding: 8px; list-style: none;
  background: var(--paper); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 12px 30px rgba(43,45,92,.15);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; min-width: 260px;
}
.langpick li a { display: block; padding: 8px 12px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.langpick li a:hover { background: #FFF1D4; }
.langpick li a[aria-current] { background: var(--sun); }

.lang-hint {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  background: var(--sky); color: var(--ink); font-weight: 800; padding: 10px 16px; text-align: center;
}
.lang-hint[hidden] { display: none; }
.lang-hint a { background: #fff; color: var(--ink); padding: 4px 14px; border-radius: 999px; text-decoration: none; }
.lang-hint button { background: none; border: 0; color: var(--ink); font: inherit; font-size: 1.3rem; cursor: pointer; }

/* buttons, pills, badges */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 700 1.05rem/1 var(--head);
  padding: 13px 22px; border-radius: 999px; border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.btn.buy { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 var(--sun-deep); }
.btn.buy:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--sun-deep); }
.btn.buy:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sun-deep); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); }
.btn.ghost:hover { transform: translateY(-2px); }
.btn.big { font-size: 1.2rem; padding: 16px 28px; }
.pill { display: inline-block; font-size: .85rem; font-weight: 800; padding: 3px 11px; border-radius: 999px; background: #FFF1D4; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 .8em; }
.badge {
  position: absolute; bottom: 12px; left: 12px; font: 600 .9rem/1 var(--head); padding: 8px 12px; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0,0,0,.12); transform: rotate(-4deg);
}
.badge.live { background: var(--mint); color: var(--ink); }
.badge.soon { background: var(--coral); color: var(--ink); }

/* hero */
.hero {
  position: relative; margin: 20px auto 0; width: min(1180px, calc(100% - 32px)); border-radius: 36px; overflow: hidden;
  background: var(--night); color: #FFF8EC; min-height: clamp(440px, 56vw, 620px); display: flex; align-items: flex-start;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(20,24,64,.85) 0%, rgba(20,24,64,.55) 38%, rgba(20,24,64,0) 62%);
}
.hero-text { position: relative; z-index: 2; padding: clamp(28px, 6vw, 72px); max-width: 600px; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.kicker { font: 600 1rem/1.2 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--sun-deep); margin-bottom: .6em; }
.hero .kicker { color: var(--sun); }
.lead { font-size: 1.2rem; font-weight: 600; max-width: 30ch; margin-bottom: 1.4em; }
.star { position: absolute; z-index: 2; color: var(--sun); font-size: 1.4rem; animation: twinkle 3s ease-in-out infinite; }
.s1 { top: 14%; right: 46%; } .s2 { top: 30%; right: 38%; animation-delay: 1s; font-size: 1rem; } .s3 { top: 8%; right: 30%; animation-delay: 2s; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.7) rotate(20deg); } }

/* sections */
.section { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: clamp(48px, 8vw, 88px) 0 0; }
.intro { text-wrap: balance; text-align: center; max-width: 60ch; margin: 0 auto 2em; color: var(--ink-soft); font-size: 1.15rem; }

.how-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.how-item { background: var(--paper); border-radius: var(--radius); padding: 28px; border: 2px solid var(--line); box-shadow: var(--pop); }
.how-item:nth-child(2) { transform: rotate(.6deg); } .how-item:nth-child(3) { transform: rotate(-.6deg); }
.how-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; font-size: 2rem; margin-bottom: 14px; background: #FFE3A3; }
.how-item:nth-child(2) .how-icon { background: #CDEFE3; } .how-item:nth-child(3) .how-icon { background: #D9E8FF; }
.how-item p { color: var(--ink-soft); margin: 0; }
.why-icon { display: inline-block; font: 700 1.25rem/1 var(--head); padding: 12px 16px; border-radius: 18px; margin-bottom: 14px; background: #FFD6CF; }
.why-item:nth-child(2) .why-icon { background: #CDEFE3; } .why-item:nth-child(3) .why-icon { background: #EADCFF; }
.why .intro { margin-bottom: 0; }

.gift { width: min(1180px, calc(100% - 32px)); margin: clamp(48px, 8vw, 88px) auto 0; }
.gift-inner {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px clamp(20px, 4vw, 44px); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #FF8E7F 0 18px, #FF7A6B 18px 36px); color: #fff; box-shadow: 0 6px 0 #E0594A;
}
.gift-inner > div { flex: 1 1 300px; }
.gift h2 { text-align: left; color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .3em; }
.gift p { margin: 0; font-weight: 700; }
.gift-icon { font-size: 3.4rem; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } }

/* book grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line); box-shadow: var(--pop); display: flex; flex-direction: column; transition: transform .2s; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); }
.cover-link { position: relative; display: block; background: var(--tint); }
.cover-link img { width: 100%; aspect-ratio: 400 / 406; object-fit: cover; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--sun); }
.sub { margin: -.3em 0 .6em; color: var(--ink-soft); font-weight: 700; font-size: .95rem; }
.blurb { color: var(--ink-soft); font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.actions .btn { font-size: .95rem; padding: 11px 16px; }
.grid:not(.small) { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-title { text-align: center; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 2.4em 0 1em; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.grid.small .wip-emoji { font-size: 4.2rem; }

.wip { background: var(--tint); border-style: dashed; border-color: rgba(43,45,92,.18); }
.wip-art { position: relative; display: grid; place-items: center; aspect-ratio: 1 / .78; }
.wip-emoji { font-size: 5.4rem; filter: drop-shadow(0 6px 0 rgba(43,45,92,.12)); animation: bob 3.2s ease-in-out infinite; }
.wip:nth-child(3n) .wip-emoji { animation-delay: -1s; } .wip:nth-child(3n+1) .wip-emoji { animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(3deg); } }
.wip .card-body { padding-top: 0; }
.wip .badge { top: 12px; bottom: auto; }
.wip h3 { font-size: 1.15rem; }
.wip .pill { background: rgba(255,255,255,.7); }

/* languages */
.hello-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.hello-list a {
  position: relative; display: flex; flex-direction: column; align-items: center; text-decoration: none; background: var(--tint);
  padding: 16px 22px 12px; border-radius: 24px 24px 24px 6px; box-shadow: var(--pop); transition: transform .2s;
}
.hello-list li:nth-child(even) a { border-radius: 24px 24px 6px 24px; }
.hello-list a:hover { transform: translateY(-4px) rotate(-2deg) scale(1.04); }
.hello { font: 700 1.5rem/1.1 var(--head); }
.lname { font-size: .85rem; font-weight: 800; color: var(--ink-soft); }

/* faq & about */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item { background: var(--paper); border: 2px solid var(--line); border-radius: 20px; padding: 0 22px; box-shadow: var(--pop); }
.faq-item summary { cursor: pointer; font: 600 1.15rem/1.3 var(--head); padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.6rem; line-height: .8; color: var(--coral); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--ink-soft); }
.about { max-width: 760px; text-align: center; font-size: 1.15rem; }

/* book page */
.crumbs { width: min(1180px, calc(100% - 32px)); margin: 20px auto 0; }
.crumbs a { font-weight: 800; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); }
.book-page { width: min(1180px, calc(100% - 32px)); margin: 24px auto 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 820px) { .book-page { grid-template-columns: 1fr; } }
.book-cover { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 0 rgba(43,45,92,.14), 0 24px 50px rgba(43,45,92,.18); transform: rotate(-1.5deg); }
.book-cover .badge { bottom: 18px; left: 18px; font-size: 1.05rem; }
.book-info h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.h1-sub { display: block; font-size: .62em; color: var(--coral); margin-top: .25em; }
.edition-header { font-weight: 800; font-size: 1.1rem; }
.blurb-full p { font-size: 1.1rem; }
.blurb-nl { margin: 0 0 1.2em; padding: 16px 20px; border-radius: 18px; background: #FFF1D4; color: var(--ink-soft); font-size: .98rem; }
.blurb-nl p:last-child { margin: 0; }
.bullets { padding: 0; list-style: none; margin: 0 0 1.6em; }
.bullets li { padding-left: 32px; position: relative; margin-bottom: 6px; font-weight: 700; }
.bullets li::before { content: "★"; position: absolute; left: 4px; color: var(--sun-deep); }
.soon-note { display: inline-block; background: var(--coral); color: #fff; font: 600 1.1rem/1.3 var(--head); padding: 14px 22px; border-radius: 999px; }
.gallery { list-style: none; padding: 0 0 12px; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: min(86%, 900px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
.gallery li { scroll-snap-align: center; }
.gallery img { border-radius: 20px; box-shadow: var(--pop); }
#edities { scroll-margin-top: 80px; }
.editions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.edition { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 18px 16px; border-radius: 20px; background: var(--paper); border: 2px dashed var(--line); }
.edition.live { border-style: solid; box-shadow: var(--pop); }
.edition[aria-current] { background: #FFF1D4; border-color: var(--sun-deep); }
.ed-name { display: flex; flex-direction: column; text-decoration: none; min-width: 0; max-width: 100%; }
.ed-name small { color: var(--ink-soft); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-name:hover strong { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; }
.edition .btn { flex: none; font-size: .9rem; padding: 10px 14px; }
.soon-tag { flex: none; font: 600 .9rem/1 var(--head); color: var(--ink); background: var(--coral); padding: 10px 14px; border-radius: 999px; }

/* footer */
.foot { margin-top: clamp(64px, 10vw, 110px); background: var(--night); color: #E8E6FF; padding: 44px 16px; border-radius: 40px 40px 0 0; text-align: center; }
.foot-inner { max-width: 900px; margin: 0 auto; }
.foot .logo { margin-bottom: 14px; }
.foot-langs a { display: inline-block; margin: 3px 6px; color: var(--sun); font-weight: 700; }

@media (max-width: 760px) {
  .nav { display: none; }
  .langpick { margin-left: auto; }
  .wordmark { font-size: 1.4rem; }
  .hero { align-items: flex-end; }
  .hero::after { background: linear-gradient(0deg, rgba(20,24,64,.92) 0%, rgba(20,24,64,.6) 55%, rgba(20,24,64,.1) 100%); }
  .star { display: none; }
  .langpick ul { grid-template-columns: 1fr; min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* 404 */
.lost { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: clamp(40px, 8vw, 80px) 0 clamp(48px, 8vw, 88px); text-align: center; }
.lost-art { font-size: clamp(4rem, 14vw, 7rem); line-height: 1; margin: 0 0 .2em; animation: peek 3s ease-in-out infinite; }
.lost h1 { font-size: clamp(2rem, 6vw, 3.4rem); text-wrap: balance; }
.lost .btn { margin: .6em 0 2.4em; }
.lost .hello { font-size: 1.05rem; }
@keyframes peek { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-6px); } }

/* cookiebanner */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto;
  background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: 0 8px 0 rgba(43,45,92,.12), 0 10px 40px rgba(43,45,92,.18);
  padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 260px; font-size: .95rem; }
.consent div { display: flex; gap: 10px; }
.consent .btn { padding: 10px 18px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* privacy */
.legal { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: clamp(32px, 6vw, 64px) 0 clamp(48px, 8vw, 88px); }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); }
.legal h1, .legal h2, .legal .intro { text-align: left; }
.legal h2 { font-size: 1.35rem; margin-top: 1.6em; }
.legal .intro { font-size: 1.15rem; }
.legal a { color: inherit; }
.legal .updated { margin-top: 2.4em; color: var(--ink-soft); font-size: .9rem; }
.consent p a { color: inherit; white-space: nowrap; }
.foot p:not(.foot-langs) a, .foot .linklike { color: inherit; }
