:root {
  color-scheme: light;
  --bg: #fff0f6;
  --paper: rgba(255, 250, 253, 0.78);
  --panel: rgba(255, 255, 255, 0.82);
  --border: rgba(108, 72, 126, 0.12);
  --text: #27142b;
  --muted: #6f5678;
  --soft: #9a7dac;
  --accent: #ff8eb7;
  --accent-strong: #ff6b88;
  --accent-yellow: #ffd65c;
  --accent-mint: #77e5c4;
  --accent-sky: #87c8ff;
  --shadow: 0 24px 80px rgba(135, 72, 130, 0.14);
  --shadow-tight: 0 20px 40px rgba(92, 58, 118, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 170, 205, 0.9) 0, transparent 24%),
    radial-gradient(circle at 92% 10%, rgba(255, 224, 112, 0.75) 0, transparent 20%),
    radial-gradient(circle at 82% 72%, rgba(123, 230, 202, 0.45) 0, transparent 20%),
    linear-gradient(180deg, #fff8fb 0%, var(--bg) 52%, #f4efff 100%);
}

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

.page-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.78fr);
  gap: 1.25rem;
  align-items: stretch;
}

.hero-copy,
.hero-sidecar {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(1.5rem, 3vw, 3rem);
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 215, 92, 0.32) 0, transparent 21%),
    radial-gradient(circle at 12% 100%, rgba(134, 200, 255, 0.28) 0, transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 240, 247, 0.96));
}

.hero-sidecar {
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(255, 214, 92, 0.24) 0, transparent 22%),
    linear-gradient(180deg, rgba(128, 56, 119, 0.94), rgba(76, 39, 97, 0.94));
  color: #fff9ff;
}

.hero-copy::before,
.hero-copy::after,
.hero-sidecar::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-copy::before {
  width: 180px;
  height: 180px;
  right: -40px;
  top: -48px;
  background: rgba(255, 255, 255, 0.34);
}

.hero-copy::after {
  width: 110px;
  height: 110px;
  left: -24px;
  bottom: -30px;
  background: rgba(119, 229, 196, 0.25);
}

.hero-sidecar::before {
  width: 120px;
  height: 120px;
  right: -24px;
  bottom: -24px;
  background: rgba(255, 255, 255, 0.08);
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c64c95;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.7rem, 5vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.intro {
  max-width: 38rem;
  margin: 1.15rem 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.stat-pill {
  display: grid;
  gap: 0.2rem;
  min-width: 150px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(108, 72, 126, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.stat-pill:nth-child(1) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 232, 241, 0.98));
}

.stat-pill:nth-child(2) {
  background: linear-gradient(135deg, rgba(255, 252, 232, 0.96), rgba(255, 244, 203, 0.96));
}

.stat-pill:nth-child(3) {
  background: linear-gradient(135deg, rgba(236, 255, 251, 0.96), rgba(225, 247, 255, 0.96));
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  color: var(--soft);
  font-size: 0.92rem;
}

.control-panel {
  display: grid;
  gap: 1rem;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

.panel-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 230, 144, 0.95);
}

.panel-copy {
  margin: 0;
  max-width: 24rem;
  line-height: 1.7;
  color: rgba(255, 241, 233, 0.78);
}

.shuffle-button {
  border: 0;
  border-radius: 999px;
  width: fit-content;
  padding: 1rem 1.35rem;
  font: inherit;
  font-weight: 700;
  color: #421f4b;
  background: linear-gradient(135deg, #ffe973, #ff99c6 52%, #8fd1ff 100%);
  box-shadow: 0 16px 32px rgba(162, 104, 176, 0.28);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.shuffle-button:disabled {
  cursor: wait;
  opacity: 0.8;
}

.shuffle-button:hover,
.shuffle-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 34px rgba(162, 104, 176, 0.34);
}

.shuffle-button:focus-visible {
  outline: 3px solid rgba(255, 234, 132, 0.34);
  outline-offset: 3px;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.25rem;
  color: rgba(255, 241, 233, 0.78);
}

.status-text {
  margin: 0;
}

.loading-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: #ffd2c4;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.75s linear infinite;
  transition: opacity 140ms ease;
}

.loading-spinner.is-active {
  opacity: 1;
}

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

.gallery-section {
  margin-top: 1.35rem;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.1rem;
}

.section-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c64c95;
}

.section-heading h2 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

.cat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: #2b1633;
  box-shadow: var(--shadow-tight);
  isolation: isolate;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cat-card:nth-child(4n + 1) {
  transform: rotate(-1.2deg);
}

.cat-card:nth-child(4n + 2) {
  transform: rotate(1deg) translateY(8px);
}

.cat-card:nth-child(4n + 3) {
  transform: rotate(-0.8deg);
}

.cat-card:nth-child(4n + 4) {
  transform: rotate(1.1deg) translateY(10px);
}

.cat-card:hover {
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 28px 52px rgba(92, 58, 118, 0.22);
}

.image-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, #fff3da, #ffe0f0);
}

.cat-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 260ms ease;
}

.cat-card:hover .cat-image {
  transform: scale(1.04);
}

@media (max-width: 980px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

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

  .cat-card:nth-child(n) {
    transform: none;
  }

  h1 {
    max-width: 14ch;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .hero-copy,
  .hero-sidecar {
    border-radius: 24px;
  }

  .hero-copy {
    padding: 1.2rem;
  }

  .hero-sidecar {
    padding: 0.75rem;
  }

  .control-panel {
    padding: 1rem;
    border-radius: 24px;
  }

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

  .section-heading h2 {
    max-width: none;
  }

}

