/* ---------------------------------------------------------------
   Frome Moog Coop
   Plain and structural. No web fonts, no images, no decoration.
   Texture comes from the character grid: a faint dot ground,
   dotted rules, and dotted leaders out to the durations.

   To make the set notes monospace too, change --body below to
   var(--mono). Nothing else needs touching.
   --------------------------------------------------------------- */

:root {
  --paper: #f2f0eb;
  --paper-deep: #e6e3dc;
  --ink: #1a1a18;
  --ink-soft: #5c5a55;
  --rule: #c6c3bb;
  --patch: #c0342f;
  --dot: rgba(26, 26, 24, 0.07);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --body: var(--sans);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --rail: 6.5rem;
  --measure: 36rem;
  --max: 62rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 8px 8px;
  background-position: -1px -1px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
}

a { color: var(--patch); text-underline-offset: 0.2em; }
a:hover { text-decoration: none; background: var(--paper-deep); }

:focus-visible { outline: 2px solid var(--patch); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter); top: 0.5rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.4rem 0.8rem;
}

/* --- Labels ------------------------------------------------------- */

.label,
.masthead__name,
.masthead__nav a,
.thesis__eyebrow,
.ledger__head,
.pager .label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 400;
  font-size: 11px;
}

/* --- Masthead ---------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--ink);
}

.masthead__name { color: var(--ink); text-decoration: none; }
.masthead__name::before { content: "> "; color: var(--patch); }
.masthead__name:hover { background: var(--paper-deep); }

.masthead__nav { display: flex; gap: 1.25rem; }
.masthead__nav a { color: var(--ink-soft); text-decoration: none; }
.masthead__nav a:hover { color: var(--patch); background: none; }

/* --- Thesis ------------------------------------------------------ */

.thesis {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px dotted var(--rule);
}

.thesis__eyebrow {
  margin: 0 0 1.5rem;
  color: var(--patch);
}

.thesis__statement {
  margin: 0;
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(1.1rem, 3.4vw, 1.65rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 26ch;
}

/* --- Spine ------------------------------------------------------- */

.spine {
  display: flex;
  gap: 1px;
  height: 2rem;
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 0.85rem;
  padding: 2px;
  border: 1px solid var(--rule);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 4px 4px;
}

.spine__seg {
  position: relative;
  display: block;
  min-width: 2px;
  background: var(--ink);
  transition: background 100ms linear;
}
.spine__seg:last-child { background: var(--patch); }
.spine__seg:hover { background: var(--patch); }

.spine__seg::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.25rem 0.45rem;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.spine__seg:hover::after { opacity: 1; }

.thesis__count {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}
.thesis__count strong {
  font-weight: 400;
  color: var(--ink);
  background: var(--paper-deep);
  padding: 0.1rem 0.4rem;
}

.thesis__blurb {
  margin: 0;
  max-width: var(--measure);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* --- Ledger ------------------------------------------------------ */

.ledger {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(2.5rem, 6vw, 4rem);
}

.ledger__head {
  margin: 2rem 0 0;
  color: var(--ink-soft);
}

.crumb { margin: 2rem 0 0; }

.entry {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 clamp(1.25rem, 3vw, 2.25rem);
  padding: 1.75rem 0;
  border-top: 1px dotted var(--rule);
}
.ledger__head + .entry {
  border-top: 1px solid var(--ink);
  margin-top: 0.85rem;
}

.entry__rail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--ink-soft);
  font-size: 12px;
}

.entry__no {
  color: var(--patch);
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.entry__no::before { content: "["; }
.entry__no::after { content: "]"; }

.entry__body { max-width: var(--measure); }

.entry__venue {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
}
.entry__venue::after {
  content: "";
  flex: 1 1 auto;
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.25em);
}
.entry__venue a { color: var(--ink); text-decoration: none; }
.entry__venue a:hover { color: var(--patch); background: none; }

.entry__town {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.entry__figure { margin: 1.25rem 0 0; }
.entry__figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.entry__figure figcaption {
  margin-top: 0.45rem;
  font-size: 11px;
  color: var(--ink-soft);
}

.entry__note {
  margin-top: 1.25rem;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.entry__note p { margin: 0 0 0.9em; }
.entry__note p:last-child { margin-bottom: 0; }

.entry__meta {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}
.entry__meta .label { color: var(--ink); margin-right: 0.5rem; }

.entry__pending {
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}
.entry__pending::before { content: "// "; }

/* --- Player ------------------------------------------------------ */

.player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.player__toggle {
  flex: none;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.player__toggle:hover { background: var(--paper-deep); }

.player__icon {
  width: 0; height: 0;
  border-left: 0.5rem solid var(--patch);
  border-top: 0.32rem solid transparent;
  border-bottom: 0.32rem solid transparent;
  margin-left: 0.1rem;
}
.player.is-playing .player__toggle { background: var(--ink); }
.player.is-playing .player__icon {
  width: 0.45rem; height: 0.6rem; margin-left: 0; border: 0;
  border-left: 0.15rem solid var(--patch);
  border-right: 0.15rem solid var(--patch);
}

.player__track {
  position: relative;
  flex: 1 1 auto;
  height: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.player__track::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  border-bottom: 1px dotted var(--rule);
}
.player__fill {
  position: absolute;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--patch);
}
.player__head {
  position: absolute;
  left: 0;
  width: 1px;
  height: 0.85rem;
  background: var(--patch);
}

.player__time {
  flex: none;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 4.5ch;
  text-align: right;
  font-size: 12px;
}

/* --- Pager ------------------------------------------------------- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dotted var(--rule);
}
.pager__link { text-decoration: none; color: var(--ink); max-width: 20ch; }
.pager__link:hover { color: var(--patch); background: none; }
.pager__link--next { margin-left: auto; text-align: right; }
.pager .label { display: block; color: var(--ink-soft); margin-bottom: 0.2rem; }

/* --- Prose pages ------------------------------------------------- */

.prose {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
}
.prose h1 {
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(1.1rem, 3.4vw, 1.5rem);
  line-height: 1.3;
}
.prose h1::before { content: "# "; color: var(--patch); }
.prose h2 {
  margin: 2rem 0 0.6rem;
  font-family: var(--mono);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--patch);
}
.prose p,
.prose li {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
}
.prose p { margin: 0 0 1.1em; }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 1px solid var(--patch);
  color: var(--ink-soft);
}

.empty { padding: 2.5rem 0; color: var(--ink-soft); }
.empty::before { content: "// "; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 0.1em 0.3em;
}

/* --- Footer ------------------------------------------------------ */

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--ink);
  color: var(--ink-soft);
  font-size: 12px;
}
.footer__line { margin: 0 0 0.3rem; }
.footer__line--quiet { color: var(--rule); }

/* --- Small screens ----------------------------------------------- */

@media (max-width: 42rem) {
  .entry { grid-template-columns: 1fr; gap: 0.6rem; }
  .entry__rail { flex-direction: row; align-items: baseline; gap: 0.85rem; }
  .entry__no { margin-bottom: 0; }
  .spine__seg::after { display: none; }
  .pager__link { max-width: 12ch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
