:root {
  --violet: #6c4dff;
  --violet-deep: #4b32d9;
  --lavender: #afa0ff;
  --coral: #ff7a5c;
  --mint: #4ed7a8;
  --gold: #ffd66b;
  --dark: #1a1a2e;
  --ink: #23205a;
  --light: #f5f7ff;
  --page: #fafbff;
  --white: #ffffff;
  --shadow-glow: 0 28px 80px rgba(108, 77, 255, 0.22);
  --shadow-card: 0 24px 60px rgba(108, 77, 255, 0.12);
  --shadow-soft: 0 14px 40px rgba(26, 26, 46, 0.08);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: max(20px, calc((100vw - 1200px) / 2));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--dark);
  background: var(--page);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: "Poppins", system-ui, sans-serif;
  margin: 0;
}

h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

/* ---------- Shared pieces ---------- */

.eyebrow {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(108, 77, 255, 0.1);
  color: var(--violet);
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow-coral {
  background: rgba(255, 122, 92, 0.12);
  color: #e0573a;
}

.section-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: rgba(26, 26, 46, 0.72);
  max-width: 30rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: var(--white);
  background: linear-gradient(90deg, var(--violet), #8c6bff);
  box-shadow: 0 12px 30px rgba(108, 77, 255, 0.35);
}

.btn-light {
  color: var(--violet);
  background: var(--white);
  box-shadow: 0 18px 40px rgba(26, 26, 46, 0.2);
}

.btn-small {
  padding: 11px 22px;
  font-size: 0.95rem;
}

.btn-big {
  padding: 19px 34px;
  font-size: 1.2rem;
}

.text-link {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: var(--violet);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.topbar.is-scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(250, 251, 255, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(108, 77, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 44px;
  height: 44px;
}

.brand-name {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
}

.topnav {
  display: flex;
  gap: 36px;
  font-weight: 600;
  color: rgba(26, 26, 46, 0.75);
}

.topnav a:hover {
  color: var(--violet);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(108, 77, 255, 0.08);
}

.lang-switch button {
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--violet);
  font: 600 0.8rem "Poppins", sans-serif;
  cursor: pointer;
}

.lang-switch button.is-active {
  background: var(--violet);
  color: var(--white);
}

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 56px;
  padding: 40px var(--gutter) 120px;
  overflow: hidden;
}

.glow-lavender {
  width: 560px;
  height: 560px;
  left: -160px;
  top: -140px;
  background: rgba(175, 160, 255, 0.6);
}

.glow-coral {
  width: 400px;
  height: 400px;
  right: 4%;
  top: 40px;
  background: rgba(255, 122, 92, 0.35);
}

.glow-mint {
  width: 340px;
  height: 340px;
  right: 30%;
  bottom: -80px;
  background: rgba(78, 215, 168, 0.3);
}

.motion-ok .glow-lavender,
.motion-ok .glow-coral,
.motion-ok .glow-mint {
  animation: drift 16s ease-in-out infinite alternate;
}

.motion-ok .glow-coral {
  animation-duration: 12s;
  animation-delay: -4s;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-title {
  font-family: "Baloo 2", "Poppins", system-ui, sans-serif;
  font-size: clamp(2.8rem, 5.6vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-wrap: balance;
}

.word.accent {
  background: linear-gradient(90deg, var(--violet), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.3rem;
  line-height: 1.55;
  color: rgba(26, 26, 46, 0.78);
  max-width: 35rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

/* Hero entrance: the title appears word by word, as if someone were reading it. */
.motion-ok .hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: word-in 0.7s var(--ease-out) forwards;
  animation-delay: calc(150ms + var(--i) * 70ms);
}

.motion-ok .hero-title .word.accent {
  animation-name: word-in, accent-glow;
  animation-duration: 0.7s, 1.6s;
  animation-delay: calc(150ms + var(--i) * 70ms), 1100ms;
}

.motion-ok .hero-in {
  opacity: 0;
  transform: translateY(18px);
  animation: word-in 0.8s var(--ease-out) forwards;
  animation-delay: var(--d);
}

.hero-stage {
  position: relative;
  height: 640px;
}

.tablet {
  position: absolute;
  inset: 20px 40px 20px 50px;
  padding: 12px;
  border-radius: 44px;
  background: var(--ink);
  box-shadow: 0 40px 90px rgba(108, 77, 255, 0.35);
  will-change: transform;
}

.tablet-scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px;
}

.reading-card {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(26, 26, 46, 0.18);
}

.reading-label {
  font: 700 0.7rem "Poppins", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}

.reading-sentence {
  font: 600 1.3rem/1.4 "Poppins", sans-serif;
  color: rgba(26, 26, 46, 0.35);
}

.rw {
  transition: color 0.25s ease;
}

.rw.is-read {
  color: var(--ink);
}

.rw.is-current {
  color: var(--violet);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.mic {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 68px;
  height: 68px;
  margin-left: -29px;
  display: grid;
  place-items: center;
}

/* Same mic button as the app's reader (ChildMicControl): violet circle, white mic, soft violet ring. */
.mic-core {
  position: relative;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--violet);
  box-shadow: var(--shadow-glow);
}

.mic-core svg {
  width: 32px;
  height: 32px;
}

.mic-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: rgba(108, 77, 255, 0.3);
}

.motion-ok .mic-ring {
  animation: pulse 2.4s ease-out infinite;
}

.motion-ok .mic-ring-late {
  animation-delay: 1.2s;
}

.float-chip {
  position: absolute;
  top: 96px;
  left: -36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 14px 30px rgba(26, 26, 46, 0.14);
  font: 600 0.95rem "Poppins", sans-serif;
  color: var(--ink);
  white-space: nowrap;
}

.float-star {
  position: absolute;
  top: 250px;
  right: -10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--gold);
  box-shadow: 0 10px 24px rgba(255, 214, 107, 0.5);
  font: 700 0.95rem "Poppins", sans-serif;
  color: var(--ink);
}

/* ---------- How it works ---------- */

.how {
  position: relative;
  background: var(--white);
}

.how-sticky {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
  padding: 110px var(--gutter);
}

.how-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 26px;
  border-radius: 28px;
  background: var(--light);
  border: 1px solid rgba(108, 77, 255, 0.1);
  transition: opacity 0.45s ease, background 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease, transform 0.45s var(--ease-out);
}

.step h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.step p {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(26, 26, 46, 0.72);
}

.step-num {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  font: 700 1.3rem "Poppins", sans-serif;
}

.coral {
  background: var(--coral);
}

.violet {
  background: var(--violet);
}

.mint {
  background: var(--mint);
}

.how-device {
  position: relative;
  height: 600px;
}

.tablet-how {
  inset: 0 40px;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 12px;
  border-radius: 32px;
  overflow: hidden;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.6s ease, transform 0.8s var(--ease-out);
}

.screen.is-active {
  opacity: 1;
  transform: scale(1);
}

.screen-choose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: #2e2a6e;
}

.screen-choose img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.screen-choose img:first-child {
  outline: 4px solid var(--gold);
  outline-offset: -4px;
}

.story-clip {
  display: block;
  background: #2e2a6e;
}

.step-clip {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin-top: 16px;
  border-radius: 20px;
}

.screen-alive .float-chip {
  top: auto;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
}

.sparkle {
  position: absolute;
  color: var(--gold);
  font-size: 2rem;
  text-shadow: 0 0 18px rgba(255, 214, 107, 0.9);
}

.s1 {
  top: 18%;
  left: 20%;
}

.s2 {
  top: 34%;
  right: 18%;
  font-size: 1.4rem;
}

.s3 {
  top: 56%;
  left: 40%;
  font-size: 1.1rem;
}

.motion-ok .screen-alive.is-active .sparkle {
  animation: twinkle 1.8s ease-in-out infinite;
}

.motion-ok .screen-alive.is-active .s2 {
  animation-delay: 0.6s;
}

.motion-ok .screen-alive.is-active .s3 {
  animation-delay: 1.2s;
}

/* On wide screens with motion, the section stays pinned while the three steps pass. */
@media (min-width: 960px) {
  .motion-ok .how {
    height: 300vh;
  }

  .motion-ok .how-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 84px;
    padding-bottom: 24px;
  }

  .motion-ok .how-copy {
    gap: 14px;
  }

  .motion-ok .how-copy h2 {
    font-size: clamp(2rem, 3vw, 2.6rem);
  }

  .motion-ok .steps {
    gap: 12px;
    margin-top: 8px;
  }

  .motion-ok .step {
    padding: 18px 22px;
  }

  .motion-ok .step p {
    font-size: 1rem;
  }

  .motion-ok .how-device {
    height: min(600px, calc(100vh - 130px));
  }

  .motion-ok .step {
    opacity: 0.5;
  }

  .motion-ok .step.is-active {
    opacity: 1;
    background: var(--white);
    border-color: rgba(108, 77, 255, 0.35);
    box-shadow: 0 20px 50px rgba(108, 77, 255, 0.18);
    transform: translateX(8px);
  }
}

@media (min-width: 960px) and (max-height: 760px) {
  .motion-ok .how-copy .section-lead {
    display: none;
  }
}

/* ---------- Sentence that lights up ---------- */

.statement {
  position: relative;
  background: var(--dark);
  color: var(--white);
}

.statement-sticky {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 140px var(--gutter);
  text-align: center;
  overflow: hidden;
}

.glow-violet-dark {
  width: 620px;
  height: 620px;
  left: -160px;
  top: -200px;
  background: rgba(108, 77, 255, 0.45);
}

.glow-coral-dark {
  width: 440px;
  height: 440px;
  right: -80px;
  bottom: -160px;
  background: rgba(255, 122, 92, 0.3);
}

.statement-text {
  position: relative;
  max-width: 62rem;
  font: 700 clamp(2.2rem, 5vw, 4.2rem) / 1.18 "Poppins", sans-serif;
  letter-spacing: -0.03em;
}

.sword.accent {
  background: linear-gradient(90deg, var(--gold), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.motion-ok .sword {
  opacity: 0.22;
  transition: opacity 0.35s ease;
}

.motion-ok .sword.is-lit {
  opacity: 1;
}

.motion-ok .statement {
  height: 220vh;
}

.motion-ok .statement-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
}

/* ---------- Stories: the book shelf ---------- */

.stories {
  padding: 120px 0 56px;
  overflow: hidden;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 var(--gutter);
  margin-bottom: 48px;
}

/*
  Each story is a small hardcover book made of three flat faces (cover, spine, page edges) that CSS turns in 3D.
  Nothing here moves on its own: a book changes only when the pointer reaches it or when another book becomes the
  centred one, and every change ends. Only transform and opacity are animated, and never more than a few books at once.
  Without JavaScript the shelf is a plain row of books that scrolls sideways (the rules before ".shelf-ready").
*/
.shelf {
  --book-w: clamp(200px, 56vw, 280px);
  --book-h: calc(var(--book-w) * 1.5);
  --book-depth: calc(var(--book-w) * 0.13);
  --slot: calc(var(--book-w) * 0.83);
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: -14px;
  background: radial-gradient(ellipse 52% 44% at 50% 64%, rgba(175, 160, 255, 0.3), transparent 72%);
}

.stories-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.stories-viewport::-webkit-scrollbar {
  display: none;
}

.stories-viewport:focus-visible {
  outline-offset: -6px;
}

.stories-track {
  list-style: none;
  margin: 0;
  padding: 30px var(--gutter) 64px;
  display: flex;
  gap: 28px;
  width: max-content;
}

/* The <li> never moves, so the pointer cannot slip off a book while the book is moving. */
.book {
  --ry: 12deg;
  --lift: 0px;
  --scale: 1;
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  justify-content: center;
  width: var(--book-w);
  height: var(--book-h);
  scroll-snap-align: start;
}

.book[hidden] {
  display: none;
}

/* A smaller book is moved down by half of what it lost in height, so every book stands on the same line. */
.book-body {
  position: relative;
  flex: none;
  height: 100%;
  max-width: var(--book-w);
  aspect-ratio: var(--ar, 2 / 3);
  transform-style: preserve-3d;
  transform: perspective(1600px) translateY(calc(var(--lift) + (1 - var(--scale)) * var(--book-h) / 2)) rotateY(var(--ry))
    scale(var(--scale));
}

.book-cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 3px 9px 9px 3px;
  background: var(--spine, var(--violet-deep));
  box-shadow: 0 12px 28px -12px rgba(26, 26, 46, 0.5), 0 2px 6px rgba(26, 26, 46, 0.14);
  transform: translateZ(calc(var(--book-depth) / 2));
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The groove where a hardcover bends, and a soft light across the cover. */
.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 2.4%, rgba(0, 0, 0, 0.2) 4.6%, rgba(0, 0, 0, 0) 7.6%),
    linear-gradient(105deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 36%);
  pointer-events: none;
}

/* A cover that did not load: a plain clothbound book with the story's title. */
.book-cover.is-missing img {
  opacity: 0;
}

.book-cover.is-missing::before {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14%;
  font: 700 calc(var(--book-w) * 0.075) / 1.25 "Poppins", sans-serif;
  color: var(--white);
  text-align: center;
  text-wrap: balance;
}

.book-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--book-depth) / -2);
  width: var(--book-depth);
  border-radius: 2px;
  background-color: var(--spine, var(--violet-deep));
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.14) 46%, rgba(0, 0, 0, 0.16)),
    linear-gradient(180deg, transparent 6%, rgba(255, 214, 107, 0.8) 6% 6.8%, transparent 6.8% 8.6%, rgba(255, 214, 107, 0.8) 8.6% 9%, transparent 9% 91%, rgba(255, 214, 107, 0.8) 91% 91.4%, transparent 91.4% 93.2%, rgba(255, 214, 107, 0.8) 93.2% 94%, transparent 94%);
  transform: rotateY(-90deg);
}

.book-pages {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: calc(2px - (var(--book-depth) - 3px) / 2);
  width: calc(var(--book-depth) - 3px);
  background:
    linear-gradient(90deg, rgba(26, 26, 46, 0.22), rgba(26, 26, 46, 0) 30%, rgba(26, 26, 46, 0) 70%, rgba(26, 26, 46, 0.18)),
    repeating-linear-gradient(90deg, #fbf6ea 0 1.5px, #e6dcc8 1.5px 3px);
  transform: rotateY(90deg);
}

/* The shadow on the floor (::after) and the violet light under the centred book (::before). */
.book::before,
.book::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.book::after {
  left: -8%;
  right: -8%;
  bottom: -20px;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(35, 32, 90, 0.36), rgba(35, 32, 90, 0.12) 46%, transparent 70%);
}

.book::before {
  left: -34%;
  right: -34%;
  bottom: -40px;
  height: 96px;
  background: radial-gradient(ellipse at center, rgba(108, 77, 255, 0.42), transparent 68%);
  opacity: 0;
}

.story-caption {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 5%;
  font: 700 calc(var(--book-w) * 0.066) / 1.25 "Poppins", sans-serif;
  color: var(--white);
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* With JavaScript: the book in the middle faces the reader and the others turn towards it. */
.shelf-ready .stories-viewport {
  scroll-padding-inline: 0;
}

.shelf-ready .stories-track {
  gap: 0;
  padding-inline: calc(50% - var(--slot) / 2);
}

.shelf-ready.is-static .stories-track {
  padding-inline: 0;
  margin-inline: auto;
}

.shelf-ready .book {
  --ry: -24deg;
  --scale: 0.8;
  width: var(--slot);
  scroll-snap-align: center;
}

.shelf-ready .book.is-before {
  --ry: 24deg;
}

.shelf-ready .book.is-center {
  --ry: 8deg;
  --scale: 1;
  z-index: 2;
}

.shelf-ready .book::after {
  transform: scale(0.8);
}

.shelf-ready .book.is-center::after {
  transform: none;
}

.shelf-ready .book.is-center::before {
  opacity: 1;
}

/* Previous / next: only shown when the books do not all fit, and never on touch-only screens (they swipe). */
.shelf-nav {
  position: absolute;
  right: var(--gutter);
  bottom: calc(100% + 38px);
  display: flex;
  gap: 10px;
}

.shelf-nav[hidden] {
  display: none;
}

.shelf-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(108, 77, 255, 0.16);
  border-radius: 50%;
  background: var(--white);
  color: var(--violet);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.shelf-btn svg {
  width: 20px;
  height: 20px;
}

.shelf-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

@media (hover: none) and (pointer: coarse) {
  .shelf-nav {
    display: none;
  }
}

@media (max-width: 719px) {
  .shelf-nav {
    position: static;
    order: 2;
    justify-content: center;
    margin-top: -20px;
  }
}

/* Movement, only for people who have not asked for less of it. */
@media (prefers-reduced-motion: no-preference) {
  .book {
    transition: z-index 0s linear 0.25s;
  }

  .book-body {
    transition: transform 0.6s var(--ease-out);
  }

  .book::before,
  .book::after {
    transition: transform 0.6s var(--ease-out), opacity 0.6s ease;
  }

  .shelf-nav {
    transition: opacity 0.6s ease;
  }

  .shelf-btn {
    transition: transform 0.25s var(--ease-out), opacity 0.25s ease;
  }

  /* The shelf arrives once, when it first reaches the screen: the centred book first, then its neighbours. */
  .shelf.is-waiting .book,
  .shelf.is-waiting .shelf-nav {
    opacity: 0;
  }

  .shelf.is-entering .book {
    animation: book-in 0.8s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
  }
}

/* A book is picked up only by a real pointer (mouse or trackpad); touch screens use the centred book instead. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .book:hover {
    --lift: -16px;
    --ry: 5deg;
    z-index: 3;
    transition-delay: 0s;
  }

  .book:hover::after {
    opacity: 0.6;
  }

  .shelf-ready .book:hover {
    --ry: -13deg;
    --scale: 0.9;
  }

  .shelf-ready .book.is-before:hover {
    --ry: 13deg;
  }

  .shelf-ready .book.is-center:hover {
    --ry: 15deg;
    --scale: 1;
  }

  .shelf-btn:not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
  }
}

/* ---------- Families ---------- */

.families {
  padding: 20px 0 120px;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 var(--gutter);
}

.family-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 32px 36px;
  border-radius: 32px;
  background: var(--white);
  border: 1px solid rgba(108, 77, 255, 0.1);
  box-shadow: var(--shadow-card);
}

.family-card h3 {
  font-size: 1.45rem;
  font-weight: 600;
}

.family-card p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(26, 26, 46, 0.72);
}

.family-icon {
  align-self: flex-start;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 1.6rem;
  line-height: 1;
}

.family-icon.violet {
  background: rgba(108, 77, 255, 0.14);
}

.family-icon.coral {
  background: rgba(255, 122, 92, 0.14);
}

.family-icon.mint {
  background: rgba(78, 215, 168, 0.16);
}

/* ---------- Final call to action ---------- */

.cta-wrap {
  padding: 0 var(--gutter) 110px;
}

.cta-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 88px 40px;
  border-radius: 48px;
  text-align: center;
  color: var(--white);
  background: linear-gradient(120deg, var(--violet-deep), var(--violet) 55%, #9a7bff);
  box-shadow: 0 40px 100px rgba(108, 77, 255, 0.35);
}

.cta-panel > :not(.glow) {
  position: relative;
}

.cta-panel h2 {
  max-width: 48rem;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.cta-panel p {
  max-width: 36rem;
  font-size: 1.25rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}

.cta-logo {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 8px 20px rgba(26, 26, 46, 0.25));
}

.glow-cta-coral {
  width: 440px;
  height: 440px;
  right: -60px;
  top: -180px;
  background: rgba(255, 122, 92, 0.55);
}

.glow-cta-mint {
  width: 380px;
  height: 380px;
  left: -120px;
  bottom: -160px;
  background: rgba(78, 215, 168, 0.4);
}

.motion-ok .glow-cta-coral,
.motion-ok .glow-cta-mint {
  animation: drift 14s ease-in-out infinite alternate;
}

/* A soft shine that sweeps across the main buttons every few seconds. */
.motion-ok .btn-big::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 5s ease-in-out infinite 2s;
}

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

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 32px var(--gutter) 40px;
  border-top: 1px solid rgba(108, 77, 255, 0.1);
  font-weight: 600;
  color: rgba(26, 26, 46, 0.55);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Appear on scroll ---------- */

.motion-ok .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s ease, transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.motion-ok .reveal-grow {
  opacity: 0.4;
  transform: scale(0.94);
  transition: opacity 0.9s ease, transform 1.1s var(--ease-out);
}

.motion-ok .reveal.is-visible,
.motion-ok .reveal-grow.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Keyframes ---------- */

@keyframes word-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes accent-glow {
  0%,
  100% {
    filter: none;
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(108, 77, 255, 0.55));
  }
}

@keyframes book-in {
  from {
    opacity: 0;
    transform: translateY(48px);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(40px, 30px, 0) scale(1.12);
  }
}

@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(2.1);
    opacity: 0;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(20deg);
  }
}

@keyframes shine {
  0%,
  70% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1080px) {
  .topnav {
    display: none;
  }
}

@media (max-width: 959px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 80px;
  }

  .hero-stage {
    height: 520px;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
  }

  .tablet {
    inset: 10px 24px 20px;
  }

  .float-chip {
    left: 0;
    top: 40px;
  }

  .float-star {
    right: 0;
    top: 190px;
  }

  .how-sticky {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 72px var(--gutter);
  }

  .how-device {
    display: none;
  }

  .step-clip {
    display: block;
  }

  .statement-sticky {
    padding: 96px var(--gutter);
  }

  .family-grid {
    grid-template-columns: 1fr;
  }

  .stories {
    padding: 80px 0 24px;
  }

  .families {
    padding-bottom: 80px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
    gap: 10px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .topbar-actions {
    gap: 8px;
  }

  .lang-switch button {
    padding: 5px 9px;
  }

  .btn-small {
    padding: 9px 14px;
    font-size: 0.85rem;
  }

  .hero {
    padding-top: 20px;
    gap: 36px;
  }

  .hero-lead {
    font-size: 1.1rem;
  }

  .hero-actions .btn-big {
    width: 100%;
  }

  .hero-actions .text-link {
    width: 100%;
    text-align: center;
  }

  .hero-stage {
    height: 440px;
  }

  .reading-card {
    left: 20px;
    right: 20px;
    bottom: 40px;
    padding: 14px 16px;
  }

  .reading-sentence {
    font-size: 1.05rem;
  }

  .float-chip {
    font-size: 0.85rem;
    padding: 10px 14px;
  }

  .cta-panel {
    padding: 56px 24px;
    border-radius: 32px;
  }

  .cta-panel .btn-big {
    width: 100%;
  }

  .footer {
    justify-content: center;
    text-align: center;
  }
}
