/* Hue Parcel — printed color specimen catalog + digital laboratory */

:root {
  --bg: #F7F5F0;
  --ink: #202A32;
  --accent: #47677B;
  --secondary: #CB846C;
  --border: #D8D6CF;
  --muted: #6F777B;
  --paper: #FFFEFA;
  --max: 1280px;
  --read: 740px;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    url("../svg/specimen-grid.svg"),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(32, 42, 50, 0.03) 79px, rgba(32, 42, 50, 0.03) 80px);
  background-size: 320px 240px, 80px 80px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.55em;
}

p { margin: 0 0 1em; }

code, .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 20;
}
.skip-link:focus { top: 8px; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 32px, var(--read)); margin-inline: auto; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.masthead {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 245, 240, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.nav a { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--paper);
  min-height: 36px;
  padding: 0 12px;
  font: 700 13px var(--sans);
  cursor: pointer;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.intro { max-width: 62ch; color: #3a454c; }

.worktable-head { padding: 28px 0 18px; }

.swatch-scroll-hint {
  display: none;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.swatch-row {
  display: flex;
  width: 100%;
  min-height: 430px;
  border: 1px solid var(--border);
}

.swatch {
  flex: 1 1 20%;
  min-width: 0;
  position: relative;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.swatch-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.swatch-hex {
  font-family: var(--mono);
  font-size: clamp(14px, 1.6vw, 20px);
  font-weight: 700;
}

.swatch-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.swatch.is-locked::after {
  content: "LOCKED";
  position: absolute;
  top: 18px;
  right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  background: var(--ink);
  color: var(--bg);
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

.btn-light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--border);
}

.btn-tiny { min-height: 32px; padding: 0 10px; font-size: 12px; }

.tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 0 8px;
  border-bottom: 1px solid var(--border);
}

.tool-strip label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

select, input[type="text"], input[type="number"] {
  font: 14px var(--mono);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  min-height: 40px;
  padding: 0 10px;
}

.status-line {
  min-height: 1.4em;
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0 0;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section h2 { font-size: clamp(26px, 3vw, 34px); }

.ledger {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 14px;
}

.ledger th, .ledger td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.ledger th {
  font-size: 11px;
  letter-spacing: 0.12em;
  background: #efece4;
}

.table-scroll { overflow-x: auto; }

.lab-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 28px;
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }

.contrast-preview {
  border: 1px solid var(--border);
  padding: 28px 24px;
  min-height: 220px;
}

.preview-normal { font-size: 16px; margin-bottom: 18px; }
.preview-large { font-size: 24px; font-weight: 700; }

.wcag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.wcag-item {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 13px;
}

.wcag-result.is-pass { color: #2f5d45; }
.wcag-result.is-fail { color: #8a341f; }

.ratio-face {
  font-family: var(--mono);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.mood-stack { display: grid; gap: 8px; }

.mood-strip {
  display: grid;
  grid-template-columns: 160px 1fr 1.2fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 10px 12px;
}

.mood-name { font-family: var(--serif); font-weight: 700; }
.mood-swatches { display: flex; height: 44px; }
.mood-chip { flex: 1; display: block; min-width: 28px; }
.mood-chip.tall { height: 72px; }
.mood-desc { margin: 0; font-size: 14px; color: var(--muted); }

.wheel-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.wheel-svg { width: 100%; max-width: 280px; height: auto; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }

.mini-chip {
  display: inline-block;
  width: 42px;
  height: 42px;
  margin-right: 6px;
  border: 1px solid var(--border);
}

.station {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 22px;
}

.previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.preview-box {
  border: 1px solid var(--border);
  min-height: 220px;
  padding: 20px;
  background: var(--p-bg, #F1E9DA);
  color: var(--p-text, #23395B);
}

.preview-box a { color: var(--p-accent, #D98262); }
.preview-nav { font-size: 12px; letter-spacing: 0.12em; color: var(--p-secondary, #406E8E); }
.accent-line { height: 3px; background: var(--p-accent, #D98262); width: 48px; margin: 12px 0; }
.poster-block {
  margin-top: 24px;
  padding: 12px;
  background: var(--p-surface, #8EA8C3);
  color: var(--p-text, #23395B);
}

.notebook { counter-reset: note; }
.note-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.note-block h3::before {
  counter-increment: note;
  content: counter(note, decimal-leading-zero) " / ";
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.7em;
}

.swatch-inline { display: flex; height: 28px; margin: 10px 0; max-width: 320px; }
.swatch-inline span { flex: 1; }

.article-list a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.article-list strong { display: block; font-family: var(--serif); font-size: 20px; }

.editor {
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 16px;
  margin-top: 12px;
}

.contact-block { font-size: 16px; line-height: 1.7; }

.article-body { padding: 48px 0 72px; }
.article-body h1 { font-size: clamp(32px, 4vw, 44px); }
.article-body h2 { margin-top: 1.5em; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  font-size: 14px;
}

.footer-id { font-family: var(--serif); font-weight: 700; margin-bottom: 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 0; margin-bottom: 10px; }
.footer-nav span { margin: 0 8px; color: var(--border); }
.footer-nav a { text-decoration: none; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .nav { gap: 10px; font-size: 12px; }
}

@media (max-width: 760px) {
  .nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 10px;
  }
  .nav.is-open { display: flex; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .swatch-scroll-hint { display: block; }
  .swatch-row {
    overflow-x: auto;
    min-height: 340px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .swatch { flex: 0 0 72%; min-height: 340px; scroll-snap-align: start; }
  .btn-tiny { min-height: 40px; }
  .lab-grid, .wheel-layout, .previews, .mood-strip {
    grid-template-columns: 1fr;
  }
}
