:root {
  color-scheme: dark;
  --ink: #101010;
  --leaf: #FFFDE7;
  --gold: #FBC02D;
  --ember: #FBC02D;
  --font-name: "Comfortaa", ui-rounded, system-ui, sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: color-mix(in srgb, white 91%, var(--gold));
  background:
    radial-gradient(circle at 16% 14%, color-mix(in srgb, var(--gold) 30%, transparent), transparent 28rem),
    radial-gradient(circle at 82% 8%, color-mix(in srgb, var(--ember) 28%, transparent), transparent 24rem),
    linear-gradient(135deg, var(--ink), color-mix(in srgb, var(--gold) 18%, var(--ink)), var(--ink));
  font-family: var(--font-name);
  line-height: 1.5;
}
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 35%, color-mix(in srgb, var(--gold) 12%, transparent) 48%, transparent 62%),
    linear-gradient(210deg, transparent 0 42%, color-mix(in srgb, var(--ember) 16%, transparent) 52%, transparent 70%);
  opacity: .55;
  mix-blend-mode: screen;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 16%, transparent);
  overflow: hidden;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--leaf);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.brand-name span:last-child { color: var(--gold); }
.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--leaf);
  background: color-mix(in srgb, var(--ink) 82%, var(--gold));
  border: 1px solid color-mix(in srgb, var(--leaf) 20%, transparent);
  border-radius: 12px;
}
.logo svg { width: 27px; height: 27px; }
.menu {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.nav-link {
  color: color-mix(in srgb, white 74%, var(--gold));
  text-decoration: none;
  font-size: .82rem;
  padding: 8px 11px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: var(--gold);
  transform: translateY(-1px);
}
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 70px) 0 70px;
  position: relative;
}
.page-hero {
  min-height: 210px;
  display: grid;
  align-content: end;
  padding: clamp(24px, 5vw, 54px) 0 28px;
}
.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: .88rem;
  font-weight: 700;
}
h1, h2, p { text-wrap: pretty; }
h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -.025em;
}
.page-hero > p:last-child {
  max-width: 72ch;
  color: color-mix(in srgb, white 78%, var(--gold));
  font-size: 1.02rem;
}
.home-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 24px 0;
  border-top: 1px solid color-mix(in srgb, var(--gold) 20%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 20%, transparent);
}
.home-panel h2 {
  max-width: 760px;
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  line-height: 1.1;
}
.home-panel p { max-width: 72ch; color: color-mix(in srgb, white 74%, var(--gold)); }
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.stats span {
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 12px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 12px;
}
.stats strong { font-family: var(--font-num); font-size: 1.35rem; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.category-tile {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  color: white;
  text-decoration: none;
  background: color-mix(in srgb, var(--leaf) 44%, var(--ink));
  border-radius: 14px;
  transition: transform .22s var(--ease), background .22s var(--ease);
}
.category-tile:hover {
  transform: translateY(-4px);
  background: color-mix(in srgb, var(--leaf) 66%, var(--ink));
}
.tile-strip {
  display: flex;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
}
.tile-strip span { flex: 1; }
.category-tile strong { font-size: 1.08rem; }
.category-tile > span:last-child {
  color: color-mix(in srgb, white 72%, var(--gold));
  font-size: .9rem;
}
.group,
.source-block {
  margin-top: 28px;
  animation: rise .55s var(--ease) both;
}
.group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.group-title h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}
.group-title span {
  color: color-mix(in srgb, white 62%, var(--gold));
  font-family: var(--font-num);
  font-size: .78rem;
}
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.swatch-grid.compact { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.swatch {
  min-height: 116px;
  padding: 14px;
  display: grid;
  align-content: end;
  gap: 4px;
  color: var(--fg);
  background: var(--color);
  border: 0;
  border-radius: 14px;
  cursor: copy;
  text-align: left;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.swatch:hover { transform: translateY(-4px) scale(1.015); filter: saturate(1.08); }
.swatch:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.name { font-weight: 700; line-height: 1.15; }
.role { opacity: .78; font-size: .78rem; }
.hex {
  font-family: var(--font-num);
  font-weight: 700;
  letter-spacing: 0;
}
.gradient-group {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.gradient-group .group-title { grid-column: 1 / -1; }
.gradient-preview {
  min-height: 180px;
  border-radius: 14px;
}
.note {
  margin: 18px 0 0;
  max-width: 75ch;
  color: color-mix(in srgb, white 76%, var(--gold));
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.source-shot {
  margin: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 72%, var(--leaf));
  border-radius: 12px;
  cursor: zoom-in;
}
.source-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.source-shot figcaption {
  padding: 8px 10px;
  color: color-mix(in srgb, white 70%, var(--gold));
  font-family: var(--font-num);
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  transform: translate(-50%, 16px);
  opacity: 0;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 999px;
  font-weight: 700;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox {
  width: min(980px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: white;
}
.lightbox::backdrop { background: color-mix(in srgb, var(--ink) 88%, transparent); }
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  margin: 0 auto;
  border-radius: 12px;
}
.lightbox p {
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--font-num);
  color: color-mix(in srgb, white 74%, var(--gold));
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
}
@keyframes rise {
  from { opacity: .001; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .home-panel { grid-template-columns: 1fr; }
  .stats { justify-content: flex-start; }
  .gradient-group { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
