/* Only the header and work-category strip receive the noise color field. */
:root[data-noise-state] {
  --noise-bg: #111;
  --noise-fg: #fff;
  --noise-muted: color-mix(in srgb, var(--noise-fg) 66%, var(--noise-bg));
  --noise-line: color-mix(in srgb, var(--noise-fg) 25%, var(--noise-bg));
  --paper: #fff;
  --gray: #808080;
  --line: #e4e4e4;
  color: #171717;
  background: #fff;
  color-scheme: light;
}
html[data-noise-state] body { color: #171717; background: #fff; }
.top-field {
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 32px;
  background: var(--noise-bg);
  color: var(--noise-fg);
  transition: background-color 500ms ease, color 300ms ease;
}
html[data-page="works"] .top-field { padding-bottom: 0; }
.top-field .site-header { background: transparent; color: inherit; }
.top-field :is(.identity,nav a,nav span) { color: inherit; }
.top-field nav a { opacity: .66; }
.top-field nav a.active, .top-field nav a:hover { opacity: 1; color: inherit; }
.top-field :is(a,button,span) { transition: color 300ms ease; }
.top-field .header-work-filter {
  margin: 0;
  padding: 60px 0 24px;
  border-bottom: 1px solid var(--noise-line);
  background: transparent;
  color: inherit;
  transition: border-color 300ms ease;
}
.top-field .filters button { color: var(--noise-muted); }
.top-field .filters button[aria-pressed="true"] { color: var(--noise-fg); }
#works-page { padding-top: 0; }
#works-list.work-list > .work-card:first-child { border-top: 0; }
.site-header { position: relative; }
#noise-instrument {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  max-width: 100%;
  color: var(--noise-fg,#fff);
  font: 300 8px/1 Helvetica,Arial,sans-serif;
}
.noise-palette {
  display: grid;
  grid-template-columns: repeat(5,20px);
  gap: 2px;
  width: 108px;
  margin: 0 auto;
}
#noise-instrument .noise-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 20px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  text-align: center;
  color: inherit;
  cursor: pointer;
}
.noise-line {
  display: block;
  flex: 0 0 28px;
  width: 4px;
  height: 28px;
  box-sizing: border-box;
  background: var(--swatch);
}
.noise-choice[data-noise-type="brown"] { --swatch: #8b7c6d; }
.noise-choice[data-noise-type="pink"] { --swatch: #af969c; }
.noise-choice[data-noise-type="white"] { --swatch: #fff; }
.noise-choice[data-noise-type="blue"] { --swatch: #82949b; }
.noise-choice[data-noise-type="violet"] { --swatch: #968c9b; }
#noise-instrument .noise-name { display: none; }
html[data-noise-type="white"][data-noise-state="active"] .noise-choice[data-noise-type="white"] .noise-line { border: 1px solid #111; }
#noise-instrument .noise-level {
  display: block;
  width: 180px;
  max-width: 100%;
  height: 12px;
  margin: 9px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--noise-fg);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.noise-level::-webkit-slider-runnable-track { height: 1px; background: var(--noise-muted); }
.noise-level::-webkit-slider-thumb { width: 4px; height: 4px; margin-top: -1.5px; border: 0; border-radius: 0; background: var(--noise-fg); appearance: none; -webkit-appearance: none; }
.noise-level::-moz-range-track { height: 1px; background: var(--noise-muted); }
.noise-level::-moz-range-thumb { width: 4px; height: 4px; border: 0; border-radius: 0; background: var(--noise-fg); }
#noise-instrument :focus-visible { outline: 1px solid var(--noise-muted); outline-offset: 3px; }
@media (max-width: 900px) {
  #noise-instrument { position: static; transform: none; margin: 24px auto 0; }
}

@media (prefers-reduced-motion: reduce) {
  .top-field, .top-field :is(a,button,span), .header-work-filter { transition: none; }
}

#noise-instrument .noise-choice[aria-pressed="true"] .noise-line { outline: 1px solid var(--noise-fg); outline-offset: 2px; }

.identity-line { display:flex; align-items:flex-start; gap:24px; flex-wrap:wrap; }
#noise-instrument { position:static; transform:none; width:160px; margin:0; }
.noise-palette { margin:0; }
#noise-instrument .noise-request { display:block; margin:10px 0 0; padding:0; border:0; background:transparent; color:inherit; font:300 9px/1.4 "Helvetica Neue",Helvetica,Arial,sans-serif; text-align:left; }
#noise-instrument .noise-level { width:160px; margin-top:8px; }
@media(max-width:640px) {
 .identity-line { gap:14px; }
 #noise-instrument { width:124px; margin:0; }
 #noise-instrument .noise-level { width:124px; }
}

.identity-line { display:grid; grid-template-columns:max-content minmax(0,1fr); column-gap:24px; row-gap:12px; max-width:760px; }
#noise-instrument { display:contents; }
.noise-palette { grid-column:2; grid-row:1; align-self:center; margin:0; }
#noise-instrument .noise-request { grid-column:1; grid-row:2; margin:0; font-size:8px; line-height:1.5; align-self:center; }
#noise-instrument .noise-level { grid-column:2; grid-row:2; justify-self:end; align-self:center; width:180px; max-width:100%; margin:0; }
@media(max-width:640px) { .identity-line { column-gap:18px; } #noise-instrument .noise-level { width:150px; } }

.identity-line { grid-template-columns:max-content minmax(0,1fr); max-width:960px; }
.noise-palette { justify-self:end; }
.noise-actions { grid-column:2; grid-row:2; justify-self:end; display:flex; align-items:center; gap:12px; }
#noise-instrument .noise-request { margin:0; flex:none; }
#noise-instrument .noise-level { flex:none; margin:0; }
@media(max-width:480px) { .noise-actions { grid-column:1 / -1; } #noise-instrument .noise-level { width:140px; } }

.identity-line { display:block; min-height:60px; max-width:none; }
#noise-instrument { display:block; position:absolute; top:38px; left:46%; transform:translateX(-50%); width:260px; margin:0; }
.noise-palette { margin:0 auto; }
.noise-actions { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:10px; }
#noise-instrument .noise-request { font-size:8px; }
#noise-instrument .noise-level { width:160px; }
@media(max-width:640px) { #noise-instrument { top:28px; width:240px; } #noise-instrument .noise-level { width:145px; } }
@media(max-width:480px) {
 .identity-line { display:flex; align-items:flex-start; gap:14px; }
 #noise-instrument { position:static; transform:none; width:124px; margin:0; }
 .noise-actions { flex-wrap:wrap; justify-content:flex-start; gap:6px; }
 #noise-instrument .noise-level { width:124px; }
}

/* Keep the range in place while its value and button text change. */
.noise-actions { flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:8px; width:160px; margin:10px auto 0; }
#noise-instrument .noise-request { min-height:12px; white-space:nowrap; align-self:flex-start; text-align:left; }
#noise-instrument .noise-level { width:160px; height:18px; margin:0; }
@media(max-width:640px) { .noise-actions { width:145px; } #noise-instrument .noise-level { width:145px; } }
@media(max-width:480px) { .noise-actions { width:124px; flex-wrap:nowrap; } #noise-instrument .noise-level { width:124px; } }

/* A fine invitation begins beneath the name and points to the noise request. */
.top-field .noise-leader { position:absolute; left:0; height:24px; padding:0; border:0; color:var(--noise-muted); background:transparent; cursor:pointer; }
.noise-leader::before { content:''; position:absolute; left:0; right:0; top:12px; height:.5px; background:currentColor; }
.noise-leader::after { content:''; position:absolute; right:0; top:9px; width:6px; height:6px; border-top:.5px solid currentColor; border-right:.5px solid currentColor; transform:rotate(45deg); }
.top-field .noise-leader:hover { color:var(--noise-fg); }
.top-field .noise-leader:focus-visible { outline:1px solid var(--noise-muted); outline-offset:3px; }

/* One continuous color control replaces the separate swatches. */
#noise-instrument .noise-colors {
  display:flex;flex-direction:column;align-items:stretch;
  width:108px;height:28px;margin:0 auto;color:inherit;
}
#noise-instrument .noise-colors-request {
  display:block;flex:none;min-height:12px;margin:0;padding:0;border:0;
  color:inherit;background:transparent;text-align:left;white-space:nowrap;
  font:300 8px/12px "Helvetica Neue",Helvetica,Arial,sans-serif;
}
#noise-instrument .noise-colors-request:hover { color:inherit; }
#noise-instrument .noise-morph {
  display:block;flex:none;appearance:none;-webkit-appearance:none;
  width:108px;height:16px;margin:0;padding:0;border:0;border-radius:0;
  color:inherit;background:transparent;cursor:ew-resize;touch-action:pan-y pinch-zoom;
}
.noise-morph::-webkit-slider-runnable-track { height:1px;background:var(--noise-muted); }
.noise-morph::-webkit-slider-thumb { appearance:none;-webkit-appearance:none;width:4px;height:4px;margin-top:-1.5px;border:0;border-radius:0;background:var(--noise-fg); }
.noise-morph::-moz-range-track { height:1px;background:var(--noise-muted); }
.noise-morph::-moz-range-thumb { width:4px;height:4px;border:0;border-radius:0;background:var(--noise-fg); }
@media(max-width:640px) {
  #noise-instrument .noise-colors-request { font-size:9px;line-height:13.5px; }
  #noise-instrument .noise-morph { height:24px; }
}
