/* ---------- Tokens ---------- */
:root {
  --blue: #1a14ff;
  --black: #000;
  --white: #fff;

  /* P22 Underground weights – adjust to match the weights in your Typekit kit */
  --weight-heavy: 800;   /* album title */
  --weight-sub: 600;     /* subheading + tracklist */

  --weight-body: 400;    /* light, not heavy */
  --body-size: 16pt;

  --title-size: 35pt;
  --sub-size: 25pt;

  --gutter: clamp(12px, 2vw, 32px);
  --page-pad: clamp(16px, 3vw, 48px);

  /* Background tile: image repeats 3 times across the screen width */
  --tile: 33.3333vw;
  --scroll-speed: 6s;    /* time for one tile to pass – lower = faster */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--black);        /* shows in the overscroll bounce above the header and below the page */
  overscroll-behavior-y: none;     /* stops the bounce where the browser supports it */
}

body {
  font-family: "p22-underground", sans-serif;
  font-size: var(--sub-size);
  font-weight: var(--weight-sub);
  line-height: 1.2;
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Background (fixed, scrolls horizontally) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--blue);
}

.bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: calc(100% + var(--tile));      /* one extra tile so the loop is seamless */
  background: url("images/bg-tile.png") repeat 0 0 / var(--tile) auto;  /* keeps the tile's own proportions */
  animation: scroll-x var(--scroll-speed) linear infinite;
  will-change: transform;
}

@keyframes scroll-x {
  to { transform: translateX(calc(var(--tile) * -1)); }
}

/* Black gradient, fixed to the screen */
.fade {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) var(--fade-start), rgba(0,0,0,1) var(--fade-end));
}

/* Animatable gradient stops */
@property --fade-start { syntax: "<percentage>"; inherits: true; initial-value: 30%; }
@property --fade-end   { syntax: "<percentage>"; inherits: true; initial-value: 100%; }

/* As the description section scrolls into view, the gradient rises
   so the black sits higher up the screen, behind the text */
@supports (animation-timeline: view()) {
  body { timeline-scope: --about; }
  .about { view-timeline: --about block; }

  .fade {
    animation: fade-rise linear both;
    animation-timeline: --about;
    animation-range: entry 0% entry 100%;
  }

  @keyframes fade-rise {
    from { --fade-start: 30%; --fade-end: 100%; }
    to   { --fade-start: 0%;  --fade-end: 55%; }
  }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: view()) {
  .press-text { text-shadow: 0 0 12px #000, 0 0 24px #000; }
}

/* ---------- 6-column grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: var(--gutter);
  padding-inline: var(--page-pad);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--black);
  padding-block: clamp(12px, 2vw, 28px);
}

.site-title {
  grid-column: 1 / -1;
  font-weight: var(--weight-heavy);
  font-size: clamp(36px, 8vw, 56px);
  letter-spacing: 0.08em;
  /*text-transform: uppercase;*/
  line-height: 1;
}

/* ---------- Main content ---------- */
main { padding-block: clamp(32px, 8vw, 120px) 80px; row-gap: 48px; }

.cover { grid-column: 1 / 4; }
.cover img {
  width: 100%;
  aspect-ratio: 1 / 1;   /* always square */
  object-fit: cover;     /* crops instead of stretching if the file isn't square */
}

.info {
  grid-column: 4 / 7;
  align-self: center;
}

.album-title {
  font-size: var(--title-size);
  font-weight: var(--weight-heavy);
  margin-bottom: 0.6em;
}

.buy {
  display: inline-block;
  background: var(--white);
  color: var(--blue);
  font-size: var(--sub-size);
  font-weight: var(--weight-sub);
  padding: 0.3em 0.6em;
  border-radius: 0.5em;
  margin-bottom: 1.2em;
}

.subhead {
  font-size: var(--sub-size);
  font-weight: var(--weight-sub);
  margin-bottom: 0.4em;
}

.stream {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stream img { height: 56px; width: auto; }

/* ---------- Tracklist ---------- */
.tracks { grid-column: 1 / 5; }

.tracklist {
  counter-reset: track;
  font-size: var(--sub-size);
  font-weight: var(--weight-sub);
}

.tracklist li { counter-increment: track; }
.tracklist li::before { content: counter(track) ". "; }

/* ---------- About / press shot ---------- */
.about {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: var(--gutter);
  row-gap: 24px;
  align-items: start;
}

.press-text {
  grid-column: 1 / 4;
  grid-row: 1;
  font-size: var(--body-size);
  font-weight: var(--weight-body);
  line-height: 1.35;
}

.press-text p + p { margin-top: 1em; }

.press-img { grid-column: 4 / 7; grid-row: 1; }
.press-img img { width: 100%; }
.press-img figcaption { margin-top: 0.4em; }

/* Record label footer  */
.label {
  display: flex;
  justify-content: center;
  padding: 0 var(--page-pad) clamp(48px, 8vw, 96px);
}

.label a { display: block; }

.label img {
  width: min(60vw, 240px);   /* explicit width: the SVG has no width/height of its own */
  height: auto;
}

/*  Mobile: stack everything  */
@media (max-width: 768px) {
  .cover,
  .info,
  .tracks { grid-column: 1 / -1; }

  /* image first, then text */
  .press-img,
  .press-text { grid-column: 1 / -1; grid-row: auto; }

  .site-title { letter-spacing: 0.04em; }
  .stream img { height: 48px; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg::before { animation: none; }
}