:root {
  --ink: #1a1612;
  --muted: #6b5f52;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 32px 16px;
}

.brand {
  margin: 0 auto 12px;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--ink);
  font-weight: 600;
}

.page {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 40px);
  flex: 1;
  justify-content: center;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  color: var(--ink);
}

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

.combo-panel {
  padding: clamp(20px, 4vw, 36px);
}

.combo-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: clamp(18px, 3vw, 28px);
}

.color-stage {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: 760px;
  gap: 0;
  margin: 0 auto;
  align-items: stretch;
  justify-content: center;
}

.color-block {
  position: relative;
  flex: 0 1 180px;
  width: 180px;
  max-width: 100%;
  min-width: 140px;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  border: none;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.color-block:hover,
.color-block:focus-visible {
  transform: none;
}

.color-block:focus-visible {
  outline: 3px solid rgba(24, 21, 18, 0.35);
  outline-offset: 2px;
}

.color-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
}

.color-block:hover .color-label,
.color-block:focus-visible .color-label {
  opacity: 1;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  width: auto;
  max-width: none;
  justify-content: center;
}

.page-buttons {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  justify-content: center;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  font: inherit;
  border: 1px solid #cfcfcf;
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
}

button:hover:not(:disabled) {
  background: #f5f5f5;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-button.is-active {
  background: #1a1612;
  color: #fff;
  border-color: #1a1612;
}

.shuffle {
  padding: 8px 14px;
  color: var(--ink);
  font-weight: 600;
}

.site-footer {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 64px);
  flex-shrink: 0;
}

.legal-links {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.text-link {
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--muted);
  background: none;
}

body.legal-page {
  justify-content: flex-start;
  align-items: stretch;
}

body.legal-page .brand {
  margin: 0 0 12px;
}

.legal-content {
  gap: 18px;
  text-align: left;
}

.legal-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.legal-updated {
  margin: 4px 0 0;
  color: var(--muted);
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-section h2 {
  margin: 0;
  font-size: 1.1rem;
}

.legal-section p {
  margin: 0;
  line-height: 1.6;
  color: var(--ink);
}

.legal-footer-links {
  display: flex;
  gap: 12px;
}

@media (max-width: 600px) {
  body {
    padding: 20px 10px;
  }

  .page {
    padding: 16px 12px;
  }

  .combo-panel {
    padding: 12px 8px;
  }

  .color-stage {
    gap: 0;
  }

  .color-block {
    flex: 0 1 clamp(60px, 20vw, 110px);
    width: clamp(60px, 20vw, 110px);
    min-width: 60px;
  }

  .controls {
    gap: 4px;
  }

  .pagination {
    gap: 4px;
  }

  .page-buttons {
    gap: 4px;
  }

  .nav-actions {
    gap: 4px;
  }

  .pagination button {
    padding: 6px 10px;
    font-size: 14px;
  }
}
