:root {
  --font: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  --highlight: #4f46e5;
  --highlight-soft: #6366f1;
  --accent: #f97316;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg-gradient);
  color: var(--text);
  transition: background 0.4s ease, color 0.4s ease;
}

body[data-theme='light'] {
  color-scheme: light;
  --bg-gradient: radial-gradient(circle at top, #ffffff, #e2e8f0 70%);
  --surface: rgba(248, 250, 252, 0.9);
  --card-bg: #ffffff;
  --section-bg: rgba(255, 255, 255, 0.92);
  --panel-bg: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-muted: #475569;
  --input-bg: rgba(241, 245, 249, 0.9);
  --input-border: rgba(15, 23, 42, 0.12);
  --chip: rgba(15, 23, 42, 0.05);
  --swatch-bg: rgba(15, 23, 42, 0.05);
  --swatch-text: #0f172a;
  --card-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
  --section-shadow: 0 35px 70px rgba(15, 23, 42, 0.1);
  --hero-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  --secondary-bg: rgba(15, 23, 42, 0.08);
  --secondary-border: rgba(15, 23, 42, 0.15);
  --ghost-border: rgba(15, 23, 42, 0.2);
  --toggle-bg: rgba(15, 23, 42, 0.25);
  --placeholder: rgba(15, 23, 42, 0.45);
}

body[data-theme='dark'] {
  color-scheme: dark;
  --bg-gradient: radial-gradient(circle at top, #0b1120, #020205 65%);
  --surface: rgba(10, 13, 18, 0.7);
  --card-bg: rgba(17, 22, 31, 0.85);
  --section-bg: rgba(4, 7, 13, 0.7);
  --panel-bg: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.12);
  --chip: rgba(148, 163, 184, 0.1);
  --swatch-bg: rgba(255, 255, 255, 0.08);
  --swatch-text: #030712;
  --card-shadow: 0 50px 120px rgba(15, 23, 42, 0.45);
  --section-shadow: 0 30px 60px rgba(2, 6, 23, 0.4);
  --hero-bg: linear-gradient(145deg, rgba(28, 36, 61, 0.9), rgba(8, 12, 20, 0.9));
  --secondary-bg: rgba(255, 255, 255, 0.1);
  --secondary-border: rgba(255, 255, 255, 0.15);
  --ghost-border: rgba(255, 255, 255, 0.2);
  --toggle-bg: rgba(255, 255, 255, 0.3);
  --placeholder: rgba(248, 250, 252, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 5vw, 4rem) 4rem;
}

.hero {
  padding: 2rem clamp(1rem, 4vw, 2rem) 3rem;
  border-radius: 32px;
  background: var(--hero-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.color-hero {
  margin-bottom: 0;
}

.color-hero__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: center;
  margin-top: 1rem;
}

.color-hero__preview {
  background: var(--section-bg);
  border-radius: 28px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-chip {
  border-radius: 24px;
  background: var(--chip-color);
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.color-contrast {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.color-contrast p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chip-light,
.chip-dark {
  display: inline-flex;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--chip);
}

.color-info {
  background: var(--chip);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.color-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.color-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.color-meta p {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin: 0;
}

.color-meta strong {
  font-size: 1.2rem;
}

.color-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.logo span {
  color: var(--accent);
}

.nav__actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav__link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 0.2rem;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link--active {
  color: var(--text);
}

.nav__link--active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--highlight);
  border-radius: 999px;
}

.hero__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.hero__content h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0.5rem 0 1rem;
}

.hero__content p {
  color: var(--text-muted);
  max-width: 520px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 1rem;
}

.hero__actions input {
  flex: 1;
  min-width: 220px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 0.85rem 1.2rem;
  color: var(--text);
  font-size: 1rem;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button--primary {
  background: linear-gradient(120deg, var(--highlight), var(--accent));
  color: #fff;
  box-shadow: 0 15px 35px rgba(79, 70, 229, 0.45);
}

.button--secondary {
  background: var(--secondary-bg);
  color: var(--text);
  border: 1px solid var(--secondary-border);
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--ghost-border);
}

.hero__stats {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero__stats strong {
  display: block;
  font-size: 1.8rem;
}

.hero__stats span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero__card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.label {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

dl {
  margin: 0;
  display: grid;
  gap: 1rem;
}

dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.swatches span {
  display: block;
  padding: 0.8rem;
  border-radius: 16px;
  text-align: center;
  background: var(--swatch-bg);
  font-size: 0.85rem;
  color: var(--swatch-text);
}

main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.detail-page main {
  margin-top: 1rem;
}

.section {
  background: var(--section-bg);
  border-radius: 32px;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  border: 1px solid var(--border);
  box-shadow: var(--section-shadow);
}

.data-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.data-cards__tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.data-cards article {
  background: var(--panel-bg);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.data-cards__bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
}

.metrics-table th {
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  padding: 0.35rem 0;
  width: 30%;
}

.metrics-table td {
  padding: 0.35rem 0.4rem;
  word-break: break-word;
}

.metrics-table--wide td {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, min-content));
  gap: 0.5rem;
  align-items: center;
}

.metrics-table--grid td {
  width: calc(33% - 0.4rem);
  text-align: center;
}

.metrics-table code {
  font-family: 'Space Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85rem;
  background: var(--chip);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.value-cluster {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.value-cluster span,
.metrics-table--wide td span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.percent-bars .bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.percent-bars .bar__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--text);
}

.percent-bars .bar__label strong {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.percent-bars .bar__label em {
  font-style: normal;
  font-weight: 600;
}

.percent-bars .bar__track {
  position: relative;
  height: 12px;
  background: var(--chip);
  border-radius: 999px;
  overflow: hidden;
}

.percent-bars .bar__track span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--value);
  border-radius: 999px;
  background: var(--highlight);
}

.bar--red .bar__track span {
  background: linear-gradient(90deg, #ff6b6b, #ff3b3b);
}

.bar--green .bar__track span {
  background: linear-gradient(90deg, #34d399, #22c55e);
}

.bar--blue .bar__track span {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.usage-card {
  background: var(--panel-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.space-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.space-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.space-row:last-child {
  border-bottom: none;
}

.space-label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  min-width: 80px;
}

.space-values {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.space-values span {
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  background: var(--chip);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.base-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.base-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.base-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.base-card header span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.base-card header h4 {
  margin: 0;
  font-size: 1rem;
}

.base-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.base-values button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--chip);
  padding: 0.4rem 0.7rem;
  font-family: 'Space Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.base-values button:hover {
  background: rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.usage-list {
  padding-left: 1.2rem;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.usage-list strong {
  color: var(--text);
}

.picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  align-items: center;
}

.picker__canvas {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
}

.picker__canvas canvas {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: block;
}

.picker__cursor {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35);
}

.picker__controls label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.picker__controls input[type='range'] {
  width: 100%;
  accent-color: var(--highlight);
}

.picker__preview {
  width: 100%;
  height: 80px;
  border-radius: 24px;
  border: 1px solid var(--border);
  margin: 1rem 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.picker__values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.picker__values p {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin: 0;
  color: var(--text-muted);
}

.picker__values strong {
  font-size: 1.1rem;
}

.section header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.section h2 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.section p {
  color: var(--text-muted);
}

.palettes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.palette-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  background: var(--panel-bg);
}

.palette-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.palette-card {
  background: var(--panel-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.palette-card__header h3 {
  margin: 0;
}

.palette-card__header span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.swatch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.swatch-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border-radius: 16px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
}

.swatch-chip {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
  position: relative;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.swatch-chip::before {
  content: '';
  position: absolute;
  top: -96px;
  left: 50%;
  width: 86px;
  height: 86px;
  border-radius: 28px;
  background: var(--chip, #0f172a);
  box-shadow: 0 25px 35px rgba(15, 23, 42, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translate(-50%, 0) scale(0.85);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.swatch-chip::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  background: var(--chip, #0f172a);
}

.swatch-chip:hover::before {
  opacity: 1;
  transform: translate(-50%, -6px) scale(1);
}

.swatch-hex {
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.chip-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--chip, #0f172a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  position: relative;
}

.chip-dot::before {
  content: '';
  position: absolute;
  top: -70px;
  left: 50%;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--chip, #0f172a);
  box-shadow: 0 15px 25px rgba(15, 23, 42, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transform: translate(-50%, 0) scale(0.85);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.chip-dot:hover::before {
  opacity: 1;
  transform: translate(-50%, -4px) scale(1);
}

.palette-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tools__grid article {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  background: var(--panel-bg);
}

.tools__grid h3 {
  margin-top: 0;
}

.tools__grid a {
  color: var(--highlight-soft);
  text-decoration: none;
  font-weight: 600;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.code-card {
  background: var(--panel-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.code-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.code-card h3 {
  margin: 0.15rem 0 0;
  font-size: 1.1rem;
}

.code-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.chip-copy {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chip-copy:hover {
  background: rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.code-card pre {
  background: rgba(5, 6, 10, 0.85);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  font-family: 'Space Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e6eaeb;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-card code {
  display: block;
  white-space: pre-wrap;
}

.code-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.designer-tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.builder-card,
.contrast-card {
  background: var(--panel-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.builder-card__header,
.contrast-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.builder-card__header p,
.contrast-card__header p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
}

.builder-inputs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.builder-inputs input {
  flex: 1;
  min-width: 160px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
}

.sample-swatches {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sample-swatches__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sample-swatches button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.sample-swatches button:hover {
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.12);
}

.builder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.builder-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
}

.builder-item span {
  font-weight: 600;
}

.builder-chip {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--chip, #05313d);
}

.builder-remove {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.contrast-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.contrast-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.contrast-form input {
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 0.7rem 0.8rem;
  color: var(--text);
  font-size: 0.95rem;
}

.contrast-playground-preview {
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--surface);
}

.contrast-playground-preview p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.contrast-playground-preview span {
  font-weight: 600;
}

.contrast-level {
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  align-self: flex-start;
}

.contrast-level--fail {
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
}

.contrast-level--aa {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.contrast-level--aaa {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.contrast-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contrast-hints {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Auxiliary pages */
.page-hero {
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem);
  border-radius: 32px;
  background: var(--hero-bg);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.page-hero__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
}

.page-hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.page-hero__stats div {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  background: var(--panel-bg);
}

.page-hero__stats strong {
  display: block;
  font-size: 1.4rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--panel-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.2rem;
  background: var(--panel-bg);
}

.primary-link {
  color: var(--highlight);
  text-decoration: none;
  font-weight: 600;
}

.contrast-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.surface-card,
.matrix-card {
  background: var(--panel-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.surface-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.surface-tag {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.surface-ratio {
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  background: rgba(5, 49, 61, 0.12);
  color: #05313d;
  font-weight: 600;
  font-size: 0.8rem;
}

.surface-card--dark .surface-ratio {
  background: rgba(255, 255, 255, 0.2);
  color: #0f172a;
}

.surface-preview {
  border-radius: 20px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.surface-card--light .surface-preview {
  background: #ffffff;
}

.surface-card--dark .surface-preview {
  background: #0f172a;
  color: #f8fafc;
}

.preview-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.preview-text--light {
  color: #05313d;
}

.preview-text--dark {
  color: #f8fafc;
}

.surface-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.matrix-card h3 {
  margin: 0;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.matrix-table th {
  text-align: left;
  padding: 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.matrix-table td {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.matrix-table tr:last-child td {
  border-bottom: none;
}

.matrix-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.75rem;
  font-weight: 600;
}

.matrix-badge--aa {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.matrix-badge--aaa {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.matrix-badge--fail {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.matrix-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contrast-foot {
  margin-top: 1.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem;
}

.contrast-foot p {
  margin: 0 0 0.8rem;
  font-weight: 600;
}

.chip-row--colors {
  gap: 0.6rem;
}

.contrast-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  overflow: visible;
}

.contrast-chip i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--chip, #05313d);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.contrast-chip::after {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  top: -85px;
  left: 50%;
  border-radius: 20px;
  background: var(--chip, #05313d);
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translate(-50%, 0) scale(0.8);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 0;
  pointer-events: none;
}

.contrast-chip:hover::after {
  opacity: 1;
  transform: translate(-50%, -6px) scale(1);
}

.contrast-chip:hover i {
  transform: scale(1.2);
}

.data__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.data__grid article {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  background: var(--panel-bg);
}

.data__grid ul {
  padding-left: 1.1rem;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}


.community .comment-card {
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.community .comment-card span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.newsletter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: center;
}

.newsletter form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.newsletter input {
  flex: 1;
  min-width: 220px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 0.9rem 1.2rem;
  color: var(--text);
  font-size: 1rem;
}

.footer {
  margin-top: 2rem;
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
}

input::placeholder {
  color: var(--placeholder);
}

button:hover {
  transform: translateY(-2px);
}

.theme-toggle {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: var(--chip);
  font-weight: 600;
  color: var(--text);
}

.theme-toggle input {
  appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}

.theme-toggle .slider {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: var(--toggle-bg);
  position: relative;
  transition: background 0.3s ease;
}

.theme-toggle .slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.theme-toggle input:checked + .slider {
  background: var(--highlight);
}

.theme-toggle input:checked + .slider::after {
  transform: translateX(20px);
}

.theme-toggle__text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .nav__actions {
    width: 100%;
  }
  .palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .swatch-pairs {
    flex-direction: column;
  }
}

