:root {
  color-scheme: light;
  --bg-gradient: radial-gradient(circle at 20% 20%, #ffe5f3 0%, #f9dffb 35%, #d3efff 70%, #ffffff 100%);
  --accent-gradient: linear-gradient(135deg, #ff9de6 0%, #8ec5ff 100%);
  --accent: #ff8ddc;
  --accent-strong: #f05b9f;
  --text-primary: #3f2a4f;
  --text-secondary: rgba(63, 42, 79, 0.75);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --surface-border: rgba(255, 255, 255, 0.8);
  --shadow: 0 15px 40px rgba(171, 116, 255, 0.25);
  --filter-surface: rgba(255, 255, 255, 0.7);
  --filter-border: rgba(255, 255, 255, 0.9);
  --filter-shadow: 0 8px 18px rgba(255, 163, 220, 0.2);
  --card-surface: rgba(255, 255, 255, 0.92);
  --card-border: rgba(255, 255, 255, 0.9);
  --card-shadow: 0 14px 32px rgba(161, 123, 255, 0.18);
  --card-shadow-hover: 0 18px 38px rgba(161, 123, 255, 0.28);
  --image-frame-background: linear-gradient(
    135deg,
    rgba(255, 209, 245, 0.65),
    rgba(200, 230, 255, 0.6)
  );
  --image-frame-glow: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.8),
    transparent 65%
  );
  --tag-background: rgba(255, 255, 255, 0.8);
  --tag-border: rgba(255, 205, 235, 0.6);
  --note-surface: rgba(255, 255, 255, 0.7);
  --note-border: rgba(255, 255, 255, 0.85);
  --note-shadow: 0 12px 30px rgba(157, 136, 255, 0.2);
  --secondary-button-text: var(--accent-strong);
  --secondary-button-border: rgba(255, 255, 255, 0.9);
  --secondary-button-background: rgba(255, 255, 255, 0.6);
  --secondary-button-shadow: 0 10px 22px rgba(255, 150, 220, 0.18);
  --sparkle-opacity: 0.6;
  --pattern-opacity: 0.35;
  --border-radius-lg: 28px;
  --border-radius-md: 20px;
  --border-radius-sm: 16px;
  --font-heading: "Comfortaa", system-ui, sans-serif;
  --font-body: "Quicksand", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.7), transparent 60%);
  --bg-gradient: radial-gradient(circle at 20% 20%, #2d0038 0%, #251f3d 35%, #000a44 100%, #000000 100%);
  --accent-gradient: linear-gradient(135deg, #6c0086 0%, #001483 100%);
  --accent: #6c0086;
  --accent-strong: #ffbff2;
  --text-primary: #f6ebff;
  --text-secondary: rgba(246, 235, 255, 0.78);
  --surface: rgba(41, 31, 63, 0.78);
  --surface-strong: rgba(35, 26, 56, 0.88);
  --surface-border: rgba(143, 125, 204, 0.42);
  --shadow: 0 20px 45px rgba(8, 6, 20, 0.7);
  --filter-surface: rgba(61, 46, 87, 0.7);
  --filter-border: rgba(143, 125, 204, 0.45);
  --filter-shadow: 0 8px 20px rgba(32, 22, 68, 0.55);
  --card-surface: rgba(44, 32, 72, 0.9);
  --card-border: rgba(143, 125, 204, 0.42);
  --card-shadow: 0 18px 38px rgba(8, 6, 20, 0.65);
  --card-shadow-hover: 0 22px 44px rgba(8, 6, 20, 0.75);

  --image-frame-background: linear-gradient(
    135deg,
    rgba(115, 78, 162, 0.7),
    rgba(88, 108, 182, 0.6)
  );
  --image-frame-glow: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.22),
    transparent 70%
  );
  --tag-background: rgba(86, 66, 128, 0.75);
  --tag-border: rgba(159, 135, 214, 0.5);
  --note-surface: rgba(44, 32, 72, 0.88);
  --note-border: rgba(143, 125, 204, 0.45);
  --note-shadow: 0 12px 28px rgba(5, 4, 16, 0.65);
  --secondary-button-text: #ffe7ff;
  --secondary-button-border: rgba(143, 125, 204, 0.55);
  --secondary-button-background: rgba(68, 50, 107, 0.75);
  --secondary-button-shadow: 0 14px 26px rgba(10, 6, 32, 0.55);
  --sparkle-opacity: 0.42;
  --pattern-opacity: 0.2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

html,
body {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.3);
  scrollbar-gutter: stable;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 12px;
}

body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--surface-border);
  margin-block: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: var(--accent-gradient);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 8px 18px rgba(161, 123, 255, 0.35);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
  box-shadow: 0 10px 22px rgba(161, 123, 255, 0.45);
}

body::-webkit-scrollbar-thumb:active,
html::-webkit-scrollbar-thumb:active {
  box-shadow: 0 6px 14px rgba(161, 123, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] html,
:root[data-theme="dark"] body {
  scrollbar-color: var(--accent) rgba(44, 32, 72, 0.7);
}

:root[data-theme="dark"] body::-webkit-scrollbar-track,
:root[data-theme="dark"] html::-webkit-scrollbar-track {
  background: linear-gradient(
    180deg,
    rgba(61, 46, 87, 0.8) 0%,
    rgba(35, 26, 56, 0.82) 100%
  );
  border-color: rgba(143, 125, 204, 0.4);
  box-shadow: inset 0 1px 4px rgba(8, 6, 20, 0.45);
}

:root[data-theme="dark"] body::-webkit-scrollbar-thumb,
:root[data-theme="dark"] html::-webkit-scrollbar-thumb {
  box-shadow: 0 12px 28px rgba(8, 6, 20, 0.65);
}

body::-webkit-scrollbar-corner,
html::-webkit-scrollbar-corner {
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 120 120'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f7bbff' fill-opacity='.28'%3E%3Cpath d='M50 60c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10zm30-30c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10zM40 20c0-5.523-4.477-10-10-10S20 14.477 20 20s4.477 10 10 10 10-4.477 10-10z'/%3E%3C/g%3E%3C/svg%3E") repeat;
  opacity: var(--pattern-opacity);
  pointer-events: none;
  z-index: -2;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.sparkle-layer {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.7), transparent 60%);
  mix-blend-mode: screen;
  opacity: var(--sparkle-opacity);
  pointer-events: none;
  animation: twinkle 8s ease-in-out infinite;
  z-index: -1;
  transition: opacity 0.4s ease;
}

:root[data-theme="dark"] body::before {
  filter: hue-rotate(-12deg) saturate(0.85) brightness(0.6);
}

:root[data-theme="dark"] .sparkle-layer {
  mix-blend-mode: screen;
}

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--secondary-button-border);
  background: var(--secondary-button-background);
  color: var(--secondary-button-text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--secondary-button-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease,
    color 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(14px);
  z-index: 10;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .theme-toggle:hover {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.theme-toggle__icon {
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .theme-toggle {
    top: 1rem;
    right: 1rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 8vw, 6rem) 4rem;
  position: relative;
}

.hero__content {
  background: var(--surface);
  padding: clamp(2rem, 5vw, 3rem);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border: 2px solid var(--surface-border);
  position: relative;
  overflow: hidden;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.hero__content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.7), transparent 0%);
  pointer-events: none;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary-button-text);
  background: var(--secondary-button-background);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  font-weight: 700;
  border: 1px solid var(--secondary-button-border);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero__subtitle {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero__cta {
  font-family: var(--font-heading);
  font-size: 1rem;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-image: var(--accent-gradient);
  color: white;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 25px rgba(255, 126, 187, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

:root[data-theme="dark"] .hero__cta {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.hero__cta:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 32px rgba(255, 126, 187, 0.45);
}

.hero__cta--secondary {
  background-image: none;
  background: var(--secondary-button-background);
  color: var(--secondary-button-text);
  border: 2px solid var(--secondary-button-border);
  box-shadow: var(--secondary-button-shadow);
}

.hero__cta--secondary:hover {
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .hero__cta--secondary:hover {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5);
}

.hero__mascot {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.mascot__orb {
  width: clamp(200px, 30vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(255, 173, 235, 0.7));
  box-shadow: 0 20px 40px rgba(236, 164, 255, 0.45);
  animation: float 6s ease-in-out infinite;
}

:root[data-theme="dark"] .mascot__orb {
  width: clamp(200px, 30vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(126, 42, 175, 0.95), rgba(15, 1, 13, 0.7));
  box-shadow: 0 20px 40px rgba(4, 0, 41, 0.45);
  animation: float 6s ease-in-out infinite;
}

.mascot__ring {
  position: absolute;
  width: clamp(240px, 35vw, 380px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  animation: spin 14s linear infinite;
}

:root[data-theme="dark"] .mascot__ring {
  position: absolute;
  width: clamp(240px, 35vw, 380px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed rgba(126, 42, 175, 0.95);
  animation: spin 14s linear infinite;
}

.mascot__sparkle {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0.8;
}

:root[data-theme="dark"] .mascot__sparkle {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(126, 42, 175, 0.95) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0.8;
}

.sparkle--one {
  top: 10%;
  left: 20%;
  animation: blink 3.2s ease-in-out infinite;
}

.sparkle--two {
  bottom: 15%;
  right: 18%;
  animation: blink 4.1s ease-in-out infinite;
}

.sparkle--three {
  top: 40%;
  right: 5%;
  animation: blink 5s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.6);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

main {
  padding-inline: clamp(1.5rem, 8vw, 6rem);
}

.collection {
  margin-top: 2rem;
  background: var(--surface-strong);
  border-radius: var(--border-radius-lg);
  padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  border: 2px solid var(--surface-border);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease,
    color 0.4s ease;
}

.collection__header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 0.8rem;
}

.collection__header p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.collection__filters {
  margin: 2rem 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.filter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: var(--filter-surface);
  border: 2px solid var(--filter-border);
  box-shadow: var(--filter-shadow);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease,
    color 0.3s ease;
}

.filter__label {
  font-weight: 600;
  color: var(--accent-strong);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.filter select {
  border: none;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
  padding: 0.4rem 0.2rem;
  cursor: pointer;
}

.filter select:focus {
  outline: none;
}

.figure-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0;
  padding: 0;
}

@media (max-width: 1200px) {
  .figure-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 600px) {
  .figure-grid {
    grid-template-columns: 1fr;
  }
}

.figure-grid__message {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--card-surface), transparent 30%);
  border-radius: var(--border-radius-md);
  border: 2px dashed color-mix(in srgb, var(--card-border), transparent 15%);
}

.figure-card {
  position: relative;
  height: 100%;
  animation: pop-in 0.6s ease both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.figure-card article {
  display: grid;
  gap: 1rem;
  background: var(--card-surface);
  border-radius: var(--border-radius-md);
  padding: 1.4rem;
  height: 100%;
  box-shadow: var(--card-shadow);
  border: 2px solid var(--card-border);
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: transform 0.45s ease, box-shadow 0.3s ease, opacity 0.45s ease,
    background 0.4s ease, border-color 0.4s ease;
}

.figure-card article.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.figure-card article:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--card-shadow-hover);
}

.figure-card__image-frame {
  margin: 0;
  position: relative;
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  background: var(--image-frame-background);
  overflow: hidden;
}

.figure-card__image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--image-frame-glow);
  mix-blend-mode: screen;
  pointer-events: none;
}

.figure-card__image {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(134, 117, 180, 0.35));
  transition: transform 0.4s ease;
}

.figure-card article:hover .figure-card__image {
  transform: translateY(-6px) scale(1.02);
}

.figure-card__caption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-secondary);
}

.figure-card__info h3 {
  font-family: var(--font-heading);
  margin: 0;
  font-size: 1.4rem;
}

.figure-card__series {
  margin: 0.2rem 0 0.8rem;
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.figure-card__details {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.figure-card__details div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.figure-card__details dt {
  font-weight: 600;
  color: var(--text-secondary);
}

.figure-card__details dd {
  margin: 0;
}

.figure-card__description {
  margin: 0.8rem 0 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.92rem;
}

.figure-card__actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.figure-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.figure-card__link::before {
  content: "🔗";
  font-size: 0.9rem;
}

.figure-card__link:hover,
.figure-card__link:focus-visible {
  background: var(--accent-strong);
  color: var(--surface-primary);
  transform: translateY(-1px);
  outline: none;
}

.figure-card__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.figure-card__tags li {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--tag-background);
  border: 1px solid var(--tag-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.notes {
  margin: clamp(3rem, 6vw, 5rem) auto;
  background: var(--note-surface);
  padding: clamp(2rem, 5vw, 3rem);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--note-shadow);
  border: 2px solid var(--note-border);
  max-width: 900px;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease,
    color 0.4s ease;
}

.notes h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-top: 0;
}

.notes ol {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.notes code {
  background: var(--secondary-button-background);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  color: var(--secondary-button-text);
}

.site-footer {
  text-align: center;
  padding: 3rem 1rem 4rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .hero {
    padding-top: 2rem;
  }

  .hero__content {
    padding: 1.8rem;
  }

  .hero__title {
    font-size: 2.4rem;
  }

  .collection,
  .notes {
    padding: 1.6rem;
  }
}
