@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Fredoka:wght@500;600;700&display=swap");

:root {
  --ink: #061a44;
  --muted: #637087;
  --paper: rgba(255, 255, 255, 0.82);
  --line: rgba(6, 26, 68, 0.12);
  --teal: #08bdb7;
  --coral: #f31668;
  --purple: #061a44;
  --gold: #f5b916;
  --mint: #2fbd83;
  --sky: #218ad8;
  --shadow: 0 18px 50px rgba(6, 26, 68, 0.12);
  --gradient: linear-gradient(90deg, var(--teal), var(--coral) 58%, var(--purple));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(8, 189, 183, 0.16), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(243, 22, 104, 0.12), transparent 30%),
    radial-gradient(circle at 45% 92%, rgba(6, 26, 68, 0.08), transparent 36%),
    #fbfdff;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.floating-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.55;
  animation: float 7s ease-in-out infinite;
}

.shape-coral {
  width: 280px;
  height: 280px;
  left: -95px;
  top: -80px;
  background: rgba(243, 22, 104, 0.3);
}

.shape-purple {
  width: 240px;
  height: 240px;
  right: -80px;
  top: 110px;
  background: rgba(6, 26, 68, 0.22);
  animation-delay: 1.7s;
}

.shape-teal {
  width: 320px;
  height: 320px;
  left: -130px;
  bottom: 25px;
  background: rgba(8, 189, 183, 0.22);
  animation-duration: 8s;
}

.shape-gold {
  width: 210px;
  height: 210px;
  right: 9%;
  bottom: 100px;
  background: rgba(245, 185, 22, 0.22);
  animation-delay: 3s;
}

.shape-mint {
  width: 86px;
  height: 86px;
  left: 28%;
  top: 34%;
  background: rgba(47, 189, 131, 0.32);
}

.shape-sky {
  width: 72px;
  height: 72px;
  right: 30%;
  top: 66%;
  background: rgba(33, 138, 216, 0.3);
  animation-delay: 2.2s;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  margin-bottom: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: contain;
}

.brand span,
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-button,
.home-link,
.primary-button,
.back-button {
  min-height: 42px;
  border: 1px solid rgba(8, 189, 183, 0.32);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 16px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-button:hover,
.home-link:hover,
.primary-button:hover,
.back-button:hover {
  transform: translateY(-1px);
  border-color: rgba(243, 22, 104, 0.36);
  background: rgba(8, 189, 183, 0.08);
}

.hero {
  text-align: center;
  margin-bottom: 54px;
  animation: slide-up 500ms ease both;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  animation: pulse 1.6s ease-in-out infinite;
}

h1,
h2,
h3 {
  font-family: "Fredoka", system-ui, sans-serif;
  line-height: 1.04;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700;
}

.hero p,
.page-intro {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 56px;
  margin-top: 28px;
}

.stat strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 2.15rem;
  color: var(--teal);
}

.stat:nth-child(2) strong {
  color: var(--coral);
}

.stat:nth-child(3) strong {
  color: var(--purple);
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.section-title {
  margin: 0 0 28px;
  text-align: center;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.grid {
  display: grid;
  gap: 18px;
}

.category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.class-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 820px;
  margin: 0 auto;
}

.book-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

button.card {
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(243, 22, 104, 0.28);
  box-shadow: 0 24px 54px rgba(6, 26, 68, 0.16);
}

.category-card {
  padding: 24px;
}

.icon-box {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 8px;
  font-size: 1.45rem;
  font-weight: 900;
}

.tone-coral .icon-box,
.icon-box.tone-coral,
.tone-coral .class-number {
  color: var(--coral);
  background: rgba(243, 22, 104, 0.12);
}

.tone-teal .icon-box,
.icon-box.tone-teal,
.tone-teal .class-number {
  color: var(--teal);
  background: rgba(8, 189, 183, 0.12);
}

.tone-purple .icon-box,
.icon-box.tone-purple,
.tone-purple .class-number {
  color: var(--purple);
  background: rgba(6, 26, 68, 0.08);
}

.tone-gold .icon-box,
.icon-box.tone-gold {
  color: #a06a00;
  background: rgba(245, 185, 22, 0.16);
}

.tone-sky .icon-box,
.icon-box.tone-sky {
  color: var(--sky);
  background: rgba(33, 138, 216, 0.14);
}

.tone-mint .icon-box,
.icon-box.tone-mint {
  color: var(--mint);
  background: rgba(47, 189, 131, 0.14);
}

.category-card h3,
.book-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.category-card p,
.book-card p,
.note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer-note {
  margin-top: 44px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.page-head {
  margin-bottom: 36px;
  text-align: center;
  animation: slide-up 500ms ease both;
}

.page-head h1 {
  font-size: clamp(2.3rem, 5vw, 3.8rem);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.class-card {
  min-height: 132px;
  padding: 20px;
  text-align: center;
}

.class-number {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 8px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 2.15rem;
  font-weight: 700;
}

.book-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 126px;
  padding: 18px;
}

.book-card .icon-box {
  flex: 0 0 auto;
  margin: 0;
}

.external {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.group {
  margin-top: 36px;
}

.group:first-child {
  margin-top: 0;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.55rem;
}

.note {
  max-width: 700px;
  margin: 32px auto 0;
  padding: 20px;
  text-align: center;
}

.empty {
  padding: 28px;
  text-align: center;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .category-grid,
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .class-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .category-grid,
  .book-grid {
    grid-template-columns: 1fr;
  }

  .class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-card {
    min-height: 112px;
  }
}
