:root {
  color-scheme: dark light;
  --bg: #0e0f12;
  --surface: #17191e;
  --line: #2a2d35;
  --text: #eceef2;
  --muted: #9aa0ad;
  --accent: #8fd3b6;
  --radius: 14px;
  --page: 76rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f3;
    --surface: #ffffff;
    --line: #dedfda;
    --text: #1b1d22;
    --muted: #62666f;
    --accent: #1f7a5c;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

a {
  color: inherit;
}

h1,
h2 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
}

h2 {
  font-size: 1.35rem;
  font-weight: 650;
}

code {
  font: 0.85em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.8rem;
  background: var(--surface);
  border-radius: 8px;
}

.site-header,
main,
.site-footer {
  width: min(100% - 2rem, var(--page));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-block: 1.1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.logo-dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
}

.site-header nav {
  display: flex;
  gap: 0.25rem;
}

.site-header nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current] {
  color: var(--text);
  background: var(--surface);
}

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(18rem, 46vw, 30rem);
  overflow: hidden;
  border-radius: calc(var(--radius) * 1.5);
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0.2));
}

.hero-text h1,
.hero-text p {
  text-shadow: 0 1px 14px rgb(0 0 0 / 0.55);
}

.hero-text p {
  margin: 0.9rem 0 0;
  font-size: 1.1rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
}

.count {
  margin: 0;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.chip {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
}

.chip[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card a:hover {
  transform: translateY(-3px);
  border-color: var(--muted);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--line);
}

.card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem 0.6rem;
}

.card-name {
  font-weight: 600;
}

.card-style {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.strip {
  display: flex;
  height: 6px;
}

.strip span {
  flex: 1;
}

.empty {
  color: var(--muted);
}

.crumbs {
  margin: 0.5rem 0 1rem;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a::before {
  content: "← ";
}

.crumbs a:hover {
  color: var(--text);
}

.wall-figure {
  margin: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) * 1.5);
  background: var(--surface);
}

.wall-figure img {
  width: 100%;
}

.wall-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  margin-top: 2rem;
}

.lead {
  margin: 0.9rem 0 1.5rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.facts {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.facts div {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  width: 7rem;
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.wall-side h2 {
  margin: 0 0 0.8rem;
}

.wall-side h2:not(:first-child) {
  margin-top: 2rem;
}

.downloads,
.swatches,
.palettes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.button {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--text);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  opacity: 0.88;
}

.button small {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
}

.button-small {
  padding: 0.35rem 0.8rem;
  border-color: var(--line);
  background: none;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.swatch {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.swatch:hover {
  color: var(--text);
}

.swatch-color {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.snippet {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.snippet code {
  overflow-wrap: anywhere;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: grid;
  font-weight: 600;
  text-decoration: none;
}

.pager a[rel="next"] {
  text-align: right;
}

.pager small {
  color: var(--muted);
  font-weight: 400;
}

.prose {
  max-width: 44rem;
  padding-top: 1.5rem;
}

.prose h2 {
  margin-top: 2.2rem;
}

.prose p {
  margin: 1rem 0 0;
}

.prose .button {
  margin-top: 1rem;
}

.notfound {
  padding-block: 4rem;
}

.palettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.palette {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.palette-head h2 {
  font-size: 1.05rem;
}

.palette-head a {
  text-decoration: none;
}

.palette-head a:hover {
  text-decoration: underline;
}

.site-footer {
  margin-top: 4rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.2rem 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.3);
}

[hidden] {
  display: none !important;
}

@media (max-width: 48rem) {
  .wall-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .site-header nav a {
    padding-inline: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card a {
    transition: none;
  }
}
