/*
 * Ghost Mastering. One stylesheet for the whole site.
 * The idea is liner notes: paper, ink, a book face and a typewriter.
 * One weight of each face. No shadows, no rounded corners, no icons.
 */

@font-face {
  font-family: "Goudy Bookletter 1911";
  src: url("fonts/goudy-bookletter-1911-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("fonts/courier-prime-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --ink: #171614;
  --soft: #6b665c;
  --ghost: #cbc5b6;
  --rule: rgba(23, 22, 20, .18);
  --red: #b23a22;
  --book: "Goudy Bookletter 1911", "Iowan Old Style", Palatino, Georgia, serif;
  --typed: "Courier Prime", "Courier New", Courier, monospace;
  --gutter: clamp(20px, 6vw, 88px);
  --label: 9.5rem;
  --measure: 35rem;
}

*, *::before, *::after { box-sizing: border-box; }
/*
 * The record runs off the right edge; the page must not scroll sideways for
 * it. Both elements need the rule: tested, one alone still scrolls.
 */
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
body {
  margin: 0; color: var(--ink);
  font: 400 1.125rem/1.5 var(--book);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3, strong { font-weight: 400; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--red); }
a:focus-visible, .drop:focus-within { outline: 1px solid var(--ink); outline-offset: 4px; }

.typed {
  font: 400 .76rem/1.7 var(--typed);
  letter-spacing: .01em;
  text-transform: lowercase;
}
.soft { color: var(--soft); }

/* The page hangs from the left edge. The right side is left empty on purpose. */
.page { padding: 0 var(--gutter); max-width: 78rem; }

.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 2rem; padding-top: 1.75rem;
}
.mark { font-size: 1.3rem; text-decoration: none; white-space: nowrap; }
.mark:hover { color: inherit; }
/* The ghost is the part you nearly miss. */
.mark .g { color: var(--ghost); transition: color .7s ease; }
.mark:hover .g, .mark:focus-visible .g { color: var(--ink); }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.top nav a { text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { text-decoration: underline; }

.band {
  display: grid;
  grid-template-columns: var(--label) minmax(0, var(--measure));
  column-gap: 1.5rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--rule);
}
.band > .label { color: var(--soft); padding-top: .32rem; margin: 0; }
.band h2 { font-size: 1.125rem; line-height: 1.5; margin: 0 0 .9rem; }
/* The title of a side. */
.band h2.side { font-size: 1.25rem; line-height: 1.3; margin: 0 0 .7rem; }

.hero {
  position: relative; isolation: isolate;
  border-top: 0; padding: clamp(4.5rem, 16vh, 9.5rem) 0 clamp(4rem, 12vh, 7rem);
}
/* Only the home page's hero holds the record, so only it is made tall enough for one. */
.hero.has-record {
  --d: min(clamp(28.5rem, 51.3vw, 47.5rem), 81.7vh);
  align-content: center; min-height: calc(var(--d) + 1.5rem);
}

/*
 * The record, seen from above, in the empty right-hand side; its far edge
 * runs off the page. The label is a round rug, and the gear stands in a
 * ring around it. The grooves stay in the ghost colour so they are nearly
 * not there. It turns, very slowly, and stops while something on it is
 * pointed at. Robb's head, in the middle, is not part of what turns: it
 * stays pointing up the page.
 * Only the gear takes the pointer; the rest lets it through to the page.
 */
.record {
  position: absolute; z-index: 1;
  width: var(--d); height: var(--d);
  left: calc(var(--label) + 31rem);
  top: 50%; margin-top: calc(var(--d) / -2);
  pointer-events: none;
}
.record svg { display: block; width: 100%; height: 100%; overflow: visible; }
.record .spin { transform-origin: 0 0; animation: turn 140s linear infinite; }
.record.held .spin { animation-play-state: paused; }
.record path, .record circle { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.rec-groove { stroke: var(--ghost); stroke-width: .9; }
.rec-edge { stroke: #b9b3a4; stroke-width: 1.1; }
.rec-text { font-family: var(--typed); font-size: 21px; fill: var(--ink); }
.record .ln, .record .pf { stroke: var(--ink); stroke-width: 1px; transition: stroke .2s ease; }
.record .pf, .record .pp { fill: var(--paper); }
.record .ln.soft { stroke: #a8a294; stroke-width: .8px; }
.record .ln.thick { stroke-width: 2.6px; }
.record .ink { fill: var(--ink); transition: fill .2s ease; }
.record .red { fill: var(--red); }
.record .hit { fill: none; pointer-events: all; }
@keyframes turn { to { transform: rotate(360deg); } }

/* A thing on the record you can point at goes red, like a link. */
/* While the pop-up notes are switched off the record is a plain picture, and nothing on it reacts. */
.record svg[role="img"] .thing { pointer-events: none; cursor: default; }
.thing { cursor: pointer; outline: none; pointer-events: auto; }
.thing:hover .ln:not(.soft), .thing.on .ln:not(.soft), .thing:focus-visible .ln:not(.soft) { stroke: var(--red); }
.thing:hover .ink, .thing.on .ink, .thing:focus-visible .ink { fill: var(--red); }

/* Its note: the photograph lands on the drawing, with a name and a line. */
.gear-note {
  position: absolute; left: 0; top: 0; z-index: 3;
  pointer-events: none; opacity: 0; transform: scale(.7);
  transition: opacity .22s ease, transform .28s ease;
}
.gear-note.show { opacity: 1; transform: none; }
.gear-note img { display: block; width: 100%; height: auto; }
.gear-note .nophoto {
  display: grid; place-items: center; aspect-ratio: 16 / 7;
  border: 1px dashed rgba(23, 22, 20, .45); background: var(--paper); color: var(--soft);
  font: 400 .76rem/1.7 var(--typed);
}
.gear-note .cap { background: var(--paper); padding: .55rem .5rem .45rem 0; }
.gear-note .nm { margin: 0; font: 400 .82rem/1.6 var(--typed); letter-spacing: .01em; }
.gear-note .tx { margin: .1rem 0 0; font-size: 1rem; line-height: 1.4; }

/* A red pencil under the words, as on a proof. */
.pen { position: relative; white-space: nowrap; }
.pen::after {
  content: ""; position: absolute; left: -1.5%; right: -2.5%; bottom: -.1em; height: .2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath fill='%23b23a22' d='M2 7.4C38 3.6 92 8.8 150 6.2 204 3.9 252 7.6 298 4.8 252 9.3 205 6.1 151 8 93 10.4 40 5.8 3 8.6Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.hero h1 {
  font-size: clamp(2.3rem, 6.4vw, 4.3rem);
  line-height: 1.02; letter-spacing: -.015em;
  margin: 0 0 1.4rem; max-width: 12.5em; text-wrap: balance;
}
.hero p { max-width: 26em; }
.hero .go { margin-top: 1.6rem; }
.hero .go a + a { margin-left: 1.4rem; }

/* A track list: code, title, dotted leader, value. */
.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: flex; align-items: baseline; gap: .7rem; padding: .4rem 0; }
.tracks .code { flex: none; width: 2.3rem; color: var(--soft); }
.tracks .lead {
  flex: 1; min-width: 1.5rem;
  border-bottom: 1px dotted rgba(23, 22, 20, .5);
  transform: translateY(-.32em);
}
.tracks .val { white-space: nowrap; }
.tracks.steps li { align-items: baseline; }
.after-list { margin-top: 1.2rem; color: var(--soft); }
.tbd { color: var(--soft); }
/*
 * A number inside words set in the book face: typed, at nearly the size of
 * the words, and set a little closer together than a typewriter would, so
 * it sits in the line without looking small or loud. The line height is
 * fixed so a number never pushes its line apart from the others.
 */
.num { font-family: var(--typed); font-size: .98em; letter-spacing: -.06em; margin-right: .06em; line-height: 1; }


.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 2rem;
  border-top: 1px solid var(--rule); padding: 1.6rem 0 2.6rem; color: var(--soft);
}

/* Mix check */
.drop {
  display: block; cursor: pointer;
  border: 1px dashed rgba(23, 22, 20, .55);
  padding: 2.4rem 1.4rem;
}
.drop.over { border-style: solid; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop u { text-decoration-thickness: 1px; text-underline-offset: .2em; }
.under-drop { margin-top: .8rem; color: var(--soft); }
#status { margin-top: 1.6rem; min-height: 1.7em; }
#status.error { color: var(--red); }

#results[hidden] { display: none; }
.fileline { color: var(--soft); margin: 0 0 .5rem; overflow-wrap: anywhere; text-transform: none; }
.band h2.verdict {
  font-size: clamp(1.9rem, 4.8vw, 2.9rem); line-height: 1.06; letter-spacing: -.01em;
  margin: 0 0 1.8rem; text-wrap: balance;
}
.verdict.fix { color: var(--red); }
.report .name { flex: none; }
.report .val { text-transform: none; }
/*
 * Numbers are always typed. The book face has old-style figures whose "1"
 * reads as a capital I, which is charming in a sentence and wrong in a
 * measurement or a price.
 */
.checks { list-style: none; margin: 2rem 0 0; padding: 0; }
.checks li {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); column-gap: .7rem;
  padding: .8rem 0; border-top: 1px solid var(--rule);
}
.checks .tag, .checks h3, .checks p { font: 400 .82rem/1.65 var(--typed); letter-spacing: .01em; }
.checks .tag { color: var(--soft); }
.checks .fix .tag { color: var(--red); }
.checks h3 { margin: 0; }
.checks p { margin: .1rem 0 0; color: var(--soft); }
.next { margin-top: 2.6rem; }
.fine { margin-top: 1.4rem; color: var(--soft); }

.signoff { display: inline-flex; align-items: flex-end; gap: .6rem; }
.ghostmark { width: 1.15rem; height: auto; flex: none; transform: translateY(-.15rem) rotate(-4deg); }
.ghostmark path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ghostmark .eye { fill: currentColor; }

/*
 * No room beside the text: the record gets its own space under it, whole,
 * because the gear on it is there to be looked at.
 */
@media (max-width: 1180px) {
  .hero.has-record { --d: min(95%, 36rem); min-height: 0; padding-bottom: 3rem; }
  .record {
    position: relative; left: auto; top: auto; margin: 3rem auto 0;
    grid-column: 1 / -1; grid-row: 2; height: auto; aspect-ratio: 1;
  }
}
@media (max-width: 700px) {
  .band { grid-template-columns: minmax(0, 1fr); row-gap: .8rem; padding: 2.2rem 0; }
  .hero { padding-top: 3.5rem; }
  .hero .go a { display: inline-block; }
  .hero.has-record { padding-bottom: 2.5rem; }
  /*
   * On a phone the record is not shrunk: it takes nearly the whole width of
   * the screen, a little wider than the words, so the gear is as large as
   * it can be. Each unit is its outline in ink with the knobs drawn finer
   * inside it, which keeps it from turning into a smudge at this size.
   */
  .hero.has-record { --d: calc(100% + var(--gutter)); }
  .record { grid-row: 3; margin: 1.5rem 0 0 calc(var(--gutter) / -2); }
  /* The lettering under the gear is too small to read on a phone; the note that opens carries the name. */
  .record .ttl { display: none; }
  .record .ln, .record .pf { stroke-width: .7px; }
  .record .unit .ln { stroke-width: .45px; }
  .record .unit .ln.frame { stroke-width: .85px; }
  .record .ln.soft, .rec-groove { stroke-width: .6px; }
  .record .ln.thick { stroke-width: 1.6px; }
}
@media (prefers-reduced-motion: reduce) {
  .mark .g { transition: none; }
  .record .spin { animation: none; }
  .gear-note { transition: none; transform: none; }
}
@media print { html { background: #fff; } }

/*
 * The project calculator. It is set like the track lists on the home page:
 * a typed label at the left, a question, then short rows with a dotted
 * leader running to the price. Every row has the same parts in the same
 * places: a square control, a title in the book face, the leader, the price
 * in the typewriter face, and under the title a typed line where one is
 * needed. Every figure is typed. The price is a typed slip: beside the
 * questions on a wide screen, and on a narrow one its total rides along the
 * bottom until you reach it. It is kept short on purpose.
 */
.hero.slim { padding: 2.6rem 0 1.5rem; }
.hero.slim h1 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); margin: 0; }

.band.step { padding: 1.5rem 0; }
.step h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 .15rem; }
.step .help { font-size: 1rem; margin: 0 0 .7rem; color: var(--soft); }
.band.step > .label { padding-top: .7rem; }
.intake .band.step > .label { padding-top: .3rem; }

/* How many songs: the counter, the slider as the line, the price a song. */
.count { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; padding: .25rem 0 .1rem; }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button {
  flex: none; width: 1.7rem; height: 1.7rem; padding: 0; cursor: pointer;
  font: 400 1rem/1 var(--typed); color: var(--ink);
  background: none; border: 1px solid var(--ink); border-radius: 0;
}
.stepper button:hover:not(:disabled) { color: var(--paper); background: var(--ink); }
.stepper button:disabled { color: var(--ghost); border-color: var(--ghost); cursor: default; }
.stepper output { min-width: 2.2rem; text-align: center; font: 400 1.5rem/1 var(--typed); }
.intake input[type="range"] {
  flex: 1 1 9rem; min-width: 0; height: 1.7rem; margin: 0; padding: 0;
  -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer;
}
.intake input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
.intake input[type="range"]::-moz-range-track { height: 1px; background: var(--ink); }
.intake input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: .6rem; height: 1.2rem; margin-top: -.6rem;
  background: var(--ink); border: 0; border-radius: 0;
}
.intake input[type="range"]::-moz-range-thumb { width: .6rem; height: 1.2rem; background: var(--ink); border: 0; border-radius: 0; }
.intake .rate { flex: none; min-width: 5.6rem; margin: 0; text-align: right; font-size: .8rem; text-transform: none; }

/* A row to tick: box, title, leader, price; a typed line under the title where one is needed. */
.pick {
  display: grid; grid-template-columns: auto minmax(0, auto) minmax(1.5rem, 1fr) auto;
  column-gap: .7rem; align-items: baseline; padding: .36rem 0; cursor: pointer;
}
.pick input {
  -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer;
  width: 1.05rem; height: 1.05rem; padding: 3px; border: 1px solid var(--ink); border-radius: 0;
  background: none; transform: translateY(.14em);
}
.pick input:checked { background: var(--ink) content-box; }
.pick .lead { border-bottom: 1px dotted rgba(23, 22, 20, .5); transform: translateY(-.32em); }
.pick .d, .pick .cost, .minis { font: 400 .8rem/1.6 var(--typed); letter-spacing: .01em; color: var(--soft); }
.pick .cost { white-space: nowrap; }
.pick .d, .minis { grid-column: 2 / -1; }
.pick:hover .t { color: var(--red); }
/*
 * A row that holds several small choices. Same parts as every other row;
 * its typed line is the choices, each with a small box of its own.
 */
.pick.group { cursor: default; }
.pick.group:hover .t { color: inherit; }
.pick.group .t { cursor: pointer; }
.pick.group .t:hover { color: var(--red); }
.minis { display: flex; flex-wrap: wrap; gap: 0 1.3rem; }
.mini { display: inline-flex; align-items: baseline; gap: .45rem; padding: .05rem 0; cursor: pointer; }
.pick .mini input { width: .72rem; height: .72rem; padding: 2px; border-color: var(--soft); transform: translateY(.06em); }
.pick .mini input:checked { border-color: var(--ink); }
.mini:has(input:checked) { color: var(--ink); }
.mini:hover { color: var(--red); }
.pick input:checked ~ .cost { color: var(--ink); }
.pick input:focus-visible, .stepper button:focus-visible, .intake input[type="range"]:focus-visible,
.fields input:focus-visible, .intake button[type="submit"]:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.slip .tracks li { padding: .12rem 0; font: 400 .8rem/1.6 var(--typed); letter-spacing: .01em; }
.slip .tracks .lead { transform: translateY(-.28em); }
.slip-lines > p { margin: 0 0 .35rem; }
/* Nothing to add up yet: the list is put away and the total stands alone. */
.slip.single .slip-lines { display: none; }
.tally { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0; border-top: 1px solid var(--ink); }
.tally output { font: 400 1.9rem/1 var(--typed); }

/* Shared with the contact form. */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 1.6rem; }
.fields .wide { grid-column: 1 / -1; }
.fields label { display: block; }
.fields input {
  display: block; width: 100%; margin-top: .2rem; padding: .5rem 0;
  font: 400 1.05rem/1.5 var(--typed); color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid rgba(23, 22, 20, .55); border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
/* On both forms each blank is one typed line to fill in: its name, then the rule to write on. */
.intake .fields, .plain .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem 1.6rem; padding-top: .2rem; }
.intake .fields label, .plain .fields label {
  display: flex; align-items: baseline; gap: .7rem; white-space: nowrap;
  font: 400 .8rem/1.6 var(--typed); letter-spacing: .01em; text-transform: lowercase; color: var(--soft);
}
.intake .fields input, .plain .fields input {
  flex: 1 1 0; width: 0; min-width: 0; margin: 0; padding: .28rem 0;
  font-size: 1rem; letter-spacing: 0; text-transform: none;
}
.intake button[type="submit"] {
  display: inline-block; margin-top: 1.25rem; padding: 0 0 .05em; cursor: pointer; text-align: left;
  font: 400 1.25rem/1.3 var(--book); color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
}
.intake button[type="submit"]:hover { color: var(--red); border-color: var(--red); }
/* One blank to a row. */
.intake .fields.stacked { grid-template-columns: minmax(0, 1fr); }
.intake .said { min-height: 1.7em; margin: .7rem 0 0; }
.intake .said.need { color: var(--red); }

@media (min-width: 1181px) {
  .intake {
    display: grid; align-items: start; column-gap: clamp(2rem, 4vw, 4.5rem);
    grid-template-columns: minmax(0, calc(var(--label) + 1.5rem + var(--measure))) minmax(14rem, 18rem);
  }
  .intake > .step { grid-column: 1; }
  .slip { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 1.5rem; margin-top: 1.8rem; }
  .slip-lines { margin-bottom: .7rem; }
}
@media (max-width: 1180px) {
  /* The slip's parts sit in the page one after another, so its total can ride the bottom of the screen. */
  .slip { display: contents; }
  .slip-lines { padding: 1.5rem 0 .7rem; border-top: 1px solid var(--rule); }
  .tally {
    position: sticky; bottom: 0; z-index: 2; background: var(--paper);
    margin: 0 calc(var(--gutter) * -1); padding: .6rem var(--gutter);
  }
}
@media (max-width: 700px) {
  .hero.slim { padding: 2rem 0 1.2rem; }
  .band.step { padding: 1.3rem 0; row-gap: .3rem; }
  .band.step > .label, .intake .band.step > .label { padding-top: 0; }
  /* The counter and its price share a line; the slider takes the next one to itself. */
  .count .rate { margin-left: auto; }
  .intake input[type="range"] { order: 3; flex-basis: 100%; }
  /* No room for a leader: the price sits at the right of the title. */
  .pick { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pick .lead { display: none; }
  .fields, .intake .fields, .plain .fields { grid-template-columns: minmax(0, 1fr); }
}

/*
 * The contact form: a name, an email, a message, and a line to press. It is
 * set like the calculator (small title, typed labels, the same button). The
 * message has a box to write in, under its label.
 */
.plain .fields label.wide { display: block; margin-top: .3rem; }
.plain .fields textarea {
  display: block; width: 100%; min-height: 7.5rem; margin-top: .3rem; padding: .5rem .6rem; resize: vertical;
  font: 400 1rem/1.5 var(--typed); letter-spacing: 0; text-transform: none; white-space: pre-wrap; color: var(--ink);
  background: none; border: 1px solid rgba(23, 22, 20, .55); border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.plain .fields textarea:focus-visible, .plain button[type="submit"]:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.plain button[type="submit"] {
  display: inline-block; margin-top: 1.25rem; padding: 0 0 .05em; cursor: pointer; text-align: left;
  font: 400 1.25rem/1.3 var(--book); color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
}
.plain button[type="submit"]:hover { color: var(--red); border-color: var(--red); }
.plain button[disabled], .intake button[type="submit"][disabled] { color: var(--soft); border-color: transparent; cursor: default; }
.plain .said { min-height: 1.7em; margin: .7rem 0 0; }
.plain .said.need { color: var(--red); }
/* A form whose blanks carry track codes, like the rows of the other sides:
   one blank to a row, and everything under them lines up with the words. */
.plain.coded .fields { grid-template-columns: minmax(0, 1fr); }
.plain.coded .fields .code { flex: none; width: 2.3rem; }
.plain.coded .fields label.wide { display: flex; flex-wrap: wrap; }
.plain.coded .fields textarea { flex: none; width: calc(100% - 3rem); margin-left: 3rem; }
.plain.coded button[type="submit"], .plain.coded .said { margin-left: 3rem; }
.said.soft { color: var(--soft); }
