/* helmburgher.com — one stylesheet for every page. */

/* ---------- fonts (self-hosted, no third-party requests) ---------- */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323';
  src: url('../fonts/vt323-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'VT323';
  src: url('../fonts/vt323-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */

:root {
  --ground: #0a0a0a;

  /* Cool, so the warm accent stays legible as an accent beside it. A warm
     text colour and the sand sat too close to read as two things. */
  --text: #DDE0E4;

  --sand: #E0D5AC;     /* the accent, sampled from the Don't Make Art cover */
  --pink: #E0578F;     /* Lost and Found */

  /* The artist colour: the wordmark, and any page with no release colour of
     its own. Change the value here and nothing else needs editing. */
  --artist: var(--sand);
  --grey: #5f5d58;
  --dim: #4a4844;
  --hairline: #1e1c1a;

  /* per-page release colour; the wordmark ignores this and uses --artist */
  --accent: var(--artist);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bitmap: 'VT323', 'JetBrains Mono', monospace;

  --measure: 42rem;
}

body.release-sand { --accent: var(--sand); }
body.release-pink { --accent: var(--pink); }

/* ---------- reset-ish ---------- */

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--hairline); }
a:hover, a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }

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

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 0;
}

.section { margin: 0 0 4.5rem; }

.label {
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
  margin: 0 0 1.25rem;
}

/* ---------- wordmark ---------- */

.wordmark {
  font-family: var(--bitmap);
  font-weight: 400;
  color: var(--artist);          /* the artist colour, every page */
  font-size: clamp(3.25rem, 15vw, 6rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  margin: 0;
}
a.wordmark { border: 0; display: inline-block; }
a.wordmark:hover, a.wordmark:focus-visible { color: var(--artist); border: 0; }

.epigraph {
  color: var(--grey);
  font-size: 0.8125rem;
  margin: 0.75rem 0 0;
}

.masthead { margin-bottom: 4.5rem; }
.masthead-compact { margin-bottom: 3.25rem; }

/* ---------- releases (home) ---------- */

.releases { list-style: none; margin: 0; padding: 0; }

.release-item + .release-item { margin-top: 2.25rem; }
.release-item.is-sand { --accent: var(--sand); }
.release-item.is-pink { --accent: var(--pink); }

.release-link {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1.125rem;
  align-items: center;
  border: 0;
}
.release-link img { border: 1px solid var(--hairline); }
.release-title { font-weight: 500; }
.release-meta { color: var(--grey); font-size: 0.8125rem; }
.release-link:hover .release-title,
.release-link:focus-visible .release-title { color: var(--accent); }

/* ---------- newsletter ---------- */

.newsletter-note { color: var(--grey); font-size: 0.8125rem; margin: 0 0 1rem; }

.newsletter-form { display: flex; flex-wrap: wrap; gap: 0.625rem; }

.newsletter-form input[type="email"] {
  flex: 1 1 15rem;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 0.625rem 0.75rem;
  border-radius: 0;
}
.newsletter-form input[type="email"]::placeholder { color: var(--dim); }
.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}
.newsletter-form button[type="submit"] {
  border: 1px solid var(--hairline);
  padding: 0.625rem 1.125rem;
  color: var(--grey);
}
.newsletter-form button[type="submit"]:hover,
.newsletter-form button[type="submit"]:focus-visible { color: var(--accent); border-color: var(--accent); }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- contact ---------- */

.contact-email { font-size: 1rem; }
.contact-note { color: var(--grey); font-size: 0.8125rem; margin: 0.375rem 0 0; }

/* ---------- release pages ---------- */

.release-heading {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--accent);
  margin: 0;
}
.release-sub { color: var(--grey); font-size: 0.8125rem; margin: 0.375rem 0 0; }

/* min() so the class can't override the base img max-width:100% and push the
   cover past the page gutter on a narrow screen */
.cover { max-width: min(22rem, 100%); border: 1px solid var(--hairline); }

.tracklist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.tracklist-head .label { margin: 0; }

.backwards {
  font-size: 0.8125rem;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.backwards:hover, .backwards:focus-visible { border-bottom-color: var(--accent); }

.tracklist { list-style: none; margin: 0; padding: 0; }

.track {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0 1rem;
  align-items: start;
  padding: 0.625rem 0;
}
.track + .track { border-top: 1px solid var(--hairline); }
.track-num { color: var(--dim); font-variant-numeric: tabular-nums; }
/* ---------- bio (home) ---------- */

.bio p { margin: 0 0 1.125rem; }
.bio p:last-child { margin-bottom: 0; }
.bio em { font-style: italic; }

/* ---------- credits ---------- */

/* Reference information, not display: small, quiet, and read as a record.
   Field-and-value like the LOGGED block — name in the first column, roles in
   the second, where a long role list wraps against the value column's edge. */
.credits {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--grey);
}

.credits-release { margin: 0 0 1.25rem; }

.credits-people {
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 1.5rem;
}
.credits-people dt { color: var(--text); }
.credits-people dd { margin: 0; color: var(--grey); }

.credits-group { margin: 0 0 1.25rem; }
.credits-group:last-child { margin-bottom: 0; }
.credits-group p { margin: 0; }

@media (max-width: 26rem) {
  .credits-people { gap: 0 1rem; }
}

/* ---------- polaroid stack ---------- */

.stack-section { margin-top: -1.5rem; }

.stack {
  position: relative;
  display: block;
  width: min(100% - 2rem, 20rem);
  aspect-ratio: 800 / 920;
  margin: 0 0 0 1rem;      /* room for the cards that lean left */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stack:focus-visible { outline: 2px solid var(--accent); outline-offset: 14px; }

/* The pose is set by JS as custom properties rather than a whole transform,
   so hover can add a lift without clobbering the card's place in the stack. */
.stack-card {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 60%;
  transform:
    translate(var(--tx, 0px), calc(var(--ty, 0px) + var(--lift, 0px)))
    rotate(var(--rot, 0deg));
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

/* Hovering fans the stack apart a little — enough to read as several cards
   you can touch, without captioning it. */
.stack:hover .stack-card,
.stack:focus-visible .stack-card {
  --lift: calc(var(--depth, 0) * -2px);
  --tx: calc(var(--bx, 0px) + var(--depth, 0) * 2px);
}
.stack:hover .stack-card[data-top="true"],
.stack:focus-visible .stack-card[data-top="true"] { --lift: -6px; }
.stack-card picture { display: block; width: 100%; height: 100%; }
.stack-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.stores { list-style: none; margin: -0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }

/* inline-block + vertical padding so the tap target clears ~40px on a phone;
   the rule is carried by text-decoration instead of a border, which would
   otherwise sit at the padding edge and float away from the word */
.stores a {
  font-size: 0.875rem;
  display: inline-block;
  padding: 0.5rem 0;
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 4px;
}
.stores a:hover, .stores a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- LOGGED block ---------- */

.logged {
  font-family: var(--bitmap);
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 5rem 0 0;
  padding: 1.25rem 0 3.5rem;
  border-top: 1px solid var(--hairline);
}
.logged-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
}
.logged-label, .logged-city { color: var(--grey); }
.logged-time {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- making-of ---------- */

body.making-of { --measure: 44rem; }

.mo-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 40;
  pointer-events: none;
}
.mo-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.mo-datemark {
  position: fixed;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 40;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--grey);
  background: var(--ground);
  padding: 0.1875rem 0.5rem;
  border: 1px solid var(--hairline);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.2s linear;
}
.mo-datemark.is-visible { opacity: 1; }

.mo-intro p { margin: 0 0 1.125rem; }
.mo-intro p:last-child { margin-bottom: 0; }

.mo-nav { margin: 3rem 0; }
.mo-nav-list { list-style: none; margin: 0; padding: 0; }
.mo-nav-list li + li { margin-top: 0.25rem; }
.mo-nav-list a {
  display: block;
  border: 0;
  color: var(--grey);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.1875rem 0;
}
.mo-nav-list a:hover { color: var(--text); }
.mo-nav-list a[aria-current="true"] { color: var(--accent); }
.mo-nav-num { color: var(--dim); margin-right: 0.625rem; font-variant-numeric: tabular-nums; }

.chapter-head {
  margin: 4.5rem 0 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 1.5rem;
}
#ch-1 .chapter-head { border-top: 0; padding-top: 0; margin-top: 1rem; }
.chapter-n {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--dim);
}
.chapter-title {
  margin: 0.375rem 0 0;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}
/* Reads as a break in the conversation, not as a message. Same treatment as a
   section label, with room around it to do the separating. */
.datesep {
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--grey);
  margin: 3rem 0 1.75rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1.25rem;
}
/* Defensive: a separator is suppressed at a chapter start, so this should
   never match. If one ever did, it would double up with the chapter rule. */
.chapter-head + .chunk .datesep:first-child,
.chunk:first-of-type .datesep:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.chapter-span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--grey);
}

/* no content-visibility: skipped rendering made scrolling feel unpredictable.
   Lazy chunk building already keeps the initial cost down. */

.msg {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0 0.75rem;
  margin: 0 0 1.5rem;
}
.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 0.3125rem;
  background: var(--hairline);
}
.msg-body { min-width: 0; }
.msg-meta {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.msg-who { color: var(--grey); }
.msg-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-text a { color: var(--accent); border-bottom-color: var(--hairline); }

.msg audio {
  display: block;
  width: 100%;
  max-width: 21rem;
  margin-top: 0.5rem;
  height: 34px;
  color-scheme: dark;
}
.msg-image {
  margin-top: 0.5rem;
  max-width: 16rem;
  border: 1px solid var(--hairline);
}

.event {
  margin: 2.5rem 0;
  padding: 0.875rem 0 0.875rem 0.9375rem;
  border-left: 2px solid var(--hairline);
}
.event-date {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--dim);
}
.event-label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--grey);
  margin-top: 0.125rem;
}
.event-sub, .event-times {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-top: 0.125rem;
}
.event-zoom { border-left-color: var(--grey); }
.event-zoom .event-label { color: var(--text); }
.event-trip .event-label,
.event-show .event-label { color: var(--text); }
.event-milestone { border-left-color: var(--accent); }
.event-milestone .event-label { color: var(--accent); }

.mo-end { margin: 4rem 0 0; padding-top: 2rem; border-top: 1px solid var(--hairline); }

.to-top {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--grey);
  border: 0;
}
.to-top:hover, .to-top:focus-visible { color: var(--accent); }

.mo-status { color: var(--grey); font-size: 0.8125rem; }

/* ---------- desktop ---------- */

@media (min-width: 62rem) {
  body.making-of .wrap { max-width: 68rem; padding-left: 2rem; padding-right: 2rem; }

  .mo-layout {
    display: grid;
    grid-template-columns: 15rem 1fr;
    gap: 0 3.5rem;
    align-items: start;
  }
  .mo-nav {
    position: sticky;
    top: 2.5rem;
    margin: 0;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }
  .mo-timeline { min-width: 0; }
  .mo-intro, .mo-head, .mo-logged { max-width: 44rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .mo-datemark { transition: none; }
}

/* ---------- utility ---------- */

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .stack-card { transition: none; }
}

/* ---------- 404 ---------- */

.notfound-note { color: var(--grey); margin: 0.5rem 0 2rem; }

/* ---------- newsletter confirmation ---------- */

/* Replaces the field and button once the post succeeds. */
.newsletter-done { margin: 0; }
.newsletter-done:focus { outline: none; }
.newsletter-done:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.newsletter-error {
  color: var(--grey);
  font-size: 0.8125rem;
  margin: 0.75rem 0 0;
}
.newsletter-error a { color: var(--accent); }
