/* ==========================================================================
   Jimmy Svensson — artist site
   Black on white. Rules, borders and space do the work.
   Typeface: IBM Plex Mono, the family loaded by jimmysvensson.info
   (Regular 400 / Bold 700, the two weights its stylesheet declares).
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  --ink-soft: #333333;
  --rule: #000000;
  --rule-hair: rgba(0, 0, 0, 0.22);

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 66ch;

  /* Height of the sticky masthead. Anchor jumps use it so a section's top
     rule meets the navbar instead of floating below it. */
  --masthead-h: 52px;

  --step: 1.6rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
}

/* ── reset ───────────────────────────────────────────────────────────────── */

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

html {
  font-feature-settings: "zero" 1;
  font-variant-numeric: slashed-zero;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:visited { color: var(--ink); }

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

.visually-hidden {
  position: absolute !important;
  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;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 13px;
}
.skip:focus { left: 12px; top: 12px; }

/* ── shared type ─────────────────────────────────────────────────────────── */

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(56px, 8vh, 104px) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--masthead-h) - 1px);
}
/* Home sits below the masthead in the flow, so its offset has to cancel the
   masthead out for the jump to land at the very top of the page. */
.section--home { border-top: 0; padding-top: clamp(40px, 7vh, 84px); scroll-margin-top: var(--masthead-h); }
/* The last section needs room below it, or the page runs out before it can
   be scrolled to the top of the viewport. */
.section--contact { min-height: calc(100vh - var(--masthead-h)); }

.section__no {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 clamp(28px, 4vw, 44px);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.section__no::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  transform: translateY(-0.3em);
}
.section__no-label { font-weight: 400; color: var(--ink-soft); }

.section__title {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.section__intro {
  max-width: var(--measure);
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 clamp(32px, 5vw, 56px);
}

.subhead {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.subhead--spaced { margin-top: 36px; }

.ext { font-size: 0.8em; margin-left: 0.15em; }

/* ── masthead ────────────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 13px var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

/* From 1240px up the outer margin is wide enough to hold the floating
   player, so the player never sits on top of the text. */
@media (min-width: 1240px) {
  .shell,
  .masthead__inner {
    padding-right: calc(var(--gutter) + 452px);
  }
}

.masthead__mark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.masthead__mark:hover { text-decoration: underline; text-underline-offset: 4px; }

.masthead__list {
  display: flex;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.masthead__list a {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.masthead__list a:hover { border-bottom-color: var(--rule); }

/* ── 01 · home ───────────────────────────────────────────────────────────── */

.hero__title {
  font-size: clamp(2.2rem, 6.4vw, 5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0 0 clamp(24px, 3.5vw, 36px);
}

.hero__lead {
  font-size: clamp(1.05rem, 2.1vw, 1.4rem);
  line-height: 1.45;
  margin: 0 0 10px;
  max-width: var(--measure);
}

/* ── 02 · featured release ───────────────────────────────────────────────── */

.feature__head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 20px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.feature__title {
  font-size: clamp(2rem, 5.4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.feature__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.feature__grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.feature__art { margin: 0; }
.feature__frame {
  display: block;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.feature__frame img {
  width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(1.03);
}
.feature__body { max-width: 60ch; }
.feature__body p { margin: 0 0 18px; }
.feature__body p:last-child { margin-bottom: 0; }

/* ── 03 · music ──────────────────────────────────────────────────────────── */

.covers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.6vw, 28px);
  margin: 0 0 clamp(40px, 6vw, 64px);
  max-width: 940px;
}
.cover__link { text-decoration: none; display: block; }
.cover__frame {
  display: block;
  border: 1px solid var(--rule);
  background: var(--paper);
  margin-bottom: 12px;
  overflow: hidden;
}
.cover__img {
  width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(1.03);
  transition: opacity 0.3s var(--ease), transform 0.6s var(--ease);
}
.cover__link:hover .cover__img { transform: scale(1.025); }
.cover__title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  border-bottom: 1px solid transparent;
}
.cover__link:hover .cover__title { border-bottom-color: var(--rule); }
.cover__meta {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

.catalogue {
  border-top: 1px solid var(--rule);
  max-width: 1000px;
}
.release {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0 11px;
  border-bottom: 1px solid var(--rule-hair);
  transition: background-color 0.2s var(--ease);
}
.release:hover { background: rgba(0, 0, 0, 0.045); }
.release__title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}

/* The three platform marks: Bandcamp, Spotify, Apple Music. */
.release__links {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: none;
}
.platform {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.platform:hover { border-bottom-color: var(--rule); }
.platform__icon {
  display: block;
  fill: currentColor;
  stroke: currentColor;
  overflow: visible;
}
.platform--bandcamp .platform__icon { fill: currentColor; stroke: none; }
.platform--spotify .platform__icon { fill: none; stroke: currentColor; }
.platform--apple .platform__icon { fill: currentColor; stroke: currentColor; }

.release__meta {
  display: flex;
  gap: 0 clamp(16px, 2.2vw, 30px);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  margin-left: auto;
}
.release__format { width: 5.5rem; }
.release__date { width: 8rem; text-align: right; }

/* ── 04 · about ──────────────────────────────────────────────────────────── */

.about {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.about__photo { margin: 0; }
.about__photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  filter: grayscale(100%);
  border: 1px solid var(--rule);
}
.about__body { max-width: 62ch; }
.about__body p { margin: 0 0 18px; }

/* ── 05 · listen / contact ───────────────────────────────────────────────── */

.listen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(32px, 5vw, 72px);
  max-width: 1000px;
}
.linklist { border-top: 1px solid var(--rule); }
/* A list straight after a sub-head already has the sub-head's rule above
   it — one line, not two. */
.subhead + .linklist { border-top: 0; }
.linklist li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0 11px;
  border-bottom: 1px solid var(--rule-hair);
  align-items: baseline;
  font-size: 14px;
}
.linklist__key {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* A list whose links speak for themselves needs no label column. */
.linklist--plain li { grid-template-columns: minmax(0, 1fr); }

/* ── colophon ────────────────────────────────────────────────────────────── */

.colophon {
  border-top: 1px solid var(--rule);
  padding: 28px 0 clamp(80px, 10vh, 120px);
  font-size: 12px;
  color: var(--ink-soft);
}
.colophon__line { margin: 0 0 6px; max-width: 72ch; }

/* Below the wide layout the player floats over the page, so leave the
   foot of the document clear of it. */
@media (max-width: 1239px) {
  .colophon { padding-bottom: 300px; }
}

/* ── floating Bandcamp player ────────────────────────────────────────────── */

.player {
  position: fixed;
  right: clamp(10px, 1.6vw, 22px);
  bottom: clamp(10px, 1.6vw, 22px);
  z-index: 40;
  /* 426px = Bandcamp's native 400px embed + panel border + padding. */
  width: 426px;
  max-width: calc(100vw - 20px);
  --embed-scale: 1;
  font-size: 12px;
}

.player__panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.player[data-state="closed"] { display: none; }

.player__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 11px;
  border-bottom: 1px solid var(--rule);
}
.player[data-state="minimised"] .player__head { border-bottom: 0; }
.player__ident { display: block; min-width: 0; }
.player__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.player__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2px;
  overflow-wrap: anywhere;
  transition: opacity 0.13s linear;
}
.player__actions { display: flex; gap: 12px; flex: none; padding-top: 1px; }
.player__btn {
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.player__btn:hover { text-decoration-thickness: 2px; }

.player__body { display: none; padding: 10px 11px 11px; }
.player[data-state="open"] .player__body,
.player[data-state="expanded"] .player__body { display: block; }

.player__field { margin-bottom: 9px; }
.player__label + .player__select { margin-top: 4px; }
.player__select {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 5px 6px;
}

/* Bandcamp's own compact player is 400px wide. It is never cropped:
   below 400px of room it is scaled down as a whole. No border and no
   extra height here, so the player sits flush in the panel. */
.player__embed {
  position: relative;
  overflow: hidden;
  height: calc(46px * var(--embed-scale, 1));
  background: var(--paper);
}
.player__embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 400px;
  height: 46px;
  border: 0;
  transform: scale(var(--embed-scale, 1));
  transform-origin: left top;
}

.player__foot {
  display: block;
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.45;
}
.player__link { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.player__reopen {
  display: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 8px 12px;
  cursor: pointer;
}
.player[data-state="closed"] .player__reopen { display: block; }
.player__reopen:hover { background: var(--ink); color: var(--paper); }

/* Narrow screens: the panel starts as a slim bar so it never covers
   the page, and opens only when it is asked to. */
@media (max-width: 1239px) {
  .js-narrow .player[data-state="open"] .player__body { display: none; }
}
@media (max-width: 460px) {
  .player { width: min(426px, calc(100vw - 16px)); --embed-scale: 0.88; }
  .player__head { padding: 7px 9px; align-items: center; }
  .player__now { display: none; }
  .player__title { margin-top: 0; }
  .colophon { padding-bottom: 320px; }
}
@media (max-width: 400px) {
  .player { --embed-scale: 0.78; }
}
@media (max-width: 340px) {
  .player { --embed-scale: 0.66; }
}

/* ── motion ──────────────────────────────────────────────────────────────── */

.js-motion .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.js-motion .reveal.is-in { opacity: 1; transform: none; }

.player__title.is-swapping { opacity: 0; }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .feature__grid { grid-template-columns: minmax(0, 1fr); }
  .feature__frame { max-width: 320px; }
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: minmax(0, 1fr); }
  .about__photo img { width: 160px; height: 160px; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  :root { --masthead-h: 46px; }
  .masthead__inner { padding: 11px var(--gutter); gap: 14px; }
  .masthead__mark { font-size: 11px; letter-spacing: 0.06em; }
  .masthead__list { gap: 13px; font-size: 11px; }
  .masthead__list .is-optional,
  .masthead__list .is-home { display: none; }

  .release { flex-wrap: wrap; gap: 6px 12px; }
  .release__title { flex: 1 1 auto; }
  .release__links { order: 1; }
  .release__meta {
    order: 2;
    flex: 1 1 100%;
    margin-left: 0;
    gap: 6px 18px;
    flex-wrap: wrap;
    white-space: normal;
  }
  .release__format, .release__date { width: auto; }
  .release__date { text-align: left; }

  .linklist li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 420px) {
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .cover__title { font-size: 13px; }
}

/* ── reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js-motion .reveal { opacity: 1; transform: none; }
}

/* ── print ───────────────────────────────────────────────────────────────── */

/* Printing does not scroll, so the scroll-triggered reveals would never
   fire and the page would print half empty. Show everything on paper. */
@media print {
  .js-motion .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .player, .masthead__nav { display: none; }
}
