:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-strong: #e3ecf7;
  --text: #0f172a;
  --muted: #51627a;
  --accent: #4f8ef7;
  --accent-strong: #7fb3ff;
  --accent-warm: #f18426;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 35%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.5;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  z-index: 1000;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-header {
  padding: 2rem 0 1.25rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.controls,
.palette,
.empty-state,
.footer-inner {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-card,
.footer-inner,
.empty-state {
  border-radius: var(--radius);
  padding: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  margin-bottom: 0.9rem;
}

.hero-text,
.hero-card p,
.footer-note,
.search-label,
.swatch-label,
.empty-state p {
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: #f3f7ff;
  border: 1px solid #e3edff;
  font-size: 0.95rem;
}

.hero-card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.controls-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.5rem 0 1rem;
  background: linear-gradient(to bottom, rgba(244, 249, 241, 0.98), rgba(244, 249, 241, 0.88), rgba(244, 249, 241, 0));
}

.controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border-radius: var(--radius);
  padding: 1rem;
}

.search-field {
  flex: 1;
}

.search-label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.search-field input {
  width: 100%;
  border: 1px solid #cfe0c7;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fff;
  color: var(--text);
}

.search-field input:focus,
.button:focus,
.palette-copy:focus,
.swatch:focus {
  outline: 3px solid rgba(92, 175, 71, 0.22);
  outline-offset: 1px;
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button,
.palette-copy {
  border: 1px solid #cfe0c7;
  background: #fff;
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button:hover,
.palette-copy:hover,
.swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.results-bar {
  padding-bottom: 1rem;
}

#results-count {
  margin-bottom: 0;
  font-weight: 600;
}

.palettes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

.palette {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.palette:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.palette-inner {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.palette-badge {
  align-self: flex-start;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
}

.palette-title {
  font-size: 1.2rem;
  margin: 0.9rem 0 0.35rem;
}


.swatches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: auto;
}

.swatch {
  border: 0;
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  width: 100%;
  min-width: 0;
}

.swatch-chip {
  width: 18px;
  height: 56px;
  border-radius: 999px;
  flex: 0 0 18px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.swatch-text {
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  min-width: 0;
  flex: 1;
}

.swatch-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}

.swatch-code {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.15;
  word-break: break-word;
}

.palette-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.palette-index {
  font-size: 0.9rem;
  opacity: 0.9;
}

.empty-state {
  text-align: center;
  margin-bottom: 1.5rem;
}

.site-footer {
  padding: 0 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.footer-inner p {
  margin-bottom: 0;
}

.copied-alert {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: 0.85rem 1rem;
  background: #0f172a;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  z-index: 100;
}

body.compact-view .palettes-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

body.compact-view .palette-inner {
  min-height: 210px;
}

body.compact-view .swatch {
  min-height: 64px;
  padding: 0.7rem 0.8rem;
}

body.compact-view .swatch-chip {
  height: 44px;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .controls,
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    width: 100%;
  }

  .button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(calc(100% - 1rem), var(--container));
  }

  .site-header {
    padding-top: 1rem;
  }

  .hero-copy,
  .hero-card,
  .controls,
  .footer-inner,
  .empty-state {
    padding: 1rem;
  }

  .palettes-grid {
    grid-template-columns: 1fr;
  }
}


.hero-card {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.10), rgba(59, 130, 246, 0.06)), rgba(255, 255, 255, 0.92);
}

.button:hover,
.palette-copy:hover,
.swatch:hover {
  border-color: rgba(92, 175, 71, 0.45);
}
