:root {
  color-scheme: light;
  --text: #33302d;
  --muted: #756f69;
  --line: #dfd9d3;
  --paper: #ffffff;
  --soft: #f7f4ef;
  --accent: #3e3a36;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--text);
  font-family: Arial, "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.75;
}

.site-header,
main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 72px 0 38px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.35;
  letter-spacing: .04em;
}

.lead {
  max-width: 780px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.palette-index,
.palette-section {
  background: var(--paper);
  border: 1px solid var(--line);
}

.palette-index {
  padding: 26px 28px;
  margin-bottom: 28px;
}

.palette-index h2,
.section-head h2 {
  margin: 0;
  line-height: 1.4;
}

.palette-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.palette-nav a,
.page-top {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
  font-size: 13px;
}

.palette-list {
  display: grid;
  gap: 46px;
  padding-bottom: 80px;
}

.palette-section {
  padding: 30px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.palette-board {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(7, minmax(94px, 1fr));
  grid-template-rows: repeat(5, auto);
  gap: 16px 14px;
  padding: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.palette-tile {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 94px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.palette-tile:hover .tile-swatch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tile-code {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.tile-swatch {
  width: 70px;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, .14);
}

.palette-tile strong {
  font-size: 12px;
  letter-spacing: .04em;
}

.hex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.hex-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas:
    "swatch code"
    "swatch hex";
  gap: 0 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.hex-card:hover {
  border-color: var(--accent);
}

.mini-swatch {
  grid-area: swatch;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 0, 0, .12);
}

.color-code {
  grid-area: code;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.hex-card strong {
  grid-area: hex;
  font-size: 13px;
  letter-spacing: .04em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(45, 42, 39, .94);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 720px) {
  .site-header,
  main {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    padding-top: 44px;
  }

  .palette-section {
    padding: 20px;
  }

  .section-head {
    display: block;
  }

  .page-top {
    margin-top: 12px;
  }
}
