/* gunnora.com
   A dark room with one warm light in it. The amber is "the light"; each
   project card brings its own colour (--accent) so the hub stays neutral.

   Movement: the lamp breathes and follows the pointer, threads sway under the
   name, things arrive as you scroll, and while a song plays (html.is-playing)
   the equaliser bars dance, the lamp pulses and the whole room moves with the
   sound (see "the room, while a song plays"). All of it stops for people who
   ask for reduced motion (the last block in this file). */

:root {
  --bg: #0b0a09;
  --bg-2: #141210;
  --ink: #f1ebe2;
  --muted: #a69d90;
  --line: rgb(241 235 226 / 0.12);
  --light: #f4b860;
  --light-ink: #1d1203;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --wrap: 1240px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
iframe,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
p,
ul,
blockquote {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--light);
  color: var(--light-ink);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--light);
  color: var(--light-ink);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}

.skip:focus {
  top: 12px;
}

/* --------------------------------------------------------------- equaliser */

/* Three bars. They rest low, and dance only while a song is playing. */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.eq i {
  width: 2px;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom;
  transform: scaleY(0.3);
}

.eq i:nth-child(2) {
  transform: scaleY(0.6);
}

html.is-playing .eq i {
  animation: eq 0.85s ease-in-out infinite alternate;
}

html.is-playing .eq i:nth-child(2) {
  animation-delay: -0.3s;
  animation-duration: 0.6s;
}

html.is-playing .eq i:nth-child(3) {
  animation-delay: -0.55s;
  animation-duration: 1s;
}

@keyframes eq {
  0% {
    transform: scaleY(0.2);
  }
  55% {
    transform: scaleY(1);
  }
  100% {
    transform: scaleY(0.45);
  }
}

/* ------------------------------------------------------------------ header */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px var(--gutter);
  background: linear-gradient(rgb(11 10 9 / 0.92), rgb(11 10 9 / 0));
  transition: background 0.3s;
}

.top.is-stuck {
  background: rgb(11 10 9 / 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-name {
  font: 400 26px/1 var(--serif);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.top nav {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
  margin-left: auto;
}

.top nav a {
  position: relative;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 0;
  transition: color 0.2s;
}

.top nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--light);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.top nav a:hover {
  color: var(--ink);
}

.top nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.4s;
}

.pill .eq {
  color: var(--light);
}

.pill:hover {
  border-color: var(--light);
  color: var(--light);
}

html.is-playing .pill {
  border-color: rgb(244 184 96 / 0.6);
  box-shadow: 0 0 24px -6px rgb(244 184 96 / 0.6);
}

/* -------------------------------------------------------------------- hero */

.hero {
  --lx: 82%;
  --ly: 6%;
  position: relative;
  min-height: min(100svh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 140px var(--gutter) clamp(48px, 9vh, 96px);
  isolation: isolate;
  overflow: hidden;
}

/* The lamp. Its position (--lx, --ly) drifts towards the pointer. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(62% 70% at var(--lx) var(--ly), rgb(244 184 96 / 0.3), transparent 62%),
    radial-gradient(38% 44% at calc(var(--lx) - 4%) calc(var(--ly) - 6%), rgb(255 226 170 / 0.2), transparent 70%),
    radial-gradient(70% 60% at 0% 100%, rgb(244 184 96 / 0.06), transparent 70%);
  animation: breathe 7s ease-in-out infinite alternate;
}

html.is-playing .hero::before {
  animation-duration: 1.9s;
}

@keyframes breathe {
  from {
    opacity: 0.72;
  }
  to {
    opacity: 1;
  }
}

/* Grain, so the glow doesn't band. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-dust,
.hero-thread {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-thread {
  overflow: visible;
}

.hero-thread path {
  fill: none;
  stroke: var(--light);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
  opacity: 0.16;
  animation: fade-in 2.4s ease 1.4s both;
}

.hero-thread path:nth-child(2) {
  opacity: 0.3;
  animation-delay: 1s;
}

/* The first thread is the bright one. */
.hero-thread path:first-child {
  opacity: 0.7;
  animation: none;
  filter: drop-shadow(0 0 6px rgb(244 184 96 / 0.5));
}

/* These written threads are the still version. When the script is moving them
   it draws them on the dust canvas instead (it's much lighter work for a
   phone) and marks the hero .is-drawn so the two don't show at once. */
.hero.is-drawn .hero-thread {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.hero-kicker {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-kicker span {
  color: var(--light);
  margin: 0 0.5em;
}

.hero h1 {
  font: 400 clamp(84px, 21vw, 300px) / 0.86 var(--serif);
  letter-spacing: -0.035em;
  margin: 0.14em 0 0 -0.04em;
}

/* The name arrives a letter at a time. */
.hero h1 span {
  display: inline-block;
  animation: letter 1.1s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms + 120ms);
}

@keyframes letter {
  from {
    opacity: 0;
    transform: translateY(0.3em) rotate(5deg);
    filter: blur(10px);
  }
}

/* While a song plays, each letter rides its own part of the sound (--b, 0 to 1):
   it lifts and warms towards the lamp's colour. */
.hero h1 span {
  position: relative;
  translate: 0 calc(var(--b, 0) * -0.075em);
  will-change: translate;
}

/* The warmth is a copy of the letter in the lamp's colour, faded in over it:
   fading a layer costs a phone almost nothing, recolouring the letter doesn't. */
.hero h1 span::after {
  content: attr(data-l);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--light);
  opacity: calc(var(--b, 0) * 0.9);
  will-change: opacity;
}

.hero-line {
  font: italic 400 clamp(24px, 3.4vw, 44px) / 1.15 var(--serif);
  color: var(--light);
  margin-top: 0.5em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 5vh, 48px);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  transition:
    transform 0.25s var(--ease),
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.3s;
}

.btn:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-light {
  background: var(--light);
  border-color: var(--light);
  color: var(--light-ink);
}

/* A ring that keeps leaving the button. It's a layer that grows and fades
   (--gx, --gy: how far, for this shape), so the button itself is never redrawn. */
.btn-light::after,
.single-tag::after,
.sub-tag i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid rgb(244 184 96 / 0.6);
  pointer-events: none;
  animation: glow 3.2s ease-in-out 1.6s infinite;
}

.btn-light::after {
  --gx: 1.13;
  --gy: 1.56;
}

.btn-light:hover {
  background: #ffd08a;
  border-color: #ffd08a;
  box-shadow: 0 10px 36px -8px rgb(244 184 96 / 0.7);
}

@keyframes glow {
  0%,
  100% {
    transform: none;
    opacity: 0.75;
  }
  60% {
    transform: scale(var(--gx, 1.3), var(--gy, 1.3));
    opacity: 0;
  }
}

.hero-kicker,
.hero-line,
.hero-actions {
  animation: rise 0.9s var(--ease) both;
}

.hero-line {
  animation-delay: 0.62s;
}

.hero-actions {
  animation-delay: 0.78s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* "Scroll", with a drop of light running down a line. */
.hero-cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(48px, 9vh, 96px);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  animation: fade-in 1s ease 1.8s both;
}

.hero-cue span {
  writing-mode: vertical-rl;
}

.hero-cue::after {
  content: "";
  width: 1px;
  height: 64px;
  background: linear-gradient(var(--light), var(--light)) no-repeat 0 0 / 100% 30%, var(--line);
  animation: drip 2.2s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes drip {
  from {
    background-position:
      0 -30px,
      0 0;
  }
  to {
    background-position:
      0 70px,
      0 0;
  }
}

@media (min-width: 760px) {
  .hero-cue {
    display: flex;
  }
}

/* ----------------------------------------------------------------- marquee */

.marquee {
  overflow: hidden;
  padding: 20px 0 24px;
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
}

.marquee-track.ready {
  animation: slide 70s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee span {
  display: inline-flex;
  align-items: center;
  font: italic 400 clamp(34px, 5.4vw, 72px) / 1.1 var(--serif);
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgb(241 235 226 / 0.34);
}

.marquee span.on {
  color: var(--ink);
  -webkit-text-stroke: 0;
}

.marquee span::after {
  content: "";
  width: 0.16em;
  height: 0.16em;
  margin: 0 0.5em;
  border-radius: 50%;
  background: var(--light);
  box-shadow: 0 0 14px 2px rgb(244 184 96 / 0.6);
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* ------------------------------------------------- arriving as you scroll */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.9s ease,
    transform 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------- sections + thread */

.thread-wrap {
  position: relative;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.thread-head {
  display: none;
}

.block {
  position: relative;
  padding: clamp(64px, 11vh, 128px) 0 0;
}

.block-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 20px;
  row-gap: 14px;
  margin-bottom: clamp(28px, 5vh, 52px);
}

.index {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.16em;
  color: var(--light);
}

.block-head h2 {
  font: 400 clamp(44px, 7vw, 88px) / 0.95 var(--serif);
  letter-spacing: -0.02em;
}

.block-lede {
  grid-column: 2;
  max-width: 56ch;
  color: var(--muted);
  font-size: 18px;
}

/* On wide screens one line runs down the page and every section hangs off it:
   the thread that connects every track. It fills with light as you scroll
   (--progress, set by the script), and each section's dot lights as you reach it. */
@media (min-width: 1000px) {
  .thread-wrap {
    padding-left: calc(var(--gutter) + 56px);
  }

  .thread-wrap::before,
  .thread-wrap::after {
    content: "";
    position: absolute;
    left: var(--gutter);
    top: 0;
    width: 1px;
  }

  .thread-wrap::before {
    bottom: 0;
    background: linear-gradient(rgb(244 184 96 / 0.22) 85%, transparent);
  }

  .thread-wrap::after {
    height: calc(var(--progress, 0) * 100%);
    background: linear-gradient(rgb(244 184 96 / 0.15), var(--light));
    box-shadow: 0 0 10px rgb(244 184 96 / 0.5);
  }

  .thread-head {
    display: block;
    position: absolute;
    z-index: 2;
    left: var(--gutter);
    top: calc(var(--progress, 0) * 100%);
    width: 7px;
    height: 7px;
    margin: -4px 0 0 -3px;
    border-radius: 50%;
    background: #fff1d6;
    box-shadow:
      0 0 12px 3px rgb(244 184 96 / 0.9),
      0 0 40px 10px rgb(244 184 96 / 0.35);
    scale: calc(1 + var(--beat, 0) * 0.8);
  }

  .block-head {
    grid-template-columns: 1fr;
  }

  .block-lede {
    grid-column: 1;
  }

  .index {
    position: absolute;
    left: -56px;
    transform: translate(-50%, 0) rotate(-90deg) translate(-50%, 0);
    transform-origin: center;
    top: clamp(64px, 11vh, 128px);
    margin-top: 44px;
    padding: 0 10px;
    background: var(--bg);
    color: var(--muted);
    transition: color 0.6s;
  }

  .block::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: -56px;
    top: clamp(64px, 11vh, 128px);
    width: 9px;
    height: 9px;
    margin: 6px 0 0 -4px;
    border-radius: 50%;
    border: 1px solid rgb(244 184 96 / 0.55);
    background: var(--bg);
    box-shadow: 0 0 0 5px var(--bg);
    transition:
      background 0.5s,
      box-shadow 0.8s,
      transform 0.6s var(--ease);
  }

  .block.is-lit::before {
    background: var(--light);
    transform: scale(1.15);
    box-shadow:
      0 0 0 5px var(--bg),
      0 0 26px 6px rgb(244 184 96 / 0.6);
  }

  .block.is-lit .index {
    color: var(--light);
  }
}

/* ------------------------------------------------------------------- music */

.music {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
}

.player iframe {
  border-radius: 14px;
  background: var(--bg-2);
  transition: box-shadow 0.8s;
}

html.is-playing .player iframe {
  box-shadow: 0 0 70px -18px rgb(244 184 96 / 0.6);
}

.player-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  min-height: 32px;
  margin-top: 10px;
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.player-note button {
  font: inherit;
  color: var(--light);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.singles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  align-content: start;
}

.singles a {
  position: relative;
  display: block;
  text-decoration: none;
}

.singles img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-2);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.35s,
    filter 0.35s;
}

/* A cover lifts and tips towards the pointer (--rx, --ry come from the script). */
.singles a:hover img,
.singles a[aria-current="true"] img {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px) scale(1.02);
  box-shadow: 0 22px 44px -18px rgb(244 184 96 / 0.6);
}

.singles a[aria-current="true"] img {
  outline: 2px solid var(--light);
  outline-offset: 3px;
}

html.is-playing .singles a[aria-current="true"] img {
  animation: beat 1.9s ease-in-out infinite;
}

@keyframes beat {
  50% {
    box-shadow: 0 22px 60px -10px rgb(244 184 96 / 0.85);
  }
}

.singles:has(a[aria-current="true"]) a:not([aria-current="true"]) img {
  filter: saturate(0.6) brightness(0.72);
}

.singles:has(a[aria-current="true"]) a:not([aria-current="true"]):hover img {
  filter: none;
}

.single-title {
  display: block;
  margin-top: 10px;
  font: 400 21px/1.15 var(--serif);
  transition: color 0.25s;
}

.singles a:hover .single-title,
.singles a[aria-current="true"] .single-title {
  color: var(--light);
}

.single-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--light);
  color: var(--light-ink);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.single-tag::after {
  --gx: 1.35;
  --gy: 2.2;
  animation-delay: 0s;
}

/* The badge on whichever single is in the player. */
.singles .eq {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 24px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--light);
  color: var(--light-ink);
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.3s,
    transform 0.4s var(--ease);
}

.singles a[aria-current="true"] .eq {
  opacity: 1;
  transform: none;
}

@media (min-width: 620px) {
  .singles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .music {
    grid-template-columns: minmax(320px, 0.8fr) 1.2fr;
    align-items: start;
  }

  .player {
    position: sticky;
    top: 96px;
  }
}

@media (min-width: 1240px) {
  .singles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* -------------------------------------------------------------- unreleased */

/* Songs that play from this site, not from Spotify. Each row is a play
   button, the name, and the song's own waveform, which is also the scrubber.
   --level (0 to 1) is how loud the song is right now; the script sets it. */
.unreleased {
  margin-top: clamp(48px, 8vh, 88px);
  padding-top: clamp(32px, 5vh, 56px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.sub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: clamp(20px, 3vh, 32px);
}

.sub-head h3 {
  margin: 0;
  font: italic 400 clamp(36px, 4.8vw, 60px) / 1 var(--serif);
  letter-spacing: -0.01em;
}

.sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgb(244 184 96 / 0.5);
  border-radius: 999px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light);
}

.sub-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: relative;
  background: var(--light);
}

.sub-tag i::after {
  --gx: 4;
  --gy: 4;
  border-width: 1px;
  animation-duration: 2.4s;
  animation-delay: 0s;
}

.sub-lede {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 18px;
}

.tracks {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.track {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
}

/* On each beat a ripple leaves the cover and crosses the card (the script adds them). */
.track-rings {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.track-rings i {
  position: absolute;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 1px solid rgb(244 184 96 / 0.5);
  background: radial-gradient(closest-side, transparent 72%, rgb(244 184 96 / 0.1));
  animation: ring 1.3s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}

@keyframes ring {
  from {
    transform: scale(0.5);
    opacity: 0.85;
  }
  to {
    transform: scale(8);
    opacity: 0;
  }
}

.js .track[data-reveal] {
  transition:
    opacity 0.9s ease,
    transform 1s var(--ease),
    border-color 0.4s,
    box-shadow 0.25s;
}

.track:hover {
  border-color: rgb(244 184 96 / 0.4);
}

.track.is-current {
  border-color: rgb(244 184 96 / 0.6);
}

/* The glow around the playing song. It is painted once at full strength and
   then only faded up and down with the loudness (--level, set by the script). */
.track::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  box-shadow: 0 0 70px -14px rgb(244 184 96 / 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}

.track.is-current::before {
  opacity: calc(0.22 + var(--level, 0) * 1.5);
  transition: none;
  will-change: opacity;
}

.track-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--light);
  color: var(--light-ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease);
}

.track-play:hover {
  transform: scale(1.07);
}

.track-play:active {
  transform: scale(0.96);
}

/* The playing song's button kicks with the beat. */
.track.is-playing .track-play {
  scale: calc(1 + var(--beat, 0) * 0.045);
  will-change: scale;
}

.track-play svg {
  position: relative;
}

.track-play .i-pause,
.track.is-playing .track-play .i-play {
  display: none;
}

.track.is-playing .track-play .i-pause {
  display: block;
}

/* With a picture, the button is the picture and the icon sits on top of it. */
.track-play.has-cover {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  background: #000;
  color: #fff;
  isolation: isolate;
}

.track-play.has-cover:hover {
  transform: scale(1.03);
}

/* The picture is shown as it is; a small dark disc keeps the icon readable on any cover. */
.track-play.has-cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.62);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.22);
  transition: background 0.3s;
}

.track-play.has-cover:hover::before,
.track.is-current .track-play.has-cover::before {
  background: rgb(0 0 0 / 0.72);
}

.track-play.has-cover svg {
  z-index: 2;
}

.track-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-words {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.track-title {
  overflow: hidden;
  font: 400 26px/1.1 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.3s;
}

.track.is-current .track-title {
  color: var(--light);
}

.track-note {
  font: italic 400 17px/1.3 var(--serif);
  text-wrap: balance;
  color: var(--muted);
}

.track-time {
  grid-column: 3;
  grid-row: 1;
  font: 400 12px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.wave {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 56px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: pan-y;
}

.wave canvas {
  width: 100%;
  height: 100%;
}

/* On a phone, a song with a picture gives its name the whole top row, and the
   time sits at the end of the waveform (wide enough for "1:47 / 3:30", so the
   waveform doesn't change size when the song starts). */
@media (max-width: 819px) {
  .track:has(.has-cover) .track-words {
    grid-column: 2 / -1;
  }

  .track:has(.has-cover) .wave {
    grid-column: 1 / 3;
  }

  .track:has(.has-cover) .track-time {
    grid-column: 3;
    grid-row: 2;
    min-width: 11ch;
    text-align: right;
  }
}

@media (min-width: 820px) {
  .track {
    grid-template-columns: auto minmax(150px, 0.34fr) minmax(0, 1fr) auto;
    gap: 20px;
    padding-right: 24px;
  }

  .wave {
    grid-column: 3;
    grid-row: 1;
  }

  .track-time {
    grid-column: 4;
  }

  /* A song with a picture: the picture stands tall on the left, the name over the waveform. */
  .track:has(.has-cover) {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px 24px;
    padding: 16px 26px 16px 16px;
  }

  .track:has(.has-cover) .track-play {
    grid-row: 1 / span 2;
    width: 132px;
    height: 132px;
    border-radius: 12px;
  }

  .track:has(.has-cover) .track-play::before {
    width: 46px;
    height: 46px;
  }

  .track:has(.has-cover) .track-words,
  .track:has(.has-cover) .track-time {
    align-self: end;
  }

  .track:has(.has-cover) .track-time {
    grid-column: 3;
    padding-bottom: 4px;
  }

  .track:has(.has-cover) .wave {
    grid-column: 2 / -1;
    grid-row: 2;
    align-self: start;
  }
}

/* ---------------------------------------------------------------- projects */

.project {
  --accent: var(--light);
  position: relative;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-2);
}

.project:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* The card is lit from wherever the pointer is (--x, --y come from the script). */
.project::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    520px circle at var(--x, 50%) var(--y, 50%),
    color-mix(in srgb, var(--accent) 17%, transparent),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.5s;
}

.project:hover::after {
  opacity: 1;
}

/* Keeps the reveal's own transition and adds the hover ones. */
.js .project[data-reveal] {
  transition:
    opacity 0.9s ease,
    transform 1s var(--ease),
    border-color 0.4s,
    box-shadow 0.6s;
}

.project + .project {
  margin-top: clamp(20px, 3vw, 36px);
}

.project-forge {
  --accent: #4d97ff;
}

.project-onable {
  --accent: #46d9b3;
}

.project-art {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: #000;
}

.project-art > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The bunker: the camera drifts and the two red alarm lamps pulse. */
.project-forge .project-art > img {
  animation: drift 24s ease-in-out infinite alternate;
}

.project-forge .project-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(30% 46% at 6% 27%, rgb(255 46 34 / 0.6), transparent 72%),
    radial-gradient(30% 46% at 94% 27%, rgb(255 46 34 / 0.6), transparent 72%);
  animation: alarm 2.6s ease-in-out infinite;
}

@keyframes drift {
  from {
    transform: scale(1.07) translate(-1.6%, 0.6%);
  }
  to {
    transform: scale(1.07) translate(1.6%, -0.8%);
  }
}

@keyframes alarm {
  0%,
  100% {
    opacity: 0.08;
  }
  50% {
    opacity: 1;
  }
}

/* The mascot sits on the top edge of the screenshot. She is 2.16 times as tall
   as she is wide and her seat is 62% of the way down, so the screenshot starts
   1.34 mascot-widths below her head. */
.project-onable .project-art {
  --sit: clamp(58px, 7vw, 84px);
  --pad: clamp(18px, 3vw, 36px);
  --shot-top: calc(12px + var(--sit) * 1.34);
  padding: var(--shot-top) var(--pad) 0;
  background:
    radial-gradient(70% 80% at 20% 0%, rgb(70 217 179 / 0.28), transparent 70%),
    radial-gradient(60% 70% at 100% 100%, rgb(240 169 78 / 0.18), transparent 70%),
    #0b0f1a;
}

.project-onable .project-art > img:first-child {
  height: auto;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8);
  object-position: top left;
  transition: transform 0.9s var(--ease);
}

.project-onable:hover .project-art > img:first-child {
  transform: translateY(-10px);
}

/* She rocks gently where she sits, and hops when you come near. */
.project-mascot {
  position: absolute;
  right: 14%;
  top: 12px;
  width: var(--sit);
  filter: drop-shadow(0 10px 14px rgb(0 0 0 / 0.5));
  transform-origin: 50% 62%;
  animation: rock 3.6s ease-in-out infinite alternate;
  transition: translate 0.9s var(--ease);
}

.project-onable:hover .project-mascot {
  translate: 0 -10px;
  animation-duration: 1.2s;
}

@keyframes rock {
  from {
    transform: rotate(-3.5deg);
  }
  to {
    transform: rotate(3.5deg);
  }
}

.project-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(24px, 4vw, 48px);
}

.project-logo {
  width: min(300px, 80%);
  margin-left: -10px;
}

.project-wordmark {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 clamp(34px, 4vw, 46px) / 1 var(--sans);
  letter-spacing: -0.02em;
}

.project-wordmark img {
  border-radius: 11px;
}

.project-pitch {
  max-width: 46ch;
  color: #d8d0c4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tags li:first-child {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--accent);
}

.project-link {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 6px 0;
  font: 500 14px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  transition: border-color 0.2s;
}

.project-link:hover {
  border-color: var(--accent);
}

.project-link span {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}

.project:hover .project-link span {
  transform: translate(3px, -3px);
}

@media (min-width: 860px) {
  .project {
    grid-template-columns: 1.25fr 1fr;
    min-height: 420px;
  }

  .project-onable {
    grid-template-columns: 1fr 1.25fr;
  }

  .project-onable .project-art {
    order: 2;
  }

  .project-onable .project-art > img:first-child {
    position: absolute;
    left: var(--pad);
    top: var(--shot-top);
    width: 118%;
    max-width: none;
  }
}

/* ------------------------------------------------------------------- about */

.about {
  display: grid;
  gap: clamp(24px, 4vw, 64px);
}

.about blockquote {
  font: italic 400 clamp(44px, 7vw, 96px) / 0.98 var(--serif);
  letter-spacing: -0.02em;
  color: var(--light);
  text-shadow: 0 0 60px rgb(244 184 96 / 0.35);
}

.about blockquote span {
  display: block;
}

.about-text {
  display: grid;
  gap: 1.1em;
  max-width: 58ch;
  font-size: 18px;
  color: #d8d0c4;
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ------------------------------------------------------------------ footer */

/* The name again, huge, sinking below the edge of the page. */
.foot-big {
  height: 0.6em;
  margin-top: clamp(72px, 12vh, 140px);
  overflow: hidden;
  font: 400 clamp(110px, 27vw, 440px) / 0.8 var(--serif);
  letter-spacing: -0.04em;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(rgb(244 184 96 / 0.7), rgb(244 184 96 / 0) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 40px;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px var(--gutter) 96px;
  border-top: 1px solid var(--line);
}

.foot-name {
  font: 400 34px/1 var(--serif);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot a {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 0;
  display: inline-block;
  transition: color 0.2s;
}

.foot a:hover {
  color: var(--light);
}

.foot-fine {
  margin-left: auto;
  font: 400 12px/1 var(--mono);
  color: var(--muted);
}

/* ------------------------------------------------------------- mini player */

.mini {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 36px);
  padding: 8px 20px 8px 8px;
  border: 1px solid rgb(244 184 96 / 0.35);
  border-radius: 999px;
  overflow: hidden;
  background: rgb(20 18 16 / 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px -14px rgb(0 0 0 / 0.8);
  animation: rise 0.6s var(--ease) both;
}

.mini-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--light);
  color: var(--light-ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

.mini-toggle:hover {
  transform: scale(1.08);
}

html.is-playing .mini {
  border-color: rgb(244 184 96 / 0.6);
  box-shadow:
    0 18px 44px -14px rgb(0 0 0 / 0.8),
    0 0 26px -8px rgb(244 184 96 / 0.7);
}

html.is-playing .mini-toggle {
  scale: calc(1 + var(--beat, 0) * 0.1);
}

.mini-toggle .eq {
  display: none;
  height: 14px;
}

html.is-playing .mini-toggle .eq {
  display: inline-flex;
}

html.is-playing .mini-play {
  display: none;
}

.mini-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-decoration: none;
}

.mini-label {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--light);
}

.mini-title {
  overflow: hidden;
  font: 400 19px/1.05 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--light);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.5s linear;
}

/* ---------------------------------------------- the room, while a song plays */

/* The script adds these two layers. .stage sits behind the page: the song's
   cover, blurred, with light rising from the floor and sparks in the air.
   .pulse sits in front, along the bottom edge, and draws the sound itself.
   Neither can be clicked or read.

   Many times a second the script hands numbers to the few things that react:
     --bass  how much low end           (on .stage)
     --beat  1 on a kick, falling to 0  (on .stage, the playing song, the mini player)
     --level how loud the song is       (on the playing song)
     --b     one letter's share of it   (on each letter of the name)
   Each is only ever used to fade, move or grow a layer. Those are the changes a
   phone can make without redrawing anything, which is what keeps this smooth. */
.stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.2s ease;
}

html.is-playing .stage {
  opacity: 1;
  transition-duration: 1.4s;
}

.stage-art {
  position: absolute;
  inset: 0;
  opacity: calc(0.34 + var(--bass, 0) * 0.3);
  will-change: opacity;
}

/* The script paints the cover onto these, tiny and already soft; stretching
   them over the screen does the rest. Nothing is blurred while it plays. */
.stage-art canvas {
  position: absolute;
  left: -12%;
  top: -12%;
  width: 124%;
  height: 124%;
  max-width: none;
  opacity: 0;
  transition: opacity 1.8s ease;
  animation: sway 34s ease-in-out infinite alternate;
}

.stage-art canvas.on {
  opacity: 1;
}

@keyframes sway {
  from {
    transform: scale(1.04) translate(-1.5%, 1%) rotate(-1.5deg);
  }
  to {
    transform: scale(1.14) translate(1.5%, -1.5%) rotate(2deg);
  }
}

/* Light from the floor. It swells with the bass and jumps on the beat. */
.stage-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 46% at 50% 108%, rgb(244 184 96 / 0.5), transparent 72%),
    radial-gradient(34% 50% at 0% 100%, rgb(244 184 96 / 0.26), transparent 72%),
    radial-gradient(34% 50% at 100% 100%, rgb(244 184 96 / 0.26), transparent 72%),
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgb(11 10 9 / 0.6));
  opacity: calc(0.3 + var(--bass, 0) * 0.35 + var(--beat, 0) * 0.35);
  will-change: opacity;
}

.stage-sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pulse {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  width: 100%;
  height: clamp(56px, 12vh, 120px);
  pointer-events: none;
}

/* ------------------------------------------------------------------ phones */

/* Three effects look lovely and cost a phone dearly, because each has to be
   worked out again whenever anything moves underneath it, and here something
   always does: frosted glass (the header, the mini player) and the grain's
   blending. On touch screens they're swapped for plain versions. */
@media (hover: none), (max-width: 820px) {
  .top.is-stuck {
    background: rgb(11 10 9 / 0.97);
    backdrop-filter: none;
  }

  .mini {
    background: rgb(20 18 16 / 0.97);
    backdrop-filter: none;
  }

  .hero::after {
    opacity: 0.07;
    mix-blend-mode: normal;
  }
}

/* ----------------------------------------------------------- small screens */

@media (max-width: 560px) {
  .top nav {
    display: none;
  }

  .pill {
    margin-left: auto;
  }

  .block-head {
    grid-template-columns: 1fr;
  }

  .block-lede {
    grid-column: 1;
  }

  .foot-fine {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .hero-dust {
    display: none;
  }

  .stage-light {
    opacity: 0.3;
  }
}
