/* =========================================================================
   Universo Livraria com Amor — camada cinematografica.
   Background (nebulosas, estrelas, particulas, livros flutuantes),
   cena da mascote, banner, sidebar, cabecalho e cards.
   Carregado como ultimo stylesheet de todas as paginas.
   ========================================================================= */

:root {
  --cosmos-1: #050713;
  --cosmos-2: #080b20;
  --cosmos-3: #11133a;
  --cosmos-blue: #5b21b6;
  --cosmos-electric: #8b5cf6;
  --cosmos-violet: #6e4bff;
  --cosmos-purple: #a66cff;
  --cosmos-cyan: #ffd166;
  --mx: 0;
  --my: 0;
}

/* ------------------------------ camada base ------------------------------ */

.cosmos {
  position: fixed;
  inset: -5%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
}

.cosmos__base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 44% at 16% 6%, rgba(91, 33, 182, 0.4), transparent 62%),
    radial-gradient(52% 40% at 84% 10%, rgba(110, 75, 255, 0.32), transparent 64%),
    radial-gradient(56% 46% at 72% 82%, rgba(255, 209, 102, 0.14), transparent 66%),
    radial-gradient(48% 42% at 6% 88%, rgba(123, 77, 255, 0.24), transparent 62%),
    linear-gradient(180deg, var(--cosmos-1) 0%, var(--cosmos-2) 46%, #06081a 100%);
}

[data-theme='light'] .cosmos__base {
  background:
    radial-gradient(58% 44% at 16% 6%, rgba(167, 139, 250, 0.3), transparent 62%),
    radial-gradient(52% 40% at 84% 10%, rgba(178, 142, 255, 0.26), transparent 64%),
    radial-gradient(56% 46% at 72% 82%, rgba(255, 209, 102, 0.2), transparent 66%),
    linear-gradient(180deg, #eef2ff 0%, #f8f5ff 55%, #eef1ff 100%);
}

/* -------------------------------- nebulosas ------------------------------ */

.cosmos__neb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
  animation: nebulaDrift var(--dur, 64s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  translate: calc(var(--mx) * var(--depth, 1) * 14px) calc(var(--my) * var(--depth, 1) * 14px);
}

[data-theme='light'] .cosmos__neb {
  mix-blend-mode: multiply;
  opacity: 0.3;
  filter: blur(80px);
}

.cosmos__neb--1 {
  --depth: 0.35;
  --dur: 72s;
  top: -14%;
  left: -10%;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle at 40% 40%, rgba(110, 75, 255, 0.75), rgba(91, 33, 182, 0.28) 55%, transparent 72%);
}

.cosmos__neb--2 {
  --depth: 0.5;
  --dur: 86s;
  --delay: -12s;
  top: -18%;
  left: 34%;
  width: 40vw;
  height: 34vw;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.6), rgba(166, 108, 255, 0.24) 58%, transparent 74%);
}

.cosmos__neb--3 {
  --depth: 0.65;
  --dur: 78s;
  --delay: -30s;
  top: 4%;
  right: -14%;
  width: 44vw;
  height: 48vw;
  background: radial-gradient(circle at 55% 45%, rgba(166, 108, 255, 0.62), rgba(255, 209, 102, 0.22) 56%, transparent 74%);
}

.cosmos__neb--4 {
  --depth: 0.8;
  --dur: 92s;
  --delay: -46s;
  bottom: -20%;
  right: 8%;
  width: 42vw;
  height: 40vw;
  background: radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.4), rgba(139, 92, 246, 0.24) 55%, transparent 72%);
}

.cosmos__neb--5 {
  --depth: 0.45;
  --dur: 68s;
  --delay: -22s;
  bottom: -16%;
  left: -6%;
  width: 40vw;
  height: 38vw;
  background: radial-gradient(circle at 50% 50%, rgba(110, 75, 255, 0.52), rgba(91, 33, 182, 0.24) 55%, transparent 72%);
}

.cosmos__neb--6 {
  --depth: 0.9;
  --dur: 58s;
  --delay: -8s;
  top: 38%;
  left: 42%;
  width: 30vw;
  height: 26vw;
  opacity: 0.34;
  background: radial-gradient(circle at 50% 50%, rgba(166, 108, 255, 0.55), rgba(255, 209, 102, 0.2) 60%, transparent 75%);
}

@keyframes nebulaDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate3d(4vw, -3vh, 0) scale(1.12) rotate(6deg);
  }
  100% {
    transform: translate3d(-3vw, 4vh, 0) scale(1.05) rotate(-5deg);
  }
}

/* canvas de estrelas + particulas */
.cosmos__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ------------------------------ decoracoes ------------------------------ */

.cosmos__deco {
  position: absolute;
  inset: 0;
}

.cosmos__deco-item {
  position: absolute;
  top: var(--y);
  left: var(--x);
  translate: calc(var(--mx) * var(--depth) * 26px) calc(var(--my) * var(--depth) * 26px);
  will-change: translate;
}

.deco {
  display: block;
  transform: rotate(var(--rot, 0deg));
  animation: decoFloat var(--dur, 14s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: var(--alpha, 0.85);
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.35));
}

.deco--book {
  animation-name: decoFloat, decoTilt;
  animation-duration: var(--dur, 14s), calc(var(--dur, 14s) * 1.6);
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
}

.deco--glyph {
  color: var(--glyph-color, #ffe3a3);
  font-size: var(--size, 18px);
  line-height: 1;
  text-shadow: 0 0 14px currentColor;
  animation-name: decoTwinkle;
}

.deco--orb {
  width: var(--size, 8px);
  height: var(--size, 8px);
  border-radius: 50%;
  background: var(--glyph-color, #ffd166);
  box-shadow: 0 0 16px 3px currentColor;
  color: var(--glyph-color, #ffd166);
  animation-name: decoTwinkle;
}

.deco--page {
  animation-name: decoFloat, decoSpin;
  animation-duration: var(--dur, 14s), calc(var(--dur, 14s) * 2.1);
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
}

@keyframes decoFloat {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-22px) rotate(calc(var(--rot, 0deg) + 4deg));
  }
}

@keyframes decoTilt {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.06;
  }
}

@keyframes decoSpin {
  0%,
  100% {
    rotate: -6deg;
  }
  50% {
    rotate: 8deg;
  }
}

@keyframes decoTwinkle {
  0%,
  100% {
    opacity: 0.25;
    scale: 0.86;
  }
  50% {
    opacity: 1;
    scale: 1.14;
  }
}

/* vinheta de profundidade */
.cosmos__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(3, 4, 14, 0.55) 100%),
    linear-gradient(180deg, rgba(3, 4, 14, 0.4), transparent 18%, transparent 78%, rgba(3, 4, 14, 0.5));
}

[data-theme='light'] .cosmos__vignette {
  background: radial-gradient(120% 90% at 50% 45%, transparent 62%, rgba(124, 104, 200, 0.14) 100%);
}

/* ============ cabecalho da biblioteca: nome + pesquisa + mascote ========= */

.lib-head--cosmic {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(210px, 24vw, 310px);
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding-top: var(--space-6);
}

.lib-head--cosmic .lib-head__text {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.lib-head__name {
  background: linear-gradient(100deg, #ffffff 8%, #ffd166 46%, #b28bff 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 209, 102, 0.35));
}

.lib-head--cosmic .lib-head__title {
  text-shadow: 0 18px 50px rgba(3, 6, 26, 0.6);
}

.lib-head--cosmic .lib-search {
  margin-top: var(--space-4);
  max-width: 520px;
  background: rgba(9, 12, 32, 0.72);
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 14px 34px rgba(3, 6, 26, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lib-head--cosmic .lib-search:focus-within {
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.18), 0 16px 40px rgba(3, 6, 26, 0.5);
}

/* -------------------------------- mascote -------------------------------- */

.mascot-scene {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 310px;
  pointer-events: none;
  z-index: 3;
}

.mascot-scene__halo {
  position: absolute;
  inset: -12% -18% -8%;
  background: radial-gradient(52% 48% at 50% 46%, rgba(139, 92, 246, 0.5), rgba(138, 92, 255, 0.26) 55%, transparent 74%);
  filter: blur(6px);
  animation: haloPulse 7.5s ease-in-out infinite;
  pointer-events: none;
}

.mascot-scene__figure {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  animation: mascotFloat 7.5s ease-in-out infinite, mascotBreathe 5.4s ease-in-out infinite;
  transform-origin: 50% 82%;
  filter: drop-shadow(0 26px 46px rgba(3, 6, 26, 0.6));
  transition: translate 320ms ease;
  translate: calc(var(--scene-x, 0) * 10px) calc(var(--scene-y, 0) * 6px);
}

@keyframes mascotFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

@keyframes mascotBreathe {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.014;
  }
}

.mascot-scene__bubble {
  position: absolute;
  top: 1%;
  left: -34%;
  z-index: 3;
  width: max-content;
  max-width: 235px;
  padding: 11px 15px;
  border-radius: 16px 16px 5px 16px;
  background: rgba(10, 13, 36, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 36px rgba(3, 6, 26, 0.55), 0 0 26px rgba(255, 209, 102, 0.18);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  pointer-events: none;
  transition: opacity 400ms ease, transform 400ms ease;
  animation: bubbleBob 6s ease-in-out infinite;
}

.mascot-scene__bubble::after {
  content: '';
  position: absolute;
  right: 18px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: rgba(10, 13, 36, 0.9);
  border-right: 1px solid rgba(167, 139, 250, 0.4);
  border-bottom: 1px solid rgba(167, 139, 250, 0.4);
  transform: rotate(45deg);
}

.mascot-scene__bubble.is-swap {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

@keyframes bubbleBob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -7px;
  }
}

.mascot-scene__book {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  animation: mascotBookFloat var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  filter: drop-shadow(0 8px 18px rgba(3, 6, 26, 0.55));
}

.mascot-scene__book--1 {
  top: 12%;
  left: -16%;
  --dur: 8.5s;
}

.mascot-scene__book--2 {
  top: 46%;
  right: -14%;
  --dur: 10.5s;
  --delay: -2.5s;
}

.mascot-scene__book--3 {
  bottom: 6%;
  left: -10%;
  --dur: 9.5s;
  --delay: -4.5s;
}

@keyframes mascotBookFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(-18px) rotate(6deg);
  }
}

.mascot-scene__spark {
  position: absolute;
  z-index: 2;
  color: #ffe3a3;
  font-size: var(--size, 16px);
  text-shadow: 0 0 14px currentColor;
  pointer-events: none;
  animation: sparkBlink var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.mascot-scene__spark--1 {
  top: 6%;
  right: 12%;
  --dur: 3.6s;
}

.mascot-scene__spark--2 {
  top: 34%;
  left: -6%;
  --dur: 4.8s;
  --delay: -1.4s;
  color: #c9a6ff;
}

.mascot-scene__spark--3 {
  bottom: 22%;
  right: -4%;
  --dur: 4.2s;
  --delay: -2.6s;
}

@keyframes sparkBlink {
  0%,
  100% {
    opacity: 0.2;
    scale: 0.7;
  }
  50% {
    opacity: 1;
    scale: 1.2;
  }
}

/* ============================ banner cinematografico ===================== */

.banner {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(167, 139, 250, 0.16), 0 30px 80px rgba(3, 6, 26, 0.55);
}

.banner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.55), rgba(138, 92, 255, 0.5), rgba(255, 209, 102, 0.2) 70%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
  z-index: 4;
}

.banner__cosmos {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.banner__cosmos-neb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  mix-blend-mode: screen;
  animation: nebulaDrift var(--dur, 48s) ease-in-out infinite alternate;
}

.banner__cosmos-neb--1 {
  top: -34%;
  right: -8%;
  width: 46%;
  height: 92%;
  background: radial-gradient(circle, rgba(166, 108, 255, 0.55), transparent 70%);
}

.banner__cosmos-neb--2 {
  bottom: -46%;
  left: 24%;
  width: 52%;
  height: 96%;
  --dur: 60s;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.36), transparent 70%);
}

.banner__cosmos-dust {
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 24%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1.4px 1.4px at 34% 68%, rgba(255, 227, 163, 0.85), transparent 60%),
    radial-gradient(1.2px 1.2px at 58% 18%, rgba(255, 255, 255, 0.75), transparent 60%),
    radial-gradient(1.8px 1.8px at 76% 52%, rgba(201, 166, 255, 0.85), transparent 60%),
    radial-gradient(1.3px 1.3px at 88% 82%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 46% 90%, rgba(255, 227, 163, 0.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 66% 34%, rgba(255, 255, 255, 0.65), transparent 60%),
    radial-gradient(1.7px 1.7px at 22% 46%, rgba(166, 134, 255, 0.8), transparent 60%);
  animation: dustTwinkle 7s ease-in-out infinite alternate;
}

@keyframes dustTwinkle {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.banner__cosmos-book {
  position: absolute;
  right: 7%;
  opacity: 0.9;
  animation: mascotBookFloat var(--dur, 11s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  filter: drop-shadow(0 10px 22px rgba(3, 6, 26, 0.5));
}

.banner__cosmos-book--1 {
  top: 16%;
  --dur: 10s;
}

.banner__cosmos-book--2 {
  bottom: 20%;
  right: 16%;
  --dur: 12s;
  --delay: -3s;
}

.banner__cosmos-spark {
  position: absolute;
  right: 14%;
  top: 46%;
  color: #ffe3a3;
  font-size: 18px;
  text-shadow: 0 0 16px currentColor;
  animation: sparkBlink 4.4s ease-in-out infinite;
}

.banner__cosmos-spark--2 {
  right: 4%;
  top: 66%;
  color: #c9a6ff;
  font-size: 14px;
  animation-delay: -2.2s;
}

/* ================================ sidebar ================================= */

body.has-sidebar .sidebar {
  background: linear-gradient(180deg, rgba(9, 12, 34, 0.74), rgba(5, 7, 22, 0.86));
  border-right-color: rgba(167, 139, 250, 0.22);
  box-shadow:
    inset 1px 0 0 rgba(255, 209, 102, 0.08),
    14px 0 44px rgba(2, 4, 18, 0.5);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

[data-theme='light'] body.has-sidebar .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 244, 255, 0.92));
  box-shadow: inset 1px 0 0 rgba(124, 58, 237, 0.12), 14px 0 40px rgba(76, 29, 149, 0.1);
}

body.has-sidebar .sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 210px;
  background:
    radial-gradient(90% 100% at 20% 0%, rgba(139, 92, 246, 0.26), transparent 70%),
    radial-gradient(70% 90% at 90% 10%, rgba(255, 209, 102, 0.14), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

body.has-sidebar .sidebar__scroll {
  position: relative;
  z-index: 1;
}

body.has-sidebar .sidebar__link {
  border-color: rgba(167, 139, 250, 0.1);
  background: rgba(167, 139, 250, 0.05);
}

body.has-sidebar .sidebar__link:hover {
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 8px 22px rgba(3, 6, 26, 0.35);
  color: #fff;
}

body.has-sidebar .sidebar__link.is-active {
  background: linear-gradient(115deg, #5b21b6 0%, #8b5cf6 45%, #6e4bff 100%);
  border-color: transparent;
  color: #fff;
  box-shadow:
    0 12px 28px rgba(124, 58, 237, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset -2px 0 0 rgba(255, 209, 102, 0.85);
}

body.has-sidebar .sidebar__link.is-active .sidebar__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.55);
}

body.has-sidebar .sidebar__group-label {
  color: rgba(255, 227, 163, 0.75);
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.35);
}

body.has-sidebar .sidebar__card {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 18px 40px rgba(3, 6, 26, 0.5), 0 0 30px rgba(139, 92, 246, 0.22);
  background:
    radial-gradient(90% 100% at 0% 0%, rgba(139, 92, 246, 0.38), transparent 70%),
    linear-gradient(160deg, rgba(49, 20, 90, 0.92), rgba(10, 14, 38, 0.94));
}

[data-theme='light'] body.has-sidebar .sidebar__group-label {
  color: var(--text-muted);
  text-shadow: none;
}

[data-theme='light'] body.has-sidebar .sidebar__card {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  background:
    radial-gradient(90% 100% at 0% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    linear-gradient(160deg, #ffffff, #eef2ff);
}

/* ================================= header ================================= */

body .site-header {
  background: linear-gradient(180deg, rgba(5, 7, 20, 0.82), rgba(8, 11, 32, 0.66));
}

body .site-header.is-scrolled {
  background: linear-gradient(180deg, rgba(5, 7, 20, 0.94), rgba(8, 11, 32, 0.9));
}

.header__search.is-open .header__search-input {
  background: rgba(9, 12, 32, 0.94);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.16), 0 18px 40px rgba(3, 6, 26, 0.55);
}

.header__search.is-open .header__search-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.3), 0 18px 40px rgba(3, 6, 26, 0.55);
}

.nav__link.is-active {
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.4), 0 0 22px rgba(255, 209, 102, 0.28);
}

/* ============================= cards e secoes ============================ */

.book-card:hover {
  box-shadow:
    0 30px 60px rgba(3, 6, 26, 0.65),
    0 0 0 1px rgba(255, 209, 102, 0.28),
    0 0 44px rgba(110, 75, 255, 0.28);
}

.book-card:hover .book-card__media {
  box-shadow: inset 0 0 44px rgba(255, 209, 102, 0.22);
}

.book-card__media::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 50% at 50% 100%, rgba(110, 75, 255, 0.35), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  z-index: 1;
}

.book-card:hover .book-card__media::before {
  opacity: 1;
}

.continue-card,
.launch-card,
.genre-card,
.author-card,
.rank-row {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.continue-card:hover,
.launch-card:hover,
.genre-card:hover,
.author-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 48px rgba(3, 6, 26, 0.55), 0 0 34px rgba(139, 92, 246, 0.22);
  border-color: rgba(167, 139, 250, 0.42);
}

.panel,
.lib-notice {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lib-section__title {
  background: linear-gradient(100deg, #ffffff 20%, #d6c9ff 70%, #ffe3a3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme='light'] .lib-section__title {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text);
}

/* =============================== responsivo ============================== */

@media (max-width: 1120px) {
  .cosmos__deco-item:nth-child(n + 9) {
    display: none;
  }

  .lib-head--cosmic {
    grid-template-columns: minmax(0, 1fr) clamp(190px, 26vw, 250px);
  }
}

@media (max-width: 900px) {
  .lib-head--cosmic {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: var(--space-5);
  }

  .lib-head--cosmic .lib-head__text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lib-head--cosmic .lib-head__subtitle {
    max-width: 60ch;
  }

  .lib-head--cosmic .lib-search {
    width: min(520px, 100%);
  }

  .mascot-scene {
    justify-self: center;
    max-width: 250px;
    order: -1;
  }

  .mascot-scene__bubble {
    left: auto;
    right: -18%;
    top: -4%;
    max-width: 210px;
  }

  .cosmos__neb {
    filter: blur(56px);
    opacity: 0.45;
  }
}

@media (max-width: 640px) {
  .cosmos__deco-item:nth-child(n + 5) {
    display: none;
  }

  .cosmos__neb--6 {
    display: none;
  }

  .lib-head--cosmic {
    padding-top: var(--space-5);
  }

  .mascot-scene {
    max-width: 190px;
  }

  .mascot-scene__book--2,
  .mascot-scene__spark--3 {
    display: none;
  }

  .mascot-scene__bubble {
    right: -8%;
    max-width: 180px;
    font-size: 0.82rem;
    padding: 9px 12px;
  }

  .banner__cosmos-book,
  .banner__cosmos-spark {
    display: none;
  }
}

/* ============================= movimento reduzido ======================== */

@media (prefers-reduced-motion: reduce) {
  .cosmos__neb,
  .deco,
  .mascot-scene__figure,
  .mascot-scene__halo,
  .mascot-scene__bubble,
  .mascot-scene__book,
  .mascot-scene__spark,
  .banner__cosmos-neb,
  .banner__cosmos-dust,
  .banner__cosmos-book,
  .banner__cosmos-spark {
    animation: none !important;
  }

  .cosmos__deco-item,
  .mascot-scene__figure {
    translate: none;
  }
}
