:root {
  --bg: #f5efe5;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-strong: rgba(255, 252, 247, 0.94);
  --line: rgba(48, 40, 28, 0.12);
  --text: #1f1a14;
  --muted: #5e5448;
  --accent: #d95d39;
  --shadow: 0 20px 60px rgba(67, 43, 9, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 93, 57, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 179, 164, 0.18), transparent 26%),
    linear-gradient(180deg, #fbf7ef 0%, #f5efe5 48%, #efe4d1 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent);
}

.layout {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero h1,
.section-head h2 {
  margin: 0;
  line-height: 0.95;
}

.hero-text,
.section-copy,
.stat-label,
.detail-label,
.search-label {
  color: var(--muted);
}

.hero-text,
.section-copy {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.6;
}

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

.stat-value,
.detail-value {
  display: block;
  font-family: Consolas, "Liberation Mono", monospace;
}

.explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.canvas-panel,
.inspector-panel {
  padding: 24px;
}

.library {
  margin-top: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.range-toolbar,
.utility-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.range-toolbar {
  margin-bottom: 14px;
}

.range-actions,
.utility-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.range-label {
  font-family: Consolas, "Liberation Mono", monospace;
}

.canvas-wrap {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

#colorMap {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  cursor: crosshair;
}

.map-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(31, 26, 20, 0.75);
  color: #fff;
  font-size: 0.86rem;
}

.preview {
  min-height: 180px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #2ec4b6;
  margin-bottom: 18px;
  box-shadow: inset 0 -80px 120px rgba(255, 255, 255, 0.16);
}

.search-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.94rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-family: Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 26, 20, 0.18);
}

.actionish {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.actionish:hover {
  transform: none;
  box-shadow: none;
  opacity: 0.72;
}

.details-grid,
.pairings {
  display: grid;
  gap: 12px;
}

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

.detail-card,
.pairing-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.detail-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pairings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.pairing-swatch {
  display: grid;
  place-items: center;
  min-height: 76px;
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: 700;
}

.pairing-swatch.light {
  background: #fff;
}

.pairing-swatch.dark {
  background: #101010;
}

.range-panel {
  padding: 24px;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.range-card {
  padding: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  text-align: left;
}

.range-band {
  display: block;
  height: 22px;
  border-radius: 10px;
}

.range-band + .range-band {
  margin-top: 8px;
}

.range-name {
  display: block;
  margin-top: 10px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
}

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

  .section-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .layout {
    width: min(100% - 20px, 1400px);
    padding-top: 12px;
  }

  .hero,
  .canvas-panel,
  .inspector-panel,
  .samples-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .details-grid,
  .pairings,
  .search-row,
  .range-toolbar,
  .utility-row {
    grid-template-columns: 1fr;
  }

  .range-toolbar,
  .utility-row {
    display: grid;
  }
}
