/* Electrosparkzz — soft, cute and friendly */
:root {
  --cream: #fff8f2;
  --ink: #2b2238;
  --muted: #6f6380;
  --line: #f1e3ea;
  --white: #ffffff;
  --peach: #ffe0cc;
  --pink: #ffd3e4;
  --lilac: #e7dcff;
  --sky: #d6ecff;
  --mint: #d5f5e5;
  --butter: #fff1bd;
  --orange: #f97316;
  --rose: #ec4899;
  --violet: #8b5cf6;
  --grad: linear-gradient(95deg, var(--orange), var(--rose) 52%, var(--violet));
  --shadow: 0 14px 34px rgba(190, 80, 140, 0.13), 0 2px 6px rgba(120, 60, 110, 0.06);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--cream); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; margin: 0; line-height: 1.08; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background-image: radial-gradient(rgba(236, 72, 153, 0.13) 1.2px, transparent 1.3px);
  background-size: 26px 26px;
}

/* Soft colour blobs behind everything */
.blobs { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.75; animation: float 14s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; left: -120px; top: -80px; background: var(--peach); }
.b2 { width: 460px; height: 460px; right: -140px; top: 120px; background: var(--lilac); animation-delay: -4s; }
.b3 { width: 380px; height: 380px; left: 20%; top: 640px; background: var(--pink); animation-delay: -8s; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; padding: 14px 16px 0; }
.nav {
  max-width: 1080px;
  margin: 0 auto;
  height: 60px;
  padding: 0 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.brand img { border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.nav-links a:hover { background: var(--pink); color: var(--ink); }
.nav-links .nav-pill { background: var(--ink); color: var(--white); }
.nav-links .nav-pill:hover { background: var(--rose); color: var(--white); }

/* Hero */
.hero {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 20px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.mascot-row { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.mascot { filter: drop-shadow(0 10px 16px rgba(236, 72, 153, 0.3)); animation: wave 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.bubble {
  position: relative;
  margin: 0;
  padding: 10px 16px;
  border-radius: 20px 20px 20px 6px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 15px;
}
.logo img { display: block; width: min(300px, 58vw); height: auto; filter: drop-shadow(0 12px 22px rgba(236, 72, 153, 0.22)); }
.eyebrow {
  margin: 22px 0 16px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--butter);
  font-weight: 800;
  font-size: 14px;
}
.hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -0.01em; }
.hero h1 .grad { display: inline-block; }
.lead { max-width: 560px; margin: 18px 0 26px; color: var(--muted); font-size: 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--white);
  border: 2px solid var(--pink);
  font-weight: 800;
  font-size: 15px;
}
.status b { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.2); animation: blink 1.6s ease-in-out infinite; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--grad);
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 12px 26px rgba(236, 72, 153, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 30px rgba(236, 72, 153, 0.4); }

/* Floating stickers */
.stickers { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
/* Content sits above the stickers */
.hero > :not(.stickers), .gz-hero > :not(.stickers) { position: relative; z-index: 1; }
.sticker { position: absolute; font-size: 28px; line-height: 1; animation: bob 5s ease-in-out infinite; }
.s1 { left: 6%; top: 18%; color: var(--orange); }
.s2 { right: 8%; top: 14%; color: var(--rose); font-size: 34px; animation-delay: -1s; }
.s3 { left: 12%; bottom: 22%; color: #f6b400; animation-delay: -2s; }
.s4 { right: 12%; bottom: 26%; color: var(--violet); animation-delay: -3s; }
.s5 { left: 46%; top: 4%; color: var(--rose); font-size: 18px; animation-delay: -1.5s; }
.s6 { right: 26%; top: 36%; color: #9ccaf5; font-size: 34px; animation-delay: -2.5s; }

/* Sections */
.section { max-width: 1080px; margin: 0 auto; padding: 40px 20px 64px; text-align: center; }
.kicker { display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px; background: var(--lilac); font-weight: 800; font-size: 14px; }
.section h2 { font-size: clamp(32px, 5vw, 52px); }

.cards { margin-top: 34px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; text-align: left; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: var(--radius);
  border: 2px solid var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px) rotate(-0.6deg); }
.card h3 { font-size: 26px; }
.card p { margin: 0; color: var(--muted); font-weight: 700; font-size: 15px; flex: 1; }
.card-icon { width: 58px; height: 58px; margin-bottom: 8px; border-radius: 20px; display: grid; place-items: center; font-size: 30px; background: rgba(255, 255, 255, 0.75); box-shadow: inset 0 0 0 2px var(--white); }
.card-icon.app img { border-radius: 12px; }
.tag { align-self: flex-start; margin-top: 10px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); font-weight: 800; font-size: 13px; }
.sky { background: linear-gradient(160deg, var(--sky), #eef7ff); }
.lilac { background: linear-gradient(160deg, var(--lilac), #f5f0ff); }
.pink { background: linear-gradient(160deg, var(--pink), #fff0f6); }
.card-link .tag { background: var(--ink); color: var(--white); }
.dashed { background: rgba(255, 255, 255, 0.55); border: 2px dashed #e6c8d8; box-shadow: none; }

.about-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 28px;
  border-radius: 36px;
  border: 2px solid var(--white);
  background: linear-gradient(160deg, #ffffff, #fff4ec);
  box-shadow: var(--shadow);
}
.about-card > p { max-width: 520px; margin: 16px auto 0; color: var(--muted); font-size: 17px; }
.values { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.values li { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--mint); font-weight: 800; font-size: 15px; }
.values li:nth-child(2) { background: var(--sky); }
.values li:nth-child(3) { background: var(--pink); }

.footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  border-top: 2px dashed var(--line);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--rose); }

/* Entrance */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.24s; }
.reveal:nth-child(5) { animation-delay: 0.32s; }
.reveal:nth-child(6) { animation-delay: 0.4s; }
.reveal:nth-child(7) { animation-delay: 0.48s; }

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes float { to { transform: translate(40px, 30px) scale(1.1); } }
@keyframes bob { 50% { transform: translateY(-12px) rotate(8deg); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
@keyframes blink { 50% { opacity: 0.45; } }

/* ── Glazy page ─────────────────────────────────────────────── */
.gz-hero { position: relative; max-width: 820px; margin: 0 auto; padding: 48px 20px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.gz-mark img { display: block; width: 92px; height: 92px; border-radius: 24px; box-shadow: 0 16px 30px rgba(43, 34, 56, 0.25); animation: bob 5s ease-in-out infinite; }
.gz-title { margin-top: 18px; font-size: clamp(56px, 10vw, 96px); font-weight: 700; }
.gz-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.gz-section { max-width: 1000px; margin: 0 auto; padding: 44px 20px 24px; }
.gz-section h2 { font-size: clamp(30px, 4.6vw, 48px); }
.gz-lead { max-width: 660px; margin: 16px 0 0; color: var(--muted); font-size: 17px; }
.gz-cards { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gz-card, .gz-panel, .gz-steps li, .gz-faq details {
  border: 2px solid var(--white);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}
.gz-card { padding: 20px; }
.gz-card:nth-child(6n + 1) { background: linear-gradient(160deg, var(--pink), #fff6fa); }
.gz-card:nth-child(6n + 2) { background: linear-gradient(160deg, var(--sky), #f3f9ff); }
.gz-card:nth-child(6n + 3) { background: linear-gradient(160deg, var(--peach), #fff7f1); }
.gz-card:nth-child(6n + 4) { background: linear-gradient(160deg, var(--lilac), #f8f4ff); }
.gz-card:nth-child(6n + 5) { background: linear-gradient(160deg, var(--mint), #f2fcf7); }
.gz-card:nth-child(6n + 6) { background: linear-gradient(160deg, var(--butter), #fffbea); }
.gz-card span { font-size: 28px; }
.gz-card h3, .gz-panel h3 { margin: 8px 0 4px; font-size: 21px; }
.gz-card p { margin: 0; color: var(--muted); font-size: 15px; }
.gz-steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.gz-steps li { position: relative; counter-increment: step; padding: 18px 20px 18px 74px; display: flex; flex-direction: column; gap: 4px; }
.gz-steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  background: var(--grad);
  box-shadow: 0 8px 16px rgba(236, 72, 153, 0.3);
}
.gz-steps b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px; }
.gz-steps span { color: var(--muted); font-size: 15px; }
.gz-steps span b { font-family: inherit; font-size: inherit; font-weight: 800; color: var(--ink); }
.gz-section a { color: var(--rose); font-weight: 800; }
.gz-note { margin: 16px 0 0; padding: 12px 16px; border-radius: 18px; background: var(--butter); font-size: 14px; font-weight: 600; }
.gz-grid2 { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gz-panel { padding: 24px; }
.gz-panel h3:first-child { margin-top: 0; }
.gz-panel ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.gz-panel li, .gz-panel p { color: var(--muted); font-size: 15px; }
.gz-panel b { color: var(--ink); }
.gz-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 12px; }
.gz-tags span { padding: 5px 12px; border-radius: 999px; background: var(--mint); color: #1f6b47; font-weight: 800; font-size: 13px; }
.gz-warn { background: linear-gradient(160deg, var(--peach), #fff8f3); }
.gz-faq { margin-top: 26px; display: grid; gap: 10px; }
.gz-faq details { padding: 0 20px; }
.qa { padding: 14px 18px; border-radius: 20px; background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 2px #f4e6ee; }
.qa h3 { margin: 0 0 4px; font-family: "Nunito", sans-serif; font-weight: 800; font-size: 16px; line-height: 1.35; }
.qa p { margin: 0 !important; font-size: 15px !important; }
.gz-faq summary { cursor: pointer; list-style: none; position: relative; padding: 17px 30px 17px 0; font-weight: 800; font-size: 16px; }
.gz-faq summary::-webkit-details-marker { display: none; }
.gz-faq summary::after { content: "+"; position: absolute; right: 0; top: 11px; font-family: "Fredoka", sans-serif; font-size: 26px; color: var(--rose); transition: transform 0.2s; }
.gz-faq details[open] summary::after { transform: rotate(45deg); }
.gz-faq p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.gz-cta { max-width: 760px; margin: 30px auto 50px; padding: 44px 24px; border-radius: 36px; border: 2px solid var(--white); background: linear-gradient(160deg, var(--pink), var(--lilac)); box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.gz-cta h2 { font-size: clamp(30px, 5vw, 46px); }

/* 404 */
.lost { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; gap: 14px; }
.lost h1 { font-size: clamp(64px, 14vw, 120px); }
.lost p { margin: 0 0 8px; color: var(--muted); font-size: 18px; }

/* Responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gz-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gz-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 10px 10px 0; }
  .nav { height: 54px; padding: 0 6px 0 10px; }
  .brand span { display: none; }
  .nav-links a { padding: 7px 11px; font-size: 14px; }
  .hero { padding: 34px 18px 50px; }
  .bubble { font-size: 14px; }
  .mascot { width: 76px; height: 76px; }
  .lead { font-size: 16px; }
  .sticker { font-size: 22px; }
  .s5, .s6 { display: none; }
  .s3 { bottom: 8%; left: 6%; }
  .s4 { bottom: 10%; right: 6%; }
  .cards, .gz-cards { grid-template-columns: 1fr; }
  .card { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 14px; }
  .card .card-icon { margin: 0; }
  .card h3 { flex: 1; }
  .card p { flex-basis: 100%; }
  .gz-steps li { padding: 16px 16px 16px 66px; }
  .gz-steps li::before { left: 16px; top: 16px; width: 34px; height: 34px; }
  .about-card { padding: 32px 20px; }
  .footer { justify-content: center; text-align: center; }
}

/* ── The book ──────────────────────────────────────────────── */
/* Without JavaScript: pages stack like a normal web page */
.leaf { position: relative; max-width: 760px; margin: 0 auto 18px; padding: 24px 20px; }
.book-ui, .swipe-hint, .desk-top { display: none; }

/* Each book's cover colours */
body { --cover-a: #ffc9de; --cover-b: #d9c9ff; --cover-edge: #c95b8d; --accent: var(--rose); }
body.theme-triply { --cover-a: #bfe6ff; --cover-b: #c9f2e2; --cover-edge: #3c8fb3; --accent: #0e8fb8; }
body.theme-herai { --cover-a: #ecd2ff; --cover-b: #ffd0e5; --cover-edge: #a557c9; --accent: #b03fd6; }
body.theme-glazy { --cover-a: #ffcade; --cover-b: #ffe1cc; --cover-edge: #d9577f; --accent: #e04482; }

html.has-book, html.has-book body { height: 100%; }
html.has-book body {
  overflow: hidden;
  overscroll-behavior: none;
  /* a cute gingham tablecloth */
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 65%),
    repeating-linear-gradient(0deg, rgba(255, 175, 205, 0.22) 0 22px, transparent 22px 44px),
    repeating-linear-gradient(90deg, rgba(255, 175, 205, 0.22) 0 22px, transparent 22px 44px),
    #fff7f1;
}
html.has-book .page { height: 100svh; display: flex; flex-direction: column; overflow: hidden; background: none; }
html.has-book .blobs, html.has-book .topbar { display: none; }

html.has-book .desk-top {
  display: flex;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) 14px 0;
}
.desk-home { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); box-shadow: var(--shadow); text-decoration: none; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; }
.desk-home img { border-radius: 9px; }

html.has-book .book-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 10px;
  perspective: 2600px;
}
html.has-book .book {
  --pad: 10px;
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.7s cubic-bezier(0.3, 0.75, 0.25, 1);
}
html[data-book-mode="single"] .book { width: min(100%, 520px); height: min(100%, 860px); }
html[data-book-mode="spread"] .book {
  width: min(1160px, 100%, calc((100svh - 150px) * 1.42));
  aspect-ratio: 1.42;
}
/* Closed: centre the cover (front) or the back cover */
html[data-book-mode="spread"] .book.closed-front { transform: translateX(-25%); }
html[data-book-mode="spread"] .book.closed-back { transform: translateX(25%); }

/* Hardcover boards behind the pages */
html.has-book .board {
  position: absolute;
  top: calc(var(--pad) * -1);
  bottom: calc(var(--pad) * -1);
  background:
    radial-gradient(rgba(255, 255, 255, 0.35) 1.4px, transparent 1.6px) 0 0 / 18px 18px,
    linear-gradient(150deg, var(--cover-a), var(--cover-b));
  box-shadow: 0 24px 50px rgba(110, 50, 90, 0.25), 0 4px 10px rgba(110, 50, 90, 0.12), inset 0 0 0 3px rgba(255, 255, 255, 0.45);
  transition: opacity 0.3s;
}
html[data-book-mode="spread"] .board-left { left: calc(var(--pad) * -1); right: 50%; border-radius: 14px 4px 4px 14px; opacity: 0; }
html[data-book-mode="spread"] .board-right { left: 50%; right: calc(var(--pad) * -1); border-radius: 4px 14px 14px 4px; opacity: 0; }
html[data-book-mode="spread"] .book.show-left .board-left,
html[data-book-mode="spread"] .book.show-right .board-right { opacity: 1; }
html[data-book-mode="single"] .board-left { display: none; }
html[data-book-mode="single"] .board-right { left: -6px; right: calc(var(--pad) * -1); border-radius: 6px 16px 16px 6px; }

/* Page edges: thicker on the side that still has more pages */
html.has-book .edges { position: absolute; top: 4px; bottom: 4px; width: calc(var(--d, 0) * 1.4px + 2px); border-radius: 3px; opacity: 0; background: repeating-linear-gradient(90deg, #fffaf3 0 1px, #eadccd 1px 2px); transition: opacity 0.3s; }
html.has-book .edges-right { --d: var(--right-depth); right: calc(var(--d, 0) * -1.4px - 2px); }
html.has-book .edges-left { --d: var(--left-depth); left: calc(var(--d, 0) * -1.4px - 2px); }
html.has-book .book.show-right .edges-right { opacity: 1; }
html[data-book-mode="spread"] .book.show-left .edges-left { opacity: 1; }

/* Ribbon bookmark */
html.has-book .ribbon {
  position: absolute;
  z-index: 2000;
  top: -10px;
  width: 16px;
  height: calc(100% + 46px);
  background: linear-gradient(90deg, #e94f8a, #ff7aa8 50%, #e94f8a);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 10px), 0 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 0.3s;
}
/* only its tail shows, hanging out below the pages */
html.has-book .ribbon { top: auto; bottom: -40px; height: 48px; }
html[data-book-mode="spread"] .ribbon { left: calc(50% + 60px); }
html[data-book-mode="single"] .ribbon { right: 44px; }
html[data-book-mode="spread"] .book.closed-front .ribbon,
html[data-book-mode="spread"] .book.closed-back .ribbon { opacity: 0; }

/* Sheets and their two faces */
html.has-book .sheets { position: absolute; inset: 0; }
html.has-book .sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
}
html[data-book-mode="single"] .sheet { left: 0; width: 100%; }
html[data-book-mode="spread"] .sheet { left: 50%; width: 50%; }
html.has-book .face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
html.has-book .face.back { transform: rotateY(180deg); }
/* Paper, with a soft shadow down the spine */
html.has-book .face.front {
  background: linear-gradient(90deg, rgba(110, 70, 50, 0.16), rgba(110, 70, 50, 0.04) 18px, rgba(110, 70, 50, 0) 44px), #fffdf8;
}
html.has-book .face.back {
  background: linear-gradient(270deg, rgba(110, 70, 50, 0.16), rgba(110, 70, 50, 0.04) 18px, rgba(110, 70, 50, 0) 44px), #fffaf2;
}
html[data-book-mode="spread"] .face.front { border-radius: 2px 10px 10px 2px; }
html[data-book-mode="spread"] .face.back { border-radius: 10px 2px 2px 10px; }
html[data-book-mode="single"] .face.front { border-radius: 4px 14px 14px 4px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05); }
html[data-book-mode="single"] .face.back { border-radius: 14px 4px 4px 14px; background: radial-gradient(rgba(236, 72, 153, 0.07) 1px, transparent 1.2px) 0 0 / 18px 18px, #fbf2e8; }
html.has-book .sheet:not(.is-turned) .face.front { box-shadow: 1px 0 0 rgba(120, 80, 60, 0.08); }
html.has-book .face-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(90deg, rgba(43, 34, 56, 0) 35%, rgba(43, 34, 56, 0.5)); }
html.has-book .face.back .face-shade { background: linear-gradient(270deg, rgba(43, 34, 56, 0) 35%, rgba(43, 34, 56, 0.5)); }

/* Covers are the hardcover itself */
html.has-book .face.is-cover {
  background:
    radial-gradient(rgba(255, 255, 255, 0.45) 1.4px, transparent 1.6px) 0 0 / 18px 18px,
    linear-gradient(150deg, var(--cover-a), var(--cover-b));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), inset 10px 0 18px -10px rgba(0, 0, 0, 0.25);
}
html.has-book .face.back.is-cover { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), inset -10px 0 18px -10px rgba(0, 0, 0, 0.25); }

/* Page content */
html.has-book .leaf { position: absolute; inset: 0; margin: 0; max-width: none; padding: 0; }
/* Pages never scroll: the book flows extra content onto the next page */
html.has-book .page-scroll {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 30px 28px 54px 38px;
}
html.has-book .face.back .page-scroll { padding: 30px 38px 54px 28px; }
html.has-book .leaf.cover .page-scroll { display: flex; flex-direction: column; }
html.has-book .leaf.cover .page-scroll > * { margin-top: auto; margin-bottom: auto; }
html.has-book .folio { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; color: #c0aebb; pointer-events: none; }
html.has-book .folio::before, html.has-book .folio::after { content: "~"; margin: 0 6px; color: #e2cfd9; }

/* Contents page */
.toc-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 4px; counter-reset: toc; }
.toc-list a { display: flex; align-items: baseline; gap: 8px; padding: 9px 4px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 16px; color: var(--ink); }
.toc-list a:hover { background: rgba(255, 211, 228, 0.5); }
.toc-list span { flex: none; max-width: 75%; }
.toc-list i { flex: 1; border-bottom: 2px dotted #e2cfd9; transform: translateY(-4px); }
.toc-list b { font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--accent); }

/* Compact the shared sections so a page fits */
html.has-book .hero { padding: 0; }
/* The cover scales with the screen height, so it fits without scrolling */
html.has-book .hero .logo { display: block; align-self: center; }
html.has-book .hero .logo img { width: clamp(120px, 24vh, 220px); margin: 0 auto; }
html.has-book .hero h1 { font-size: min(clamp(30px, 4.6vw, 54px), 7.2vh); }
html.has-book .hero .eyebrow { margin: 1.4vh 0 1.2vh; }
html.has-book .hero .lead { margin: 1.4vh 0 2.2vh; font-size: min(16px, 2.3vh); }
html.has-book .hero .status, html.has-book .hero .btn { padding-top: min(12px, 1.5vh); padding-bottom: min(12px, 1.5vh); }
html.has-book .mascot { width: 70px; height: 70px; }
html.has-book .section { padding: 0; }
html.has-book .section h2 { font-size: clamp(26px, 3.6vw, 40px); }
html.has-book .about-card { box-shadow: none; border: 0; background: transparent; padding: 6px 0; }
html.has-book .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
html.has-book .card { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; padding: 14px; }
html.has-book .card h3 { flex: none; font-size: 21px; }
html.has-book .card p { flex: 1 1 auto; flex-basis: auto; font-size: 13px; }
html.has-book .card .card-icon { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; margin-bottom: 4px; }
html.has-book .card .tag { font-size: 12px; }
html.has-book .gz-cards { grid-template-columns: 1fr; }
html[data-book-mode="spread"] .hero .mascot-row { margin-bottom: 0; }

/* Page furniture */
.chapter { margin: 0 0 10px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; letter-spacing: 0.04em; color: var(--accent); }
.chapter b { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 13px; }
.book-page h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 14px; }
.book-page p { color: var(--muted); font-size: 16px; margin: 0 0 12px; }
.book-page p strong { color: var(--ink); }
.book-page .art { font-size: 50px; line-height: 1; margin: 4px 0 14px; }
.book-page .quote { margin: 16px 0 0; padding: 14px 18px; border-radius: 20px; background: rgba(255, 255, 255, 0.75); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px; color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.facts li { padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px #f4e6ee; font-size: 14px; color: var(--muted); }
.facts li b { display: block; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 17px; color: var(--ink); }
.areas { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.areas li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px #f4e6ee; }
.areas li > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(150deg, var(--cover-a), var(--cover-b)); }
.areas b { display: block; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 17px; }
.areas p { margin: 2px 0 0; font-size: 15px; }
.planned { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 2px dashed var(--accent); color: var(--accent); font-weight: 800; font-size: 13px; }
.cover-title { font-size: clamp(54px, 7vw, 92px); font-weight: 700; line-height: 0.95; }
.cover-sub { margin: 10px 0 16px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: clamp(18px, 2.2vw, 24px); color: var(--ink); }
.cover-meta { margin-top: 16px; font-size: 14px; color: var(--muted); font-weight: 700; }
.cover-center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.read-on { margin-top: 18px; }
.small-note { font-size: 13px !important; color: #9a8ea6 !important; }

/* Toolbar under the book */
html.has-book .book-ui {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100% - 24px, 460px);
  margin: 4px auto max(10px, env(safe-area-inset-bottom));
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.book-ui button {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #fff3f8;
  font-family: "Fredoka", sans-serif;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s, background 0.2s;
}
.book-ui button:hover:not(:disabled) { background: var(--pink); }
.book-ui button:not(:disabled):active { transform: scale(0.9); }
.book-ui button:disabled { opacity: 0.35; cursor: default; }
.book-ui [data-next] { background: var(--grad); color: #fff; }
.book-ui [data-sound], .book-ui [data-contents] { font-size: 17px; }
.book-ui .track { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.book-ui .bar { width: 100%; height: 5px; border-radius: 999px; background: #f3e3ea; overflow: hidden; }
.book-ui .bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
.book-ui [data-counter] { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }

html.has-book .swipe-hint {
  display: block;
  position: absolute;
  z-index: 3000;
  left: 50%;
  translate: -50% 0;
  bottom: 22px;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  pointer-events: none;
  animation: nudge 1.8s ease-in-out infinite;
  transition: opacity 0.3s;
}
.swipe-hint.gone { opacity: 0; }
@keyframes nudge { 50% { transform: translateX(-10px); } }

@media (max-width: 560px) {
  html.has-book .book-stage { padding: 12px 16px 6px 12px; }
  html.has-book .book { --pad: 7px; }
  html.has-book .page-scroll { padding: 22px 18px 48px 26px; }
  .book-page p { font-size: 15.5px; }
  .desk-home span { display: none; }
  html.has-book .desk-home { padding: 6px; }
}
@media (max-height: 700px) {
  html.has-book .swipe-hint { display: none; }
  html.has-book .mascot-row { display: none; }
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html.has-book .swipe-hint { display: none; }
  html { scroll-behavior: auto; }
}

/* the 3D link on the cover */
a.status { text-decoration: none; color: inherit; }
