/* ==========================================================
   NOISE CAPITAL — design 8 "Ash"
   The logo and the band name, nothing else: both made of ash.
   ========================================================== */

:root {
  --ink: #0e0d0b;
  --bone: #e9e2cf;
  --stencil: "Big Shoulders Stencil", "Arial Narrow", Impact, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --red: #d8391d;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
}

#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* With JavaScript (until WebGL fails) the page is only the canvas; the text stays for screen readers. */
.js:not(.no-webgl) .fallback {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.gl .grain { display: none; }

/* ---------- Variant switcher ---------- */
.variants {
  position: fixed; z-index: 10;
  top: clamp(14px, 3vh, 26px); left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px;
  font-family: var(--mono);
  opacity: 0; animation: fade 1s ease 1.4s forwards;
}
.no-webgl .variants { display: none; }
.variant-buttons {
  display: flex; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 3px;
  border: 1px solid rgba(233, 226, 207, .22);
  border-radius: 999px;
  background: rgba(14, 13, 11, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.variant-buttons button {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 15px 7px;
  border: 0; border-radius: 999px;
  background: transparent; color: rgba(233, 226, 207, .7);
  font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
  transition: background .35s, color .35s;
}
.variant-buttons button span { font-size: 9px; color: var(--red); letter-spacing: .1em; }
.variant-buttons button:hover { color: var(--bone); }
.variant-buttons button[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.variant-buttons button:focus-visible { outline: 1px dashed var(--red); outline-offset: 2px; }
.variant-hint {
  margin: 0;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(233, 226, 207, .5);
  text-align: center;
  text-shadow: 0 1px 10px rgba(14, 13, 11, .9);
}
@keyframes fade { to { opacity: 1; } }
@media (max-width: 860px) {
  .variant-buttons { border-radius: 18px; }
  .variant-buttons button { padding: 7px 11px 6px; letter-spacing: .1em; font-size: 10px; }
}
@media (max-width: 520px) {
  .listen { font-size: 11px; letter-spacing: .2em; }
  .variant-buttons button { padding: 7px 9px 6px; letter-spacing: .08em; }
  .variant-buttons button span { display: none; }
  .variant-hint { font-size: 9px; letter-spacing: .1em; max-width: 92vw; }
}

/* ---------- Spotify link: tears like the ripple (driven by main.js through --g, --s1, --s2, --sx, --rx) ---------- */
.listen {
  --g: 0; --s1: 50%; --s2: 50%; --sx: 0px; --rx: 0px;
  position: fixed; z-index: 10;
  left: 50%; bottom: clamp(18px, 4vh, 36px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 4px 9px;
  font: 500 12px/1 var(--mono); letter-spacing: .26em; text-transform: uppercase;
  color: var(--bone); text-decoration: none; white-space: nowrap;
  opacity: 0; animation: fade 1s ease 2s forwards;
}
.listen::after {                       /* perforated rule */
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 1px;
  background: repeating-linear-gradient(90deg, rgba(233, 226, 207, .5) 0 3px, transparent 3px 7px);
  transform: translateX(calc(var(--sx) * -.5));
}
.listen-arrow { color: var(--red); transition: transform .4s cubic-bezier(.2, .7, .1, 1); }
.listen:hover .listen-arrow, .listen:focus-visible .listen-arrow { transform: translate(3px, -3px); }
.listen:focus-visible { outline: 1px dashed var(--red); outline-offset: 4px; }
.listen-text { position: relative; display: inline-block; text-shadow: 0 1px 10px rgba(14, 13, 11, .9); }
.listen-main {
  display: inline-block;
  /* the torn slice is cut out of the original and printed shifted by ::after */
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--s1), transparent var(--s1), transparent calc(100% - var(--s2)), #000 calc(100% - var(--s2)));
          mask-image: linear-gradient(to bottom, #000 var(--s1), transparent var(--s1), transparent calc(100% - var(--s2)), #000 calc(100% - var(--s2)));
}
.listen-text::before, .listen-text::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  pointer-events: none;
}
.listen-text::before {                 /* the red plate slips */
  color: var(--red);
  transform: translate(var(--rx), -1px);
  opacity: calc(var(--g) * .85);
  mix-blend-mode: screen;
}
.listen-text::after {                  /* the torn slice */
  color: var(--bone);
  clip-path: inset(var(--s1) 0 var(--s2) 0);
  transform: translateX(var(--sx));
}

/* ---------- Fallback without WebGL: the same arrangement in plain CSS ---------- */
.fallback {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: 4vw;
  padding: 6vh 6vw;
}
.lockup {
  margin: 0;
  font-family: var(--stencil);
  font-weight: 800;
  font-size: min(15vw, 26vh);
  line-height: .8;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.lockup span { display: block; }
.lockup .l2 { color: transparent; -webkit-text-stroke: max(1px, .006em) var(--bone); }
.mark {
  height: min(72vh, 46vw); width: auto;
  filter: invert(.9) sepia(.35) contrast(1.1);
  mix-blend-mode: screen;
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none;
  opacity: .1; background-size: 180px 180px;
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); }
  66% { transform: translate(2%, -4%); } 100% { transform: translate(0, 0); }
}

@media (max-aspect-ratio: 1/1) {
  .fallback { flex-direction: column-reverse; gap: 5vh; }
  .lockup { font-size: min(27vw, 14vh); }
  .mark { height: min(46vh, 70vw); }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .variants, .listen { animation-duration: .01s; animation-delay: 0s; }
}

/* ---------- Public site: the variant switcher is a design-review tool, hidden here.
   Variant 9 (Mix) is the default; every variant is still reachable by link, e.g. #v1 … #v10. ---------- */
.variants { display: none !important; }
