:root {
  --yellow: #f2c94c;
  --yellow-light: #fff6c9;
  --black: #111111;
  --ink: #222222;
  --paper: #f6f5f0;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111111;
  background: #f6f5f0;
  line-height: 1.5;
}

body {
  margin: 0;
  min-width: 320px;
}

.site-header {
  background: var(--black);
  color: white;
  border-bottom: 3px solid var(--yellow);
}

.header-inner,
.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: white;
  text-decoration: none;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--yellow);
  color: var(--black);
  font-size: 12px;
  font-weight: 900;
}

.header-note {
  color: #d0c9b8;
  font-size: 14px;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 64px 0 36px;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 800;
  color: #8a6b00;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-copy {
  margin: 20px 0 0;
  color: #55514a;
  font-size: 18px;
  max-width: 650px;
}

.tool-card,
.image-panel,
.palette-panel,
.info-grid article {
  background: var(--card);
  border: 1px solid #e4e1d8;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(17, 24, 39, .06);
}

.tool-card {
  padding: 28px;
}

.tool-card-header h2,
.panel-heading h2,
.info-grid h2 {
  margin: 0;
}

.tool-card-header {
  margin-bottom: 22px;
}

.muted {
  color: #6b665d;
  margin: 5px 0 0;
  font-size: 14px;
}

.drop-zone {
  min-height: 210px;
  border: 2px dashed #d0c9b8;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  padding: 30px;
  cursor: pointer;
  transition: .15s ease;
  background: #fbfaf6;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--yellow);
  background: var(--yellow-light);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, .16);
}

.drop-zone input {
  display: none;
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--black);
  color: var(--yellow);
  display: grid;
  place-items: center;
  font-size: 25px;
  margin-bottom: 5px;
}

.drop-zone strong {
  font-size: 17px;
}

.drop-zone span:not(.upload-icon),
.drop-zone small {
  color: #6b665d;
}

.drop-zone small {
  margin-top: 8px;
}

.controls {
  margin-top: 24px;
  padding: 20px;
  background: #fbfaf6;
  border-radius: 14px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}

.control-row label {
  font-size: 15px;
}

output {
  font-weight: 800;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  margin-top: 16px;
  accent-color: var(--yellow);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: #ded9cb;
}

input[type="range"]::-webkit-slider-thumb {
  margin-top: -5px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--yellow);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #ded9cb;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--yellow);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 17px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.button.primary {
  background: var(--black);
  color: var(--yellow);
  box-shadow: inset 0 0 0 1px rgba(242, 201, 76, .35);
}

.button.secondary {
  background: #e4e1d8;
  color: var(--black);
}

.button:hover {
  filter: none;
}

.button.primary:hover {
  background: var(--yellow);
  color: var(--black);
}

.button.secondary:hover {
  background: var(--black);
  color: var(--yellow);
}

.results {
  padding: 28px 0 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.image-panel,
.palette-panel {
  padding: 20px;
}

.panel-heading {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.canvas-frame {
  width: 100%;
  min-height: 260px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #e4e1d8 25%, transparent 25%),
    linear-gradient(-45deg, #e4e1d8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e1d8 75%),
    linear-gradient(-45deg, transparent 75%, #e4e1d8 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 650px;
  height: auto;
  width: auto;
}

.interactive canvas {
  cursor: crosshair;
}

.current-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

#hoverSwatch {
  width: 25px;
  height: 25px;
  border: 1px solid #d0cbc0;
  border-radius: 6px;
  background: transparent;
}

.palette-panel {
  margin-top: 20px;
}

.count-badge {
  background: var(--yellow-light);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}

.color-chip {
  border: 1px solid #e4e1d8;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.swatch {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 6px;
  border: 1px solid rgba(17, 24, 39, .15);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 40px 0 70px;
}

.info-grid article {
  padding: 24px;
  box-shadow: none;
}

.info-grid p,
.info-grid li {
  color: #55514a;
  font-size: 14px;
}

.info-grid ol {
  padding-left: 20px;
  margin-bottom: 0;
}

.site-footer {
  background: var(--black);
  color: #d0c9b8;
  font-size: 13px;
}

.footer-inner {
  min-height: 70px;
}

@media (max-width: 800px) {
  .image-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 44px;
  }
}

@media (max-width: 520px) {
  .container,
  .header-inner,
  .footer-inner {
    width: min(100% - 20px, 1180px);
  }

  .tool-card {
    padding: 18px;
  }

  .tool-card-header {
    margin-bottom: 16px;
  }

  .drop-zone {
    min-height: 180px;
    padding: 20px;
  }

  .control-row {
    flex-direction: column;
    gap: 5px;
  }

  .actions .button {
    width: 100%;
  }

  .panel-heading {
    flex-direction: column;
  }

  .current-color {
    align-self: flex-start;
  }

  .header-note {
    display: none;
  }
}

.brightness-control {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e4e1d8;
}

output {
  color: #7a5e00;
}

.seo-copy {
  margin: 34px 0 10px;
  padding: 30px 32px;
  background: #ffffff;
  border: 1px solid #e4e1d8;
  border-top: 4px solid var(--yellow);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(17, 17, 17, .05);
}
.seo-copy h2, .seo-copy h3 { color: var(--black); margin-top: 0; }
.seo-copy h3 { margin-top: 24px; }
.seo-copy p { max-width: 900px; color: #55514a; line-height: 1.75; }
@media (max-width: 640px) { .seo-copy { padding: 24px 20px; } }
