:root {
  color-scheme: light;
  --page-bg: #f7f5f0;
  --surface: #ffffff;
  --text: #20211f;
  --muted: #666a63;
  --border: #e3e0d8;
  --accent: #315b4c;
  --accent-hover: #244638;
  --radius-lg: 24px;
  --radius-md: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
}

button,
select {
  font: inherit;
}

.app-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 28px;
}

.site-header {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.intro {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.generator-panel {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgb(34 34 28 / 5%);
}

.generator-panel h2,
.palette-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.controls {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-top: 20px;
}

.field {
  flex: 1;
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #c9c8c0;
  border-radius: 10px;
}

select:focus-visible,
button:focus-visible {
  outline: 3px solid #8eb8a4;
  outline-offset: 3px;
}

.button-group {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: white;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  color: var(--text);
  background: #f2f0ea;
  border-color: var(--border);
}

.button-secondary:hover {
  background: #e8e5dd;
}

.status-message {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.palette-section {
  margin-top: 42px;
}

.palette-heading {
  margin-bottom: 18px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.color-card {
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.color-swatch {
  min-height: 150px;
}

.color-card-content {
  padding: 14px;
}

.color-hex {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.copy-button {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 700;
}

.copy-button:hover {
  background: #f5f3ee;
}

.copy-button:focus-visible {
  outline: 3px solid #8eb8a4;
  outline-offset: 2px;
}

.site-footer {
  margin-top: 56px;
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
}

.site-footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .app-shell {
    padding-top: 42px;
  }

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

  .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .color-swatch {
    min-height: 130px;
  }
}

@media (max-width: 380px) {
  .app-shell {
    width: min(100% - 24px, 1080px);
  }

  .button {
    padding-inline: 10px;
  }
}