:root {
  --cream: #FFF8F0;
  --cream-soft: #FFEFDD;
  --white: #FFFFFF;
  --ink: #2D3142;
  --ink-light: #767B91;
  --orange: #F5A04A;
  --orange-dark: #E8893A;
  --teal: #2F9E97;
  --teal-dark: #257871;
  --cyan: #4FC9DA;
  --green: #A8D98C;
  --yellow: #FFD166;
  --pink: #FF9EB5;
  --max-width: 1180px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 12px 30px rgba(45, 49, 66, 0.08);
  --shadow-hover: 0 18px 40px rgba(45, 49, 66, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.65;
  background:
    radial-gradient(circle at 88% -5%, rgba(255, 209, 102, 0.35), transparent 35%),
    radial-gradient(circle at -5% 28%, rgba(79, 201, 218, 0.22), transparent 32%),
    radial-gradient(circle at 100% 65%, rgba(168, 217, 140, 0.22), transparent 35%),
    var(--cream);
  background-attachment: fixed;
}

h1, h2, h3 {
  font-family: "Baloo 2", "Nunito", sans-serif;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--cream-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
}

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

.brand img {
  height: 42px;
  width: auto;
}

.nav-toggle {
  display: none;
  background: var(--white);
  border: 2px solid var(--orange);
  border-radius: 12px;
  color: var(--ink);
  font-size: 1.4rem;
  width: 46px;
  height: 42px;
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink-light);
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.main-nav a:hover {
  background: var(--cream-soft);
  color: var(--ink);
}

.main-nav a.active {
  background: var(--orange);
  color: #fff;
}

.lang-switcher {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.lang-switcher button {
  background: var(--white);
  border: 2px solid var(--cream-soft);
  color: var(--ink-light);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  letter-spacing: 1px;
  font-family: "Baloo 2", sans-serif;
  transition: all 0.2s ease;
}

.lang-switcher button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.lang-switcher button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* Hero */
.hero {
  padding: 64px 0 50px;
  text-align: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  text-align: left;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 2px solid var(--cream-soft);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--teal-dark);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

.hero h1 {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 18px;
  color: var(--ink);
  line-height: 1.05;
}

.hero h1 .accent {
  color: var(--orange);
}

.hero p.tagline {
  font-size: 1.2rem;
  color: var(--ink-light);
  max-width: 520px;
  margin: 0 0 32px;
}

.hero-grid .cta-row {
  justify-content: flex-start;
}

.cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 800;
  font-family: "Baloo 2", sans-serif;
  letter-spacing: 0.5px;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

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

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 24px rgba(245, 160, 74, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(245, 160, 74, 0.45);
}

.btn-secondary {
  background: var(--white);
  border: 2px solid var(--teal);
  color: var(--teal-dark);
}

.btn-secondary:hover {
  background: var(--teal);
  color: #fff;
}

/* Hero illustration */
.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}

.blob-shape {
  position: relative;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border-radius: 63% 37% 54% 46% / 51% 44% 56% 49%;
  box-shadow: var(--shadow-soft);
  animation: blobMorph 12s ease-in-out infinite;
}

.blob-shape img {
  width: 60%;
}

@keyframes blobMorph {
  0%, 100% { border-radius: 63% 37% 54% 46% / 51% 44% 56% 49%; }
  50% { border-radius: 42% 58% 67% 33% / 38% 56% 44% 62%; }
}

/* Sections */
section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  color: var(--ink);
}

.section-subtitle {
  text-align: center;
  color: var(--ink-light);
  max-width: 600px;
  margin: 0 auto 44px;
  font-size: 1.05rem;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.feature-card .icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 18px;
}

.feature-card:nth-child(6n+1) .icon { background: rgba(245, 160, 74, 0.18); }
.feature-card:nth-child(6n+2) .icon { background: rgba(47, 158, 151, 0.16); }
.feature-card:nth-child(6n+3) .icon { background: rgba(79, 201, 218, 0.2); }
.feature-card:nth-child(6n+4) .icon { background: rgba(168, 217, 140, 0.28); }
.feature-card:nth-child(6n+5) .icon { background: rgba(255, 209, 102, 0.3); }
.feature-card:nth-child(6n+6) .icon { background: rgba(255, 158, 181, 0.22); }

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  letter-spacing: 0.3px;
}

.feature-card p {
  margin: 0;
  color: var(--ink-light);
  font-size: 0.97rem;
}

/* Languages section */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}

.lang-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.lang-card .flag {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 14px;
}

.lang-card:nth-child(1) .flag { background: rgba(245, 160, 74, 0.18); }
.lang-card:nth-child(2) .flag { background: rgba(47, 158, 151, 0.16); }
.lang-card:nth-child(3) .flag { background: rgba(79, 201, 218, 0.2); }

.lang-card h3 {
  margin: 0 0 4px;
  letter-spacing: 1px;
  font-size: 1.15rem;
}

.lang-card p {
  margin: 0;
  color: var(--ink-light);
  font-size: 0.9rem;
}

/* Page banner (library / privacy headers) */
.page-banner {
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  padding: 64px 0 54px;
  border-radius: 0 0 40px 40px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.page-banner .section-title,
.page-banner .section-subtitle,
.page-banner .last-updated {
  color: #fff;
  position: relative;
  z-index: 1;
}

.page-banner .section-subtitle,
.page-banner .last-updated {
  color: rgba(255, 255, 255, 0.85);
}

.page-banner .section-subtitle {
  margin-bottom: 0;
}

.page-banner::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  top: -90px;
  right: -60px;
}

.page-banner::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  bottom: -80px;
  left: -40px;
}

/* Library / book grid */
.book-group-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 50px 0 22px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.book-group-title:first-of-type {
  margin-top: 0;
}

.book-group-title.most-popular::before {
  content: "⭐";
}

.book-group-title.other-stories::before {
  content: "📖";
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.book-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.book-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: var(--shadow-hover);
}

.book-card .cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--cream-soft);
}

.book-card .info {
  padding: 16px 18px 20px;
}

.book-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tag:nth-child(4n+1) { background: rgba(245, 160, 74, 0.16); color: var(--orange-dark); }
.tag:nth-child(4n+2) { background: rgba(47, 158, 151, 0.14); color: var(--teal-dark); }
.tag:nth-child(4n+3) { background: rgba(79, 201, 218, 0.18); color: #1f7c8c; }
.tag:nth-child(4n+4) { background: rgba(255, 158, 181, 0.2); color: #c2456a; }

/* Download page */
.store-badges {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 30px;
  text-decoration: none;
  color: var(--ink);
  min-width: 230px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-badge:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.store-badge .store-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--cream-soft);
  flex-shrink: 0;
}

.store-badge .store-text small {
  display: block;
  color: var(--ink-light);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.store-badge .store-text strong {
  font-size: 1.2rem;
  font-family: "Baloo 2", sans-serif;
}

.coming-soon-note {
  text-align: center;
  color: var(--ink-light);
  margin-top: 20px;
  font-size: 0.92rem;
  font-style: italic;
}

/* Privacy page */
.policy-content {
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-soft);
}

.policy-content h2 {
  font-size: 1.25rem;
  letter-spacing: 0.3px;
  color: var(--teal-dark);
  margin-top: 32px;
}

.policy-content h2:first-child {
  margin-top: 0;
}

.policy-content p,
.policy-content li {
  color: var(--ink-light);
}

.last-updated {
  text-align: center;
  color: var(--ink-light);
  font-size: 0.85rem;
  font-style: italic;
}

/* Keyboard focus */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}

.main-nav a:focus-visible,
.btn:focus-visible,
.lang-switcher button:focus-visible,
.nav-toggle:focus-visible,
.footer-links a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 999px;
}

.book-card:focus-visible,
.store-badge:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-lg);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 44px 0;
  margin-top: 60px;
  border-radius: 40px 40px 0 0;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--orange);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-grid .hero-content {
    order: 2;
  }

  .hero-grid .hero-art {
    order: 1;
  }

  .hero-grid .cta-row {
    justify-content: center;
  }

  .hero p.tagline {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 24px 22px;
    border-radius: 0 0 24px 24px;
    box-shadow: var(--shadow-soft);
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 16px;
  }

  .lang-switcher {
    margin-top: 10px;
    justify-content: center;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .hero p.tagline {
    font-size: 1.05rem;
  }

  .blob-shape {
    width: 240px;
    height: 240px;
  }

  .policy-content {
    padding: 28px 22px;
  }

  .site-footer {
    border-radius: 28px 28px 0 0;
  }
}
