/* Mary's Room Records: a record label's printed catalogue in two inks.
   Ink and paper are the only colours; tone is 1-bit dither, emphasis is
   inversion, and covers are the only colour on the site. */

@font-face { font-family: "Source Serif"; src: url("fonts/source-serif-text.woff") format("woff");
  font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/source-serif-text-italic.woff") format("woff");
  font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif Display"; src: url("fonts/source-serif-display.woff") format("woff");
  font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-medium.woff") format("woff");
  font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  --ink: #121212;
  --paper: #fbfbf9;
  /* the placeholder's 25% dither, in ink */
  --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23121212'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23121212'/%3E%3C/svg%3E");
  --serif: "Source Serif", Georgia, serif;
  --display: "Source Serif Display", "Source Serif", Georgia, serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --wide: 75rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --rule: 1px solid var(--ink);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ededed;
    --paper: #101010;
    --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23ededed'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23ededed'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ededed;
  --paper: #101010;
  --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23ededed'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23ededed'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--serif);
  font-variant-numeric: lining-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 48rem) { body { font-size: 1.125rem; } }
main { flex: 1; width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) 6rem; }
::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mono, code, pre { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0; }
.mono .mono, .mono code { font-size: inherit; }
img { max-width: 100%; }
.sr, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 20; background: var(--ink); color: var(--paper); padding: 0.4rem 0.8rem; }
[hidden] { display: none !important; }

/* section labels: small mono capitals over a hairline, like a ledger's heading */
.label {
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0;
  padding: 0.75rem 0;
  border-bottom: var(--rule);
}
h1, h2, h3 { font-weight: 400; line-height: 1.15; }

/* buttons: hairline boxes that invert when pressed or pointed at */
button {
  font: 400 0.8125rem/1 var(--mono);
  color: var(--ink);
  background: var(--paper);
  border: var(--rule);
  border-radius: 0;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
button:hover, button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button:disabled { cursor: default; }
button.link {
  border: 0; padding: 0; background: none; color: inherit;
  font: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
button.link:hover { background: none; color: inherit; text-decoration-thickness: 2px; }
.i { width: 0.75em; height: 0.75em; fill: currentColor; flex: none; }

/* ------------------------------------------------------------- frame */
header.site, footer.site {
  width: 100%; max-width: var(--wide); margin: 0 auto; padding: 1.25rem var(--gutter);
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: baseline; justify-content: space-between;
}
header.site { border-bottom: 0; }
.wordmark { font: 600 1rem/1.2 var(--serif); text-decoration: none; letter-spacing: 0.01em; }
header.site nav { display: flex; gap: 1.5rem; font-family: var(--mono); font-size: 0.8125rem; }
header.site nav a { text-decoration: none; padding: 0.15rem 0.3rem; margin: -0.15rem -0.3rem; }
header.site nav a:hover, header.site nav a[aria-current] { background: var(--ink); color: var(--paper); }
footer.site { border-top: var(--rule); align-items: center; font-size: 0.875rem; padding-top: 1.25rem; padding-bottom: 2rem; }
footer.site p { margin: 0; flex: 1 1 20rem; }
.cc0 {
  font: 500 0.75rem/1 var(--mono); text-decoration: none; letter-spacing: 0.05em;
  border: var(--rule); padding: 0.35rem 0.45rem;
}
.cc0:hover { background: var(--ink); color: var(--paper); }
header.site + main { border-top: var(--rule); }

/* -------------------------------------------------------------- home */
.statement { max-width: 34rem; margin: clamp(2.5rem, 8vw, 6rem) 0 clamp(3rem, 8vw, 5.5rem); }
.statement p { font: 400 clamp(1.5rem, 3.4vw, 2.25rem)/1.25 var(--display); margin: 0 0 0.6em; letter-spacing: -0.005em; }
.statement p + p { font: inherit; font-size: 1.0625rem; line-height: 1.55; }
.catalogue { list-style: none; margin: 0; padding: 0; }
.catalogue li { border-bottom: var(--rule); }
.catalogue a {
  display: grid; align-items: center; text-decoration: none;
  grid-template-columns: clamp(4.5rem, 12vw, 7.5rem) 6.5rem minmax(0, 1fr) auto auto;
  gap: 0 clamp(1rem, 3vw, 2.5rem); padding: 0.75rem 0.5rem 0.75rem 0;
}
.catalogue a:hover, .catalogue a:focus-visible { background: var(--ink); color: var(--paper); }
.catalogue .cover { width: 100%; height: auto; display: block; background: var(--dots); }
.catalogue .title { font: 400 clamp(1.35rem, 3vw, 2rem)/1.15 var(--display); }
@media (max-width: 40rem) {
  .catalogue a { grid-template-columns: 5rem minmax(0, 1fr) auto; grid-template-rows: auto auto; row-gap: 0.25rem; }
  .catalogue .cover { grid-row: 1 / 3; }
  .catalogue .cat { grid-column: 2; grid-row: 1; }
  .catalogue .title { grid-column: 2 / 4; grid-row: 2; }
  .catalogue .year { display: none; }
  .catalogue .len { grid-column: 3; grid-row: 1; }
}

/* ------------------------------------------------------------- album */
.album-head { padding: clamp(1.5rem, 5vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.album-head .cat { margin: 0 0 0.75rem; letter-spacing: 0.08em; }
.album-head h1 { font: 400 clamp(2.5rem, 8vw, 6rem)/0.98 var(--display); letter-spacing: -0.02em; margin: 0; }
.album-head .by { font-size: 1.25rem; margin: 0.75rem 0 0; }
.album-head .made { font-size: 0.9375rem; max-width: 36rem; margin: 1rem 0 0; }

.deck { display: grid; gap: 1.5rem var(--gutter); }
@media (min-width: 48rem) { .deck { grid-template-columns: 5fr 7fr; } }
.cover { width: 100%; height: auto; display: block; aspect-ratio: 1; background: var(--dots); }
.transport { display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; }
.transport .controls { margin-top: auto; }
.readout { display: flex; flex-direction: column; gap: 0.5rem; }
@media (max-width: 47.99rem) { .readout { order: 2; } .controls { order: 1; } .keys { order: 3; } }
.controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.controls .play {
  background: var(--ink); color: var(--paper); font-size: 1rem; font-weight: 500;
  padding: 0.95rem 1.4rem; min-width: 11.5rem; justify-content: center;
}
.controls .play:hover { background: var(--paper); color: var(--ink); }
.clock { font-size: clamp(1.5rem, 3.5vw, 2.5rem); margin: 0; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.now { margin: 0; min-height: 1.55em; }
.now .n { margin-right: 0.6rem; }
.resume { margin: 0; font-size: 0.9375rem; }
/* keycaps: a hairline box with a heavier bottom edge, in the mono */
kbd {
  display: inline-block; min-width: 1.6rem; padding: 0.22rem 0.4rem 0.18rem; text-align: center;
  font: 500 0.6875rem/1 var(--mono); letter-spacing: 0.02em;
  border: 1px solid currentColor; border-bottom-width: 2px; vertical-align: 0.1em;
}
kbd.wide { min-width: 5rem; }
kbd.arrow { font-size: 0.875rem; padding: 0.1rem 0.35rem 0.06rem; }
/* the keyboard's controls: a small button that opens them, like the file menus */
.keys { position: relative; }
.keys summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
  font: 400 0.8125rem/1 var(--mono); padding: 0.45rem 0.7rem; border: var(--rule);
}
.keys summary::-webkit-details-marker { display: none; }
.keys summary kbd { min-width: 1.2rem; padding: 0.15rem 0.3rem 0.12rem; }
.keys[open] summary, .keys summary:hover { background: var(--ink); color: var(--paper); }
.keytable {
  position: absolute; left: 0; top: calc(100% + 0.35rem); z-index: 5; white-space: nowrap;
  background: var(--paper); border: var(--rule); border-collapse: collapse; font-size: 0.875rem;
}
.keytable td { padding: 0.5rem 1.25rem 0.5rem 0.75rem; border-bottom: var(--rule); vertical-align: middle; }
.keytable td:first-child { font: 400 0.75rem/1 var(--mono); }
audio.stream { width: 100%; }

/* the album's envelope; what has played is the same, inverted */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.timeline {
  position: relative; height: 4.5rem; margin: 2rem 0 0; border: var(--rule);
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
}
.timeline .layer { position: absolute; inset: 0; color: var(--ink); pointer-events: none; }
.timeline .layer svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.timeline .played { background: var(--ink); color: var(--paper); clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.timeline .mark { position: absolute; top: 0; bottom: 0; width: 1px; background: currentColor; }
/* the breaks between tracks reach past the box, as the playhead does */
.timeline .break { position: absolute; top: -0.4rem; bottom: -0.4rem; width: 1px; background: var(--ink); pointer-events: none; }
.timeline .head {
  position: absolute; top: -0.4rem; bottom: -0.4rem; left: var(--p, 0%);
  width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none;
}
.timeline .tip {
  position: absolute; bottom: calc(100% + 0.5rem); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 0.3rem 0.5rem; white-space: nowrap; pointer-events: none;
}

/* the track list: a ruled ledger */
.tracks { margin-top: clamp(2.5rem, 6vw, 4rem); }
.ledger { list-style: none; margin: 0; padding: 0; }
.track { border-bottom: var(--rule); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 0 0.75rem; }
.t-play {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: baseline; padding: 0.85rem 0 0.85rem 0.5rem; cursor: pointer; min-width: 0;
}
.t-play:disabled { cursor: default; }
.t-play:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.t-title { font-size: 1.125rem; overflow-wrap: anywhere; }
.t-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* the row's own buttons take the row's inks, and invert against them */
.t-note-toggle, .menu summary { padding: 0.4rem 0.6rem; background: transparent; color: inherit; border: 1px solid currentColor; }
.t-note-toggle:hover, .t-note-toggle[aria-expanded="true"], .row:has(.t-play:not(:disabled)):hover :is(.t-note-toggle, summary):is(:hover, [aria-expanded="true"]),
.row:has(.t-play:not(:disabled)):hover .menu[open] summary,
.track.playing :is(.t-note-toggle, summary):is(:hover, [aria-expanded="true"]),
.track.playing .menu[open] summary { background: var(--paper); color: var(--ink); }
.row:has(.t-play:not(:disabled)):hover, .track.playing .row { background: var(--ink); color: var(--paper); }
.track.playing .n { visibility: hidden; position: relative; }
.track.playing .n::after {
  content: ""; visibility: visible; position: absolute; left: 0; top: 0.15em; width: 0.7em; height: 0.75em;
  background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.track.playing.paused .n::after { clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }
.t-note { padding: 0 0 1.25rem 3.25rem; max-width: 42rem; font-size: 0.9688rem; }
.t-note > :first-child { margin-top: 0; }

/* a menu of files: a details element, so it opens without a script */
.menu { position: relative; margin-right: 0.5rem; }
.menu summary {
  list-style: none; cursor: pointer; font: 400 0.8125rem/1 var(--mono);
}
.menu summary::-webkit-details-marker { display: none; }
.menu ul {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 5; list-style: none; margin: 0; padding: 0;
  background: var(--paper); color: var(--ink); border: var(--rule); min-width: 13rem;
}
.menu li + li { border-top: var(--rule); }
.menu a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.75rem; text-decoration: none; }
.menu a:hover { background: var(--ink); color: var(--paper); }

/* about the album */
.about-album { margin-top: clamp(3rem, 7vw, 5rem); }
.columns { display: grid; gap: 2rem var(--gutter); }
@media (min-width: 60rem) { .columns { grid-template-columns: 7fr 4fr; } .columns aside { position: sticky; top: 1.5rem; align-self: start; } }
.facts { display: grid; grid-template-columns: auto 1fr; margin: 1.25rem 0 0; }
.facts dt, .facts dd { margin: 0; padding: 0.55rem 0; border-bottom: var(--rule); }
.facts dt { padding-right: 1.5rem; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.6875rem; padding-top: 0.75rem; }
/* a term that opens its explanation: dotted, so it doesn't read as a link */
.disclose summary {
  list-style: none; cursor: pointer; display: inline;
  text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 0.22em;
}
.human .disclose + .disclose { margin-top: 0.35rem; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary:hover, .disclose[open] summary { text-decoration-style: solid; }
.disclose p { font: 400 0.9375rem/1.5 var(--serif); margin: 0.6rem 0 0.2rem; }
.booklet { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; align-items: end; margin-top: 2rem; text-decoration: none; }
.booklet img { width: 100%; height: auto; display: block; border: var(--rule); background: var(--dots); }
.booklet > span { display: flex; flex-direction: column; gap: 0.2rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.booklet .mono { text-decoration: none; }

/* text */
.prose { max-width: 38rem; }
.prose h2, .prose h3 { font: 400 1.5rem/1.2 var(--display); margin: 2.5rem 0 0.75rem; }
.prose h4 { font: 500 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; margin: 2rem 0 0.75rem; }
.prose li { margin-bottom: 0.4em; }
.prose ol, .prose ul { padding-left: 1.25em; }
.prose a { overflow-wrap: anywhere; }
.prose code { font-size: 0.85em; }
.prose em:only-child { display: inline; }
.page { padding-top: clamp(2rem, 6vw, 4rem); }
.page h1 { font: 400 clamp(2.25rem, 6vw, 4rem)/1 var(--display); letter-spacing: -0.015em; margin: 0 0 2rem; }
.page .prose > p:first-child { font-size: 1.25rem; line-height: 1.45; }

/* downloads */
.downloads { margin-top: clamp(3rem, 7vw, 5rem); }
.downloads > p { max-width: 38rem; }
.scroll { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; }
table.ledger th { text-align: left; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.6875rem; }
table.ledger th, table.ledger td { padding: 0.65rem 1rem 0.65rem 0; border-bottom: var(--rule); vertical-align: baseline; white-space: nowrap; }
table.ledger .num { text-align: right; }
table.ledger .sum code { margin-right: 0.75rem; }
table.ledger .copy { padding: 0.3rem 0.5rem; font-size: 0.75rem; }

/* the mini-player, once the transport scrolls away */
.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  background: var(--paper); border-top: var(--rule);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 1rem; align-items: center;
  padding: 0.6rem var(--gutter); animation: rise 150ms ease-out;
}
.mini-now { justify-self: start; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9375rem; text-decoration: none; }
.mini-time { font-variant-numeric: tabular-nums; }
.mini-line { position: absolute; left: 0; right: 0; top: -1px; height: 3px; pointer-events: none; }
.mini-line span { display: block; height: 100%; width: var(--p, 0%); background: var(--ink); }
body.has-mini { padding-bottom: 3.75rem; }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }

/* the listening view: a black room */
.room {
  --ink: #ededed; --paper: #000;
  position: fixed; inset: 0; z-index: 30; background: var(--paper); color: var(--ink);
  display: grid; place-items: center; overflow: auto; animation: fade 200ms ease-out;
}
.room-close { position: absolute; top: 1rem; right: 1rem; }
.room-stage { width: min(90vw, 60rem); display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4rem 0 2rem; }
.room-cover { width: min(42vh, 70vw); height: auto; aspect-ratio: 1; display: block; }
.room-title { font: 400 clamp(1.25rem, 3vw, 1.75rem)/1.2 var(--display); margin: 1.75rem 0 0.4rem; }
.room-time { margin: 0 0 2rem; font-variant-numeric: tabular-nums; }
body.in-room { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 40rem) {
  .row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .row .menu { grid-column: 1 / -1; justify-self: start; margin: -0.4rem 0 0.75rem 3.25rem; }
  .row .menu ul { left: 0; right: auto; }
  .t-play { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .t-note { padding-left: 2.75rem; }
  .row .menu { margin-left: 2.75rem; }
  .controls .play { flex: 1 0 100%; }
  .keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
