/* ==========================================================================
   Ellis Moss — ellismoss.co.uk
   ========================================================================== */

@font-face {
  font-family: "Milligram";
  src: url("assets/fonts/milligram-medium.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Klamp Mono";
  src: url("assets/fonts/klamp-205-mono-bold.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Jura";
  src: url("assets/fonts/jura.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.58);
  --line: rgba(255, 255, 255, 0.13);
  --header-h: 88px;
  --gap: 4px;
  --pad: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jura", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

:where(a, button, iframe):focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

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

.skip {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -140%);
  z-index: 100; padding: 10px 18px; background: #fff; color: #000;
  font: 700 13px/1 "Milligram", sans-serif; letter-spacing: .12em; text-transform: uppercase;
}
.skip:focus { transform: translate(-50%, 0); }

/* ------------------------------- header --------------------------------- */

/* watched by main.js to decide when the header stops being "at the top" */
.top-sentinel {
  position: absolute; top: 24px; left: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}

/* Nothing in here changes size on scroll — only the tint and the hairline
   cross-fade, so the transition can't be caught mid-reflow. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(16px, 3vw, 40px);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .55s var(--ease), background-color .55s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(10, 10, 10, 0.85);
}

.logo { grid-column: 2; justify-self: center; display: block; }
.logo img {
  width: auto; height: 44px;
  transition: opacity .35s var(--ease);
}
.logo:hover img { opacity: .7; }

.mail {
  grid-column: 3;
  justify-self: end;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
}
.mail svg {
  width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.mail:hover { border-color: var(--line); background: rgba(255, 255, 255, .07); transform: translateY(-1px); }

/* -------------------------------- work ---------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin: 0;
  padding: var(--gap) var(--pad) var(--pad);
  list-style: none;
}
.grid > li { margin: 0; }

.grid .tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: #141414;
  aspect-ratio: 1;
}
.grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s var(--ease), filter .25s var(--ease);
  will-change: transform;
}
.grid .tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .18) 45%, transparent 70%);
  opacity: 0;
  transition: opacity .22s var(--ease);
  pointer-events: none;
}
.grid .cap {
  position: absolute; inset: auto 0 0 0;
  z-index: 1;
  display: grid; gap: 4px;
  padding: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: none;
}
.grid .cap b {
  font-family: "Milligram", sans-serif;
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.15;
}
.grid .cap span {
  font-size: clamp(11px, .95vw, 13px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Bare play/pause glyph, no badge behind it. No transition anywhere — it snaps.
   The drop-shadow is what keeps a white glyph readable on pale artwork. */
.tile-icon {
  position: absolute; top: 12px; right: 12px;
  z-index: 1;
  display: block;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .75));
}
.tile-icon svg { display: block; width: 26px; height: 26px; fill: #fff; }
/* pause bars only while this tile is the one making noise */
.tile-icon .t-pause { display: none; }
.tile.is-playing .tile-icon .t-play { display: none; }
.tile.is-playing .tile-icon .t-pause { display: inline; }

@media (hover: hover) {
  .grid .tile:hover img { transform: scale(1.06); filter: brightness(.92); }
  .grid .tile:hover::after { opacity: 1; }
  .grid .tile:hover .cap { opacity: 1; transform: none; }
  .grid .tile:hover .tile-icon { opacity: 1; }
}
/* keyboard focus still reveals the caption; a pointer click blurs the tile in
   main.js so pausing with space cannot leave it highlighted */
.grid .tile:focus-visible .cap { opacity: 1; transform: none; }
.grid .tile:focus-visible .tile-icon { opacity: 1; }
.grid .tile:focus-visible::after { opacity: 1; }

/* whatever is playing stays lit up, so you can see it from anywhere in the grid */
.grid .tile.is-playing::after { opacity: 1; }
.grid .tile.is-playing .cap { opacity: 1; transform: none; }
.grid .tile.is-playing .tile-icon { opacity: 1; }
.grid .tile.is-playing {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* ------------------------------- labels --------------------------------- */

.labels {
  padding: clamp(38px, 5vw, 64px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.marquee {
  overflow: hidden;
  /* soften the entry/exit at both edges */
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: clamp(48px, 6vw, 96px);
  width: max-content;
  margin: 0; padding: 0;
  list-style: none;
  animation: marquee 70s linear infinite;
}
/* uniform box + contain, so logos of wildly different aspect ratios read at a
   consistent optical size instead of the source canvas dictating scale */
.marquee-track img {
  width: clamp(112px, 11vw, 168px);
  height: clamp(46px, 4.6vw, 68px);
  object-fit: contain;
  opacity: .62;
  transition: opacity .3s var(--ease);
}
.marquee-track li:hover img { opacity: 1; }

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(calc(-50% - (clamp(48px, 6vw, 96px) / 2)), 0, 0); }
}

/* ----------------------------- meet ellis -------------------------------- */

.meet {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: clamp(360px, 46vw, 620px);
  padding: clamp(32px, 5vw, 72px) clamp(20px, 4vw, 56px);
  background: #000 url("assets/brand/meet-bg.webp") center 66% / cover no-repeat;
  overflow: hidden;
}
.meet::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0, 0, 0, .1) 30%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 35%, rgba(0, 0, 0, .5));
}
.meet h2 {
  position: relative;
  margin: 0;
  font-family: "Milligram", sans-serif;
  font-size: clamp(44px, 9.5vw, 128px);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-align: right;
}

/* -------------------------------- bio ------------------------------------ */

.bio {
  position: relative;
  padding: clamp(48px, 7vw, 96px) clamp(20px, 4vw, 56px);
  background: #000 url("assets/brand/bio-bg.webp") center / cover no-repeat;
}
.bio::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(6, 6, 6, .93) 0%, rgba(6, 6, 6, .8) 55%, rgba(6, 6, 6, .7) 100%);
}
.bio-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}
.bio-copy p {
  margin: 0;
  font-size: clamp(17px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.5;
  text-wrap: pretty;
}
/* reserves the button's place in the bio while it is pinned to the corner */
.cta-slot {
  margin-top: clamp(24px, 3vw, 40px);
  min-height: 49px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  padding: 15px 28px;
  border: 1px solid rgba(255, 255, 255, .34);
  background: #0a0a0a;
  font-family: "Milligram", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.cta span { transition: transform .3s var(--ease); }
.cta:hover { background: #fff; color: #000; border-color: #fff; }
.cta:hover span { transform: translateX(4px); }

/* left/bottom are written by main.js: it pins the button at the same x its
   resting slot has, and hands over at the exact scroll offset where the two
   positions coincide — so there is nothing to snap */
.cta.is-pinned {
  position: fixed;
  z-index: 55;
  border-color: rgba(255, 255, 255, .5);
}

.bio-player iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
}

/* ------------------------------- footer ---------------------------------- */

.site-footer {
  position: relative;
  padding: clamp(48px, 6vw, 88px) clamp(20px, 4vw, 56px) clamp(30px, 4vw, 44px);
  border-top: 1px solid var(--line);
}

.follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 40px);
}
.follow h2 {
  margin: 0;
  font-family: "Klamp Mono", monospace;
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.follow h2 b { font-weight: 700; }

.social { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; }
.social a {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.social svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.social a:hover { background: #fff; color: #000; border-color: #fff; transform: translateY(-2px); }

.copy {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(14px, 2vw, 22px);
  margin: 0;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------- player ---------------------------------- */

/* Flat black, square corners, flush to the bottom and both edges. No blur,
   no translucency, no rounding — the bar is a solid block of page furniture. */
.player {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, .22);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .32s var(--ease), visibility 0s linear .32s;
}
.player.is-open {
  transform: none;
  visibility: visible;
  transition: transform .32s var(--ease), visibility 0s;
}

/* scrubber runs edge to edge along the very top of the bar */
.player-seek {
  position: relative;
  height: 3px;
  background: #000;
  cursor: pointer;
}
.player-seek-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: #fff;
  will-change: width;
}
.player-seek:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Whole bar targets ~46px tall — 40% down from the original 77px. */
.player-bar {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 16px);
  padding: 4px clamp(10px, 2vw, 18px);
}

.player-art {
  flex: none;
  width: 33px; height: 33px;
  object-fit: cover;
  background: #141414;
}

.player-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.player-meta b {
  font-family: "Milligram", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-meta span {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player-controls { flex: none; display: flex; align-items: center; justify-content: center; gap: 2px; width: 96px; }
.player-controls button {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  opacity: .75;
  transition: opacity .18s var(--ease);
}
.player-controls button:hover { opacity: 1; }
.player-controls svg { width: 15px; height: 15px; fill: currentColor; }

.player-controls .is-primary {
  width: 27px; height: 27px;
  background: #fff;
  color: #000;
  opacity: 1;
  transition: transform .18s var(--ease);
}
.player-controls .is-primary:hover { transform: scale(1.06); }
.player-controls .is-primary svg { width: 13px; height: 13px; }
.i-pause { display: none; }
.player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }

.player-time {
  flex: none;
  width: 92px;
  margin: 0;
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.player-time i { font-style: normal; padding: 0 5px; opacity: .5; }
/* Jura's "1" is ~40% narrower than its "0" and it ships no tnum feature, so
   each glyph gets its own fixed box — keeps Jura, kills the jitter */
.player-time .dig { display: inline-block; width: .68em; text-align: center; }
.player-time .sep { display: inline-block; width: .30em; text-align: center; }

.player-fallback {
  flex: none;
  display: block;
  font-family: "Milligram", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 5px 10px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .34);
}
.player-fallback:hover { background: #fff; color: #000; }
.player.is-stalled .player-time { visibility: hidden; }

.player-close {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  padding: 0;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  opacity: .6;
  transition: opacity .18s var(--ease);
}
.player-close:hover { opacity: 1; }
.player-close svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round;
}

/* keep the footer clear of the bar while it is up */
body.player-open { padding-bottom: 60px; }

@media (max-width: 720px) {
  .player-time, .player-fallback { display: none; }
  .player-art { width: 30px; height: 30px; }
  .player-bar { gap: 8px; }
}

/* ------------------------------- reveal ---------------------------------- */

/* only hide when JS is present to un-hide it again */
.js .reveal, .js .reveal-group > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in, .js .reveal-group > .in { opacity: 1; transform: none; }

/* ----------------------------- responsive -------------------------------- */

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .bio-inner { grid-template-columns: 1fr; }
  .bio-player { max-width: 560px; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .logo img { height: 32px; }
  .mail { width: 40px; height: 40px; }
  .mail svg { width: 22px; height: 22px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .meet { justify-content: flex-start; }
  .meet h2 { text-align: left; }
  .copy { position: static; margin-top: 26px; text-align: center; }
}

/* ---------------------------- preferences -------------------------------- */

/* Reduce the motion that actually moves the page — big travel and scroll
   hijacking — but keep short hover/state cross-fades, which the setting isn't
   aimed at and whose loss reads as a broken UI. Never swap the marquee to
   overflow:auto: that puts a scrollbar under the logos. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal-group > * { transform: none; }
  .marquee-track { animation-duration: 100s; }
}
