:root {
  --module: 7px;
  --band: var(--module);
  --metal: linear-gradient(180deg, #ffffff14, transparent 48%, #64695e12),
    linear-gradient(105deg, #62685e1f 0%, #ffffff0a 15%, #ffffff52 34%, #ffffff33 47%, transparent 67%, #62685e24 100%),
    url("pewter/pewter-surface.webp") 0 0 / 512px 512px repeat;
  --ink: #272420;
  --bronze: #784a25;
  background: #cbc7c2;
  color: var(--ink);
  font: 1rem/1.4 Georgia, serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
.window {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  border: var(--rim) solid transparent;
  border-image: url("pewter/frame-routed.svg") 21 / 1 / 0 stretch;
  row-gap: 2px;
  background: var(--metal);
}
.window { --rim: clamp(14px, 1.4vw, 21px); }
.title-bar {
  --rim: clamp(7px, .95vw, 14px);
  position: relative;
  border: var(--rim) solid transparent;
  border-image: url("pewter/frame-title.svg") 15 / 1 / 0 stretch;
  padding: .03em clamp(.3rem, 1vw, 1rem) .06em;
  background: var(--metal);
  box-shadow: 0 2px 3px #342b2752;
  font-size: clamp(1.25rem, 2.9vw, 2.45rem);
  line-height: 1.12;
}
.title-bar a { color: inherit; text-decoration: none; }
.title-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem .75rem;
}
.audio-toggle {
  color: var(--ink);
  background: var(--metal);
  border: 4px solid transparent;
  border-image: url("pewter/frame-selected.svg") 9 / 1 / 0 stretch;
  padding: .25em .6em;
  min-block-size: 2rem;
  font: .9rem Georgia, serif;
  cursor: pointer;
}
.audio-toggle:focus-visible, .site-mixer input:focus-visible { outline: 2px solid var(--bronze); }
.stage { display: grid; place-items: center; padding: calc(2 * var(--module)); }
.menu {
  --rim: calc(3 * var(--band));
  position: relative;
  width: min(100%, clamp(49 * var(--module), 45vw, 98 * var(--module)));
  background: var(--metal);
  border: var(--rim) solid transparent;
  border-image: url("pewter/frame-routed.svg") 21 / 1 / 0 stretch;
  box-shadow: 0 3px 8px #342b2752;
}
.menu ul { margin: 0; padding: calc(3 * var(--module)) 0; border: 1px solid #827a72; list-style: none; }
.menu a {
  --rim: clamp(6px, .95vw, 12px);
  position: relative;
  display: grid;
  grid-template-columns: calc(4 * var(--module)) minmax(0, auto) calc(4 * var(--module));
  place-content: center;
  align-items: center;
  gap: var(--module);
  min-height: clamp(7 * var(--module), 9.4svh, 14 * var(--module));
  padding: .25em;
  text-align: center;
  overflow-wrap: anywhere;
  color: inherit;
  text-decoration: none;
  font-size: clamp(1.5rem, 3.95vw, 3.8rem);
  line-height: 1.2;
}
.menu a::before {
  content: "";
  position: absolute;
  inset: 2px var(--module);
  border: var(--rim) solid transparent;
  border-image: url("pewter/frame-selected.svg") 9 / 1 / 0 stretch;
  pointer-events: none;
  visibility: hidden;
}
@media (max-width: 42rem) {
  .menu a { min-height: calc(7 * var(--module)); }
  .menu ul { padding-block: var(--module); }
}
@media (min-width: 42.01rem) {
  .stage:has(.menu) { padding-bottom: calc(2 * var(--module) + 6svh); }
  .menu a { grid-template-columns: calc(6 * var(--module)) minmax(0, auto) calc(6 * var(--module)); }
}
@media (max-height: 40rem) {
  .stage:has(.menu) { padding-block: var(--module); }
  .menu ul { padding-block: var(--module); }
  .menu a { min-height: calc(6 * var(--module)); font-size: clamp(1.4rem, 5svh, 2.4rem); }
}
.menu img {
  width: clamp(3 * var(--module), 2.7vw, 5 * var(--module));
  height: auto;
  aspect-ratio: 1;
  justify-self: center;
  visibility: hidden;
}
.menu a:not([href="about.html"]) img:last-child { transform: scaleX(-1); }
.menu a:is(:hover, :focus-visible),
.menu:not(:has(a:hover, a:focus-visible)) li:first-child a {
  background: linear-gradient(100deg, #b8b0a630, #fffefa9c 38%, #fffefad6 58%, #9b938733)
    center / calc(100% - 2 * var(--module)) calc(100% - 4px) no-repeat;
}
.menu a:is(:hover, :focus-visible)::before,
.menu:not(:has(a:hover, a:focus-visible)) li:first-child a::before,
.menu a:is(:hover, :focus-visible) img,
.menu:not(:has(a:hover, a:focus-visible)) li:first-child img { visibility: visible; }
a:focus-visible { outline: 2px solid var(--bronze); outline-offset: -2px; }
.page-content { min-inline-size: 0; padding: clamp(.45rem, 1.5vw, 1.4rem); }
.page-heading, .work-list h2, .work-details {
  border: 7px solid transparent;
  border-image: url("pewter/frame-title.svg") 15 / 1 / 0 stretch;
  background: var(--metal);
}
.page-heading { margin: 0 0 var(--module); padding: .1em .45em; font-size: clamp(1.25rem, 2.5vw, 2rem); font-weight: normal; }
.section-copy {
  width: min(100%, 68ch);
  padding: clamp(.75rem, 2.5vw, 1.5rem);
  border: var(--module) solid transparent;
  border-image: url("pewter/frame-routed.svg") 21 / 1 / 0 stretch;
  background: #e6e2dd;
  overflow-wrap: anywhere;
}
.section-copy > p { margin: 0; }
.site-mixer {
  width: min(100%, 60rem);
  margin-inline: auto;
  padding: clamp(.35rem, 1.5vw, 1rem);
  border: calc(2 * var(--module)) solid transparent;
  border-image: url("pewter/frame-routed.svg") 21 / 1 / 0 stretch;
  background: var(--metal);
}
.mixer-channel {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) 4ch 5.5rem;
  align-items: center;
  gap: .25rem clamp(.4rem, 1.5vw, 1rem);
  padding: .38rem .65rem;
  border: 5px solid transparent;
  border-image: url("pewter/frame-title.svg") 15 / 1 / 0 stretch;
  background: var(--metal);
}
.mixer-channel + .mixer-channel { margin-top: var(--module); }
.mixer-master { padding-block: .65rem; font-weight: bold; margin-bottom: calc(2 * var(--module)); }
.mixer-channel output { text-align: right; font-variant-numeric: tabular-nums; }
.mixer-channel input { accent-color: var(--bronze); }
.mixer-channel input[type="range"] {
  --track: linear-gradient(to right, #7d7973 0 var(--level, 0%), transparent var(--level, 0%)),
    linear-gradient(#817e78, #e9e7e2 52%, #f6f3ed);
  --thumb: linear-gradient(#fffdf7 6%, #d8d6ce 30%, #98958d 64%, #e4e1da 84%, #8a867e);
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 2rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.mixer-channel input[type="range"]::-webkit-slider-runnable-track {
  height: .55rem;
  border: 1px solid #6e6a64;
  background: var(--track);
}
.mixer-channel input[type="range"]::-moz-range-track {
  height: .45rem;
  border: 1px solid #6e6a64;
  background: var(--track);
}
.mixer-channel input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: 1.25rem;
  margin-top: -.42rem;
  border: 1px solid #5d5953;
  background: var(--thumb);
  box-shadow: 1px 1px 2px #514b4350;
}
.mixer-channel input[type="range"]::-moz-range-thumb {
  width: .875rem;
  height: 1.125rem;
  border: 1px solid #5d5953;
  border-radius: 0;
  background: var(--thumb);
  box-shadow: 1px 1px 2px #514b4350;
}
.mixer-mute {
  display: flex;
  align-items: center;
  gap: .2rem;
  min-height: 2rem;
  padding-inline: .2rem;
  border: 3px solid transparent;
  border-image: url("pewter/frame-selected.svg") 9 / 1 / 0 stretch;
  font-size: .85rem;
}
.mixer-mute input { margin: 0; }
.mixer-mute:has(input:checked) { background: #c4bdb2; }
.mixer-tests { display: flex; flex-wrap: wrap; gap: var(--module); margin-top: calc(2 * var(--module)); }
.mixer-status { margin: .35rem 0 0; }
.mixer-status:empty { margin: 0; }
.section-copy > .sound-mixer-link { margin-top: .75rem; }
@media (max-width: 42rem) {
  .mixer-channel { grid-template-columns: minmax(0, 1fr) auto auto; padding-inline: .4rem; }
  .mixer-channel input[type="range"] { grid-area: 2 / 1 / auto / -1; }
  .mixer-channel > label:first-child { overflow-wrap: anywhere; }
  .mixer-tests { display: grid; }
}
@media (forced-colors: active) {
  .mixer-channel input[type="range"] { appearance: auto; }
}
.collage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(7rem, 16vw, 12rem);
  grid-template-areas: "preview list";
  gap: clamp(var(--module), 1.2vw, calc(2 * var(--module)));
  align-items: start;
}
.work-list {
  grid-area: list;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: calc(2 * var(--module)) solid transparent;
  border-image: url("pewter/frame-routed.svg") 21 / 1 / 0 stretch;
  background: var(--metal);
}
.work-list h2 { margin: 0; padding: .15em .3em; text-align: center; font-size: 1rem; font-weight: normal; }
.work-strip {
  max-block-size: min(67svh, 38rem);
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 3px;
}
.work-list label {
  position: relative;
  display: grid;
  gap: .25em;
  padding: .3em;
  border: 4px solid transparent;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: clamp(.72rem, 1.2vw, 1rem);
  cursor: pointer;
}
.work-list input {
  position: absolute;
  inset-block: 0;
  inline-size: 1px;
  block-size: 100%;
  margin: 0;
  opacity: 0;
}
.work-thumb {
  display: grid;
  place-items: center;
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #a2978b;
  background: #d6d0c8;
  color: #514941;
}
.work-list label:hover { background: #fffcf34d; }
.work-list label:has(:checked) {
  border-image: url("pewter/frame-selected.svg") 9 / 1 / 0 stretch;
  background: #f5f2ed;
}
.work-list label:has(:focus-visible) { outline: 2px solid var(--bronze); outline-offset: -2px; }
.work-preview { grid-area: preview; }
.work-preview figure { display: none; margin: 0; }
.collage:has(#warm-field:checked) #preview-warm-field,
.collage:has(#low-tide:checked) #preview-low-tide,
.collage:has(#quiet-form:checked) #preview-quiet-form { display: block; }
.work-art {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 34 / 21;
  max-block-size: max(9rem, calc(100svh - 16rem));
  margin: 0 0 var(--module);
  padding: var(--module);
  text-align: center;
  border: var(--module) solid transparent;
  border-image: url("pewter/frame-routed.svg") 21 / 1 / 0 stretch;
  background: #e6e2dd;
}
.work-art > img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.work-details {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem clamp(.75rem, 3vw, 2.5rem);
  margin: 0;
  padding: .35rem .65rem;
}
.work-details dt { font-size: .85rem; color: #514941; }
.work-details dd { margin: 0; overflow-wrap: anywhere; }
.work-details div:first-child dd { font-weight: bold; }

@media (max-width: 42rem) {
  .title-bar:has(.audio-toggle:not([hidden])) { position: sticky; top: 0; z-index: 1; }
  .collage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview"; }
  .work-list { display: none; }
  .work-preview figure { display: block; }
  .work-preview figure + figure { margin-top: calc(3 * var(--module)); }
  .work-art { max-block-size: none; }
}
