:root {
  --ink: #151515;
  --muted: #5f646d;
  --paper: #fbfaf7;
  --line: #d9d3c8;
  --panel: #ffffff;
  --orange: #f97316;
  --green: #16a34a;
  --blue: #2563eb;
  --pink: #db2777;
  --shadow: 0 24px 70px rgba(21, 21, 21, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.08), transparent 26%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.07), transparent 30%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(21, 21, 21, 0.09);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(16px);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.site-header:hover {
  border-color: rgba(21, 21, 21, 0.15);
  box-shadow: 0 10px 30px rgba(21, 21, 21, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 18px;
  height: 18px;
  background:
    linear-gradient(90deg, var(--orange) 50%, var(--blue) 0) top / 100% 50% no-repeat,
    linear-gradient(90deg, var(--green) 50%, var(--pink) 0) bottom / 100% 50% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(21, 21, 21, 0.2);
  transition: transform 460ms var(--ease-smooth);
}

.brand:hover .brand-mark {
  transform: rotate(90deg) scale(1.08);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.site-header nav a:hover {
  color: var(--ink);
}

.site-header nav a {
  position: relative;
  transition: color 180ms ease;
}

.site-header nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms var(--ease-smooth);
}

.site-header nav a:hover::after,
.site-header nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-header nav a[aria-current="page"] {
  color: var(--ink);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 4vw, 52px);
  min-height: calc(100vh - 72px);
  padding: clamp(24px, 4vw, 46px) clamp(18px, 4vw, 56px) 44px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(251, 250, 247, 0));
}

.hero-copy {
  max-width: 920px;
  animation: hero-copy-enter 900ms 160ms var(--ease-out) both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(3rem, 9vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 14px 0 8px;
  font-size: 1.15rem;
}

.hero-copy > p:not(.eyebrow),
.intro p,
.data-section p,
.identity-grid p,
.steps p {
  color: var(--muted);
}

.hero-copy > p:not(.eyebrow) {
  max-width: 680px;
  margin: 28px 0 0;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 220ms ease,
    color 180ms ease,
    transform 220ms var(--ease-smooth);
}

.button.primary,
button {
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: transparent;
}

.button:hover,
button:hover {
  box-shadow: 0 12px 26px rgba(21, 21, 21, 0.12);
  transform: translateY(-2px);
}

.button:active,
button:active {
  transform: translateY(0) scale(0.99);
}

.art-carousel {
  min-width: 0;
  width: 100%;
  justify-self: stretch;
  overflow: hidden;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  animation: carousel-enter 920ms var(--ease-out) both;
  transition:
    border-color 260ms ease,
    box-shadow 340ms ease,
    transform 340ms var(--ease-smooth);
}

.art-carousel:hover {
  border-color: rgba(21, 21, 21, 0.2);
  box-shadow: 0 30px 84px rgba(21, 21, 21, 0.16);
  transform: translateY(-2px);
}

.carousel-topline,
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.carousel-topline {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coverflow {
  --cover-size: clamp(170px, 21vw, 310px);
  --cover-slot: clamp(120px, 17vw, 230px);
  position: relative;
  height: clamp(270px, 31vw, 440px);
  margin: clamp(16px, 2.4vw, 26px) 0 18px;
  perspective: 1500px;
  transform-style: preserve-3d;
  touch-action: pan-y;
  cursor: grab;
  isolation: isolate;
}

.coverflow::before {
  content: "";
  position: absolute;
  inset: 8% 10% auto;
  height: 52%;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.18), rgba(22, 163, 74, 0.12), rgba(37, 99, 235, 0.18));
  filter: blur(34px);
  opacity: 0.52;
  transform: translateZ(-150px);
  pointer-events: none;
  z-index: -1;
}

.coverflow:active {
  cursor: grabbing;
}

.carousel-card {
  --display-offset: 0;
  --display-abs-offset: 0;
  --display-direction: 0;
  --tilt: calc(var(--display-direction) * -58deg);
  --cover-scale: calc(1.07 - (var(--display-abs-offset) * 0.05));
  --cover-depth: calc(var(--display-abs-offset) * -74px);
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--cover-size);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(21, 21, 21, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(21, 21, 21, 0.12);
  cursor: pointer;
  opacity: calc(1 - (var(--display-abs-offset) * 0.13));
  transform:
    translate(-50%, -50%)
    translateX(calc(var(--display-offset) * var(--cover-slot)))
    translateZ(var(--cover-depth))
    rotateY(var(--tilt))
    scale(var(--cover-scale));
  transform-origin: center center;
  transform-style: preserve-3d;
  transition:
    border-color 180ms ease,
    box-shadow 260ms ease,
    filter 420ms ease,
    opacity 820ms var(--ease-smooth),
    transform 1080ms var(--ease-smooth);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-box-reflect: below 12px linear-gradient(transparent 62%, rgba(255, 255, 255, 0.22));
  z-index: calc(20 - var(--display-abs-offset));
}

.carousel-card.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.carousel-card:not(.is-active) {
  filter: saturate(0.86) brightness(0.92);
}

.carousel-card.is-active {
  border-color: var(--ink);
  box-shadow: 0 24px 58px rgba(21, 21, 21, 0.26);
  filter: none;
  transform:
    translate(-50%, -50%)
    translateX(calc(var(--display-offset) * var(--cover-slot)))
    translateZ(54px)
    rotateY(0deg)
    scale(1.14);
}

.carousel-card.is-active img {
  animation: active-art-pulse 3600ms ease-in-out infinite;
}

.carousel-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.art-overlay {
  display: none;
}

.art-overlay h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.3rem);
  line-height: 1;
}

.art-seed,
.art-reasoning {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.82rem, 1.45vw, 0.98rem);
}

.art-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.art-details div {
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  padding-top: 8px;
}

.art-details dt {
  color: rgba(255, 255, 255, 0.74);
}

.art-details dd {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-controls {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
  min-height: 46px;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.9rem;
  line-height: 1;
}

.carousel-pause {
  font-size: 1rem;
}

.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
}

.carousel-dot {
  width: 10px;
  min-width: 10px;
  height: 10px;
  min-height: 10px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(21, 21, 21, 0.24);
  transition:
    background-color 180ms ease,
    transform 220ms var(--ease-smooth),
    width 220ms var(--ease-smooth);
}

.carousel-dot.is-active {
  width: 24px;
  background: var(--ink);
  transform: scale(1);
}

.carousel-error {
  display: grid;
  min-height: 220px;
  place-items: center;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.pixel-stage {
  width: min(100%, 560px);
  justify-self: center;
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.pixel-toolbar,
.square-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pixel-toolbar {
  margin-bottom: 16px;
}

#squareId {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.pixel-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--ink);
  gap: 2px;
}

.pixel {
  min-width: 0;
  min-height: 0;
}

.square-meta {
  margin: 18px 0 0;
  padding: 0;
}

.square-meta div {
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 2px 0 0;
  font-weight: 900;
}

.intro,
.process,
.data-section,
.identity {
  padding: clamp(56px, 9vw, 110px) clamp(18px, 4vw, 56px);
}

.intro,
.process,
.data-section,
.identity {
  position: relative;
}

.intro {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.26);
}

.intro p {
  max-width: 860px;
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.process {
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.1), transparent 38%),
    #f2f6ee;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.steps,
.identity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.steps article,
.identity-grid div {
  min-width: 0;
  border: 1px solid rgba(21, 21, 21, 0.13);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.74);
  transition:
    border-color 220ms ease,
    box-shadow 280ms ease,
    transform 280ms var(--ease-smooth);
}

.steps article:hover,
.identity-grid div:hover {
  border-color: rgba(21, 21, 21, 0.28);
  box-shadow: 0 18px 42px rgba(21, 21, 21, 0.1);
  transform: translateY(-5px);
}

.steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  transition:
    background-color 220ms ease,
    transform 320ms var(--ease-smooth);
}

.steps article:hover span {
  background: var(--ink);
  transform: rotate(4deg) scale(1.07);
}

.data-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(37, 99, 235, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.18);
}

.data-section p {
  max-width: 640px;
  font-size: 1.1rem;
}

pre {
  overflow-x: auto;
  margin: 0;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 30px);
  background: #151515;
  color: #f8fafc;
  box-shadow: var(--shadow);
  transform-origin: center;
  transition:
    box-shadow 300ms ease,
    transform 300ms var(--ease-smooth);
}

pre:hover {
  box-shadow: 0 30px 84px rgba(21, 21, 21, 0.18);
  transform: translateY(-3px) rotate(-0.5deg);
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(0.78rem, 1.6vw, 0.98rem);
}

.identity {
  background:
    linear-gradient(135deg, rgba(219, 39, 119, 0.1), transparent 35%),
    #f7f0f3;
}

.identity h2 {
  max-width: 820px;
  margin-bottom: 34px;
}

.identity-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

footer {
  padding: 28px clamp(18px, 4vw, 56px);
  background: var(--ink);
  color: #fff;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 720ms ease,
    transform 820ms var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 620ms ease,
    transform 760ms var(--ease-out);
  transition-delay: calc(var(--reveal-index, 0) * 85ms);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes carousel-enter {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-copy-enter {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes active-art-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.025);
  }
}

footer p {
  margin: 0;
}

.gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.12), transparent 38%),
    var(--paper);
}

.gallery-hero h1 {
  max-width: 940px;
  font-size: clamp(2.9rem, 7.4vw, 6.8rem);
}

.gallery-hero > p {
  align-self: end;
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.gallery-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(18px, 3vw, 30px);
  padding: clamp(22px, 4vw, 44px) clamp(18px, 4vw, 56px) clamp(56px, 7vw, 88px);
  background: #f4f4f1;
}

.gallery-workspace.filters-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.gallery-filters {
  position: sticky;
  top: 92px;
  min-width: 0;
  border: 1px solid rgba(21, 21, 21, 0.13);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.06);
}

.gallery-workspace.filters-hidden .gallery-filters {
  display: none;
}

.filter-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.filter-heading h2 {
  font-size: 1.35rem;
}

.filter-clear {
  min-height: 34px;
  border-color: rgba(21, 21, 21, 0.18);
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
}

.filter-help {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.color-similarity-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(21, 21, 21, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: #f8f8f5;
}

.color-similarity-control span,
.color-similarity-control output {
  font-size: 0.78rem;
  font-weight: 900;
}

.color-similarity-control output {
  color: var(--muted);
}

.color-similarity-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--ink);
}

.color-filter-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding-right: 4px;
}

.color-filter-item {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  border: 2px solid rgba(21, 21, 21, 0.1);
  border-radius: 6px;
  padding: 5px;
  background: #f8f8f5;
  color: var(--ink);
  cursor: pointer;
}

.color-filter-item:hover {
  border-color: rgba(21, 21, 21, 0.28);
  transform: translateY(-1px);
}

.color-filter-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.color-filter-item[data-state="on"] {
  border-color: #16a34a;
  background: #eff8f1;
}

.color-filter-item[data-state="off"] {
  border-color: #dc2626;
  background: #fff1f1;
}

.color-filter-swatch {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(21, 21, 21, 0.2);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.color-filter-count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 999px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 7px rgba(21, 21, 21, 0.16);
}

.color-filter-variations {
  position: absolute;
  left: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 999px;
  padding: 0 5px;
  background: rgba(21, 21, 21, 0.9);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 7px rgba(21, 21, 21, 0.16);
}

.color-filter-copy {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  color: transparent;
  box-shadow: 0 2px 7px rgba(21, 21, 21, 0.18);
  cursor: copy;
}

.color-filter-copy::before {
  content: "";
  position: absolute;
  inset: 5px 4px 4px 6px;
  border: 1.6px solid var(--ink);
  border-radius: 2px;
}

.color-filter-copy::after {
  content: "";
  position: absolute;
  inset: 3px 6px 6px 4px;
  border: 1.6px solid var(--ink);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.94);
}

.color-filter-copy[data-copied="true"]::before,
.color-filter-copy[data-copied="true"]::after {
  inset: auto;
  top: 4px;
  left: 6px;
  width: 5px;
  height: 8px;
  border: solid #166534;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  background: transparent;
  transform: rotate(45deg);
}

.gallery-panel {
  width: 100%;
  min-width: 0;
}

.gallery-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.gallery-toolbar h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.gallery-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-toggle {
  min-height: 36px;
  border-color: rgba(21, 21, 21, 0.18);
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
}

.filter-toggle:hover {
  border-color: rgba(21, 21, 21, 0.32);
  background: #f8f8f5;
}

.gallery-toolbar output {
  border: 1px solid rgba(21, 21, 21, 0.17);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.gallery-search {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.gallery-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(21, 21, 21, 0.17);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.gallery-search input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 12px;
}

.gallery-card {
  display: grid;
  gap: 0;
  min-height: 0;
  border: 1px solid rgba(21, 21, 21, 0.13);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.06);
  text-align: left;
}

.gallery-card:hover,
.gallery-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 18px 42px rgba(21, 21, 21, 0.14);
}

.gallery-pixel-art {
  display: grid;
  grid-template-columns: repeat(var(--pixel-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--pixel-rows), minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(21, 21, 21, 0.1);
  border-radius: 5px;
  background: #fff;
  image-rendering: pixelated;
}

.gallery-pixel {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.gallery-pixel:hover,
.gallery-pixel:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(21, 21, 21, 0.72);
  outline-offset: -2px;
  transform: none;
}

.gallery-pixel[data-filter-state="on"] {
  box-shadow: inset 0 0 0 2px #16a34a;
}

.gallery-pixel[data-filter-state="off"] {
  box-shadow:
    inset 0 0 0 2px #dc2626,
    inset 999px 0 0 rgba(255, 255, 255, 0.38);
}

.gallery-card:has(.gallery-card-title:hover) .gallery-pixel,
.gallery-card:has(.gallery-card-title:focus-visible) .gallery-pixel {
  box-shadow: none;
}

.gallery-card-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 2px 2px;
}

.gallery-card-title {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  padding: 4px 2px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card-title:hover,
.gallery-card-title:focus-visible {
  background: #f4f4f1;
  transform: none;
}

.art-inspector {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.art-inspector:not([open]) {
  display: none;
}

.art-inspector::backdrop {
  background: linear-gradient(135deg, rgba(21, 21, 21, 0.76), rgba(21, 21, 21, 0.58));
  backdrop-filter: blur(10px);
}

.art-inspector.is-fallback-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
}

body.has-open-inspector {
  overflow: hidden;
}

.inspector-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
  min-height: min(760px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(21, 21, 21, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 245, 0.98)),
    #fff;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.28);
  animation: inspector-enter 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.inspector-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-color: rgba(21, 21, 21, 0.18);
  background: #fff;
  color: var(--ink);
  padding: 0;
}

.inspector-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  background:
    linear-gradient(45deg, rgba(21, 21, 21, 0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(21, 21, 21, 0.045) 25%, transparent 25%),
    #fff;
  background-position: 0 0, 0 12px;
  background-size: 24px 24px;
  image-rendering: pixelated;
  object-fit: contain;
  padding: clamp(18px, 3vw, 44px);
}

.inspector-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(24px, 4vw, 54px);
}

.inspector-heading {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.inspector-content h2 {
  max-width: 100%;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
}

.inspector-content h3 {
  margin-top: 24px;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.inspector-seed,
.inspector-reasoning {
  color: var(--muted);
}

.inspector-seed {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.inspector-reasoning {
  max-width: 70ch;
  margin: 8px 0 0;
}

.inspector-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.inspector-metrics div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
  border: 1px solid rgba(21, 21, 21, 0.11);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(21, 21, 21, 0.05);
}

.inspector-metrics dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.inspector-metrics dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-copy {
  min-height: 0;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: inherit;
  line-height: inherit;
}

.metric-copy:hover {
  color: var(--blue);
  transform: none;
}

.metric-copy[data-copied="true"] {
  color: var(--green);
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 620px;
}

.color-swatches span {
  width: 28px;
  flex: 0 0 28px;
  aspect-ratio: 1;
  border: 1px solid rgba(21, 21, 21, 0.22);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.inspector-download {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: #fff;
}

@keyframes inspector-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.pagination span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

.pagination button {
  min-width: 104px;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.page-size-control select {
  min-height: 44px;
  border: 1px solid rgba(21, 21, 21, 0.17);
  border-radius: 6px;
  padding: 0 34px 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
}

@media (max-width: 920px) {
  .hero,
  .intro,
  .data-section,
  .gallery-hero,
  .gallery-workspace {
    grid-template-columns: 1fr;
  }

  .gallery-filters {
    position: static;
  }

  .color-filter-list {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    max-height: 280px;
  }

  .hero {
    min-height: auto;
  }

  .pixel-stage {
    justify-self: start;
  }

  .art-carousel {
    justify-self: stretch;
  }

  .inspector-frame {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .inspector-frame > img {
    height: auto;
    min-height: 0;
    max-height: 64vh;
  }

  .inspector-content {
    padding: clamp(22px, 6vw, 34px);
  }

  .section-heading {
    display: block;
  }

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

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    width: 100%;
    justify-content: space-between;
  }

  .steps,
  .identity-grid {
    grid-template-columns: 1fr;
  }

  .square-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .coverflow {
    --cover-size: clamp(145px, 53vw, 225px);
    --cover-slot: clamp(96px, 42vw, 175px);
    height: clamp(250px, 72vw, 340px);
    perspective: 950px;
  }

  .carousel-card {
    width: var(--cover-size);
  }

  .art-details {
    grid-template-columns: 1fr;
  }

  .art-reasoning {
    display: none;
  }

  .gallery-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .inspector-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .inspector-seed {
    flex-basis: auto;
    text-align: left;
  }

  .art-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }

  .inspector-metrics {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }

  .inspector-frame {
    animation: none;
  }
}
