/* LICK / Drop 001 prototype
   Palette is fixed by the merch: acid ink sampled from the hoodie print (#D7FD04) on garment black.
   One family (Archivo, variable width + weight) does display and text, from ultra-condensed
   headlines to the full-width manifesto. Type never moves; motion lives in the hero canvas. */

:root {
  --void: #000000;
  --acid: #d7fd04;
  --acid-dim: #4d5a02; /* decorative rules only: 2.8:1 on void */
  --acid-line: #617202; /* outlines that mark a control: 3.9:1 on void (WCAG 1.4.11) */
  --rule: #1c2006; /* hairlines between release rows */
  --bone: #e6e8e1;
  --ash: #8e9188;
  --smoke: #1d1f1a; /* disabled control fill */
  --mock: #d4d4d4; /* backdrop of the Big Cartel mockups, shown while a photo loads */
  --signal: #ff5a36;

  --font: "Archivo", "Arial Narrow", system-ui, sans-serif;

  /* Classical scale: 14 / 18 / 24 / 36 / 48 / 72 */
  --text-sm: 0.875rem;
  --text-md: 1.125rem;
  --text-lg: 1.5rem;
  --text-xl: clamp(2.25rem, 5vw, 4.5rem);

  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 68px;
  --slant: -12deg;
  /* A skewed shape pokes out past its box by tan(slant) x half its height. Slanted controls are inset
     by that much so their leading corner lines up with the text column, like italic type does. */
  --lean: calc(tan(var(--slant)) * -0.5);
  --button-h: 52px;
  --chip-h: 44px;
  color-scheme: dark;
}

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

html {
  background: var(--void);
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Component display rules would otherwise override the hidden attribute. */
[hidden] {
  display: none !important;
}

/* Read by screen readers, not shown (e.g. "opens in a new tab" on outbound links). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 4px;
}

/* Sections take focus after an in-page jump so the next Tab starts there; they don't need a ring. */
[tabindex="-1"]:focus {
  outline: none;
}

/* Keeps in-page jumps clear of the fixed header when smooth scroll is off (reduced motion). */
main > section[id] {
  scroll-margin-top: var(--header-h);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--acid);
  color: var(--void);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Buttons: slanted like the wordmark ---------- */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-h);
  margin-inline: calc(var(--lean) * var(--button-h));
  padding: 0 28px;
  border: 0;
  background: none;
  color: var(--void);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 800;
  font-variation-settings: "wdth" 88;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--acid);
  transform: skewX(var(--slant));
  transition: transform 160ms cubic-bezier(0.25, 1, 0.5, 1), background-color 160ms ease;
}

.button:not([disabled]):hover::before {
  transform: skewX(var(--slant)) scaleX(1.04);
}

.button:not([disabled]):active::before {
  transform: skewX(var(--slant)) scaleX(0.98);
}

/* Ring the slanted shape, not the upright box, matching the size chips. */
.button:focus-visible {
  outline: none;
}

.button:focus-visible::before {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.button[disabled] {
  cursor: not-allowed;
  color: var(--ash);
}

.button[disabled]::before {
  background: var(--smoke);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  min-height: var(--header-h);
  padding: 12px var(--gutter);
  transition: background-color 200ms ease;
}

/* Solid garment black once the page scrolls: a translucent bar went muddy olive over the acid Join slab. */
.site-header.is-solid {
  background: var(--void);
  box-shadow: 0 1px 0 var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand img {
  height: 26px;
  width: auto;
}

/* Links carry 10px of padding each side for a 44px target; the gap and the trailing margin
   subtract it again so the words sit where they would without it. */
.site-nav {
  display: flex;
  gap: max(0px, calc(clamp(14px, 2.4vw, 32px) - 20px));
  margin-left: auto;
  margin-right: -10px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--acid);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--acid-dim);
  background: transparent;
  color: var(--bone);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
  border-color: var(--acid);
  color: var(--acid);
}

.sound-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.sound-meter i {
  width: 3px;
  height: var(--rest-height);
  background: currentColor;
  transition: height 60ms linear;
}

/* Resting heights read as an equaliser icon while the sound is off. */
.sound-meter i:nth-child(1) { --rest-height: 6px; }
.sound-meter i:nth-child(2) { --rest-height: 11px; }
.sound-meter i:nth-child(3) { --rest-height: 4px; }
.sound-meter i:nth-child(4) { --rest-height: 8px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 120px var(--gutter) clamp(32px, 6vh, 72px);
  overflow: hidden;
}

.hero-canvas,
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-canvas {
  touch-action: pan-y;
}

.hero-fallback {
  display: none;
  object-fit: contain;
  object-position: 75% 50%;
  padding: 10vh 0;
}

.hero.no-webgl .hero-fallback {
  display: block;
}

.hero-copy {
  position: relative;
  max-width: 40rem;
  pointer-events: none;
}

.hero-copy .button {
  pointer-events: auto;
}

.hero-title {
  margin: 0 0 0.25em;
  font-size: clamp(4rem, 11vw, 11.5rem);
  line-height: 0.84;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--bone);
}

.hero-lede {
  max-width: 36ch;
  text-wrap: balance;
  margin: 0 0 28px;
  color: var(--bone);
}

/* ---------- Manifesto ---------- */

.manifesto {
  padding: clamp(64px, 14vh, 160px) var(--gutter) clamp(16px, 3vh, 40px);
  border-top: 1px solid var(--acid-dim);
  overflow: hidden;
}

.manifesto-line {
  /* Shrink-wrap so JS can measure the text itself when fitting each line to the measure. */
  width: max-content;
  margin: 0;
  font-weight: 900;
  line-height: 0.97;
  white-space: nowrap;
  font-variation-settings: "wdth" 125;
  color: var(--ash);
  transition: color 400ms ease;
}

.manifesto-line.is-lit {
  color: var(--acid);
}

/* ---------- Section titles ---------- */

.section-title {
  margin: 0;
  font-size: var(--text-xl);
  line-height: 0.95;
  font-weight: 900;
  font-variation-settings: "wdth" 70;
  text-wrap: balance;
}

/* ---------- Drop ---------- */

.drop {
  padding: clamp(72px, 12vh, 140px) var(--gutter);
}

.drop-intro {
  display: grid;
  gap: 16px 48px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  margin-bottom: clamp(32px, 6vh, 64px);
}

.drop-intro p {
  margin: 0;
  max-width: 44ch;
  color: var(--ash);
}

.drop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px) clamp(16px, 2vw, 28px);
}

/* Hold roughly a screen of space while the catalog loads (a cold Big Cartel fetch can take seconds),
   so Music and Join links clicked meanwhile don't land short when the products arrive. */
.drop-grid[aria-busy="true"] {
  min-height: min(100svh, 960px);
}

.drop-status {
  grid-column: 1 / -1;
  max-width: 44ch;
  margin: 0;
  color: var(--ash);
}

.drop-status a {
  color: var(--bone);
}

.drop-status a:hover {
  color: var(--acid);
}

/* Media on top, details below; the details row takes any spare height so every Add to bag
   in a row lines up, whatever each product has above it. */
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 20px;
}

/* The most expensive piece leads: the hoodie carries the skull, so it gets the full row. */
.product--lead {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  grid-template-rows: none;
  gap: clamp(20px, 3vw, 48px);
  align-items: end;
}

.product-media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--mock);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.product:hover .product-media img {
  transform: scale(1.035);
}

/* No image from Big Cartel, or it failed: keep the card's shape so the row still lines up. */
.product-media.is-missing {
  display: grid;
  place-items: center;
  background: var(--void);
  border: 1px solid var(--acid-dim);
}

.product-media-missing {
  font-size: var(--text-sm);
  color: var(--ash);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.product-name {
  min-width: 0;
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.1;
  font-weight: 800;
  font-variation-settings: "wdth" 80;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.product--lead .product-name {
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.product-price {
  flex-shrink: 0;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--acid);
}

.size-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.size-picker legend,
.size-single {
  margin: 0 0 10px;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--ash);
}

.size-single {
  margin: 0;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-inline: calc(var(--lean) * var(--chip-h));
}

.size-option {
  position: relative;
}

.size-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.size-option span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: var(--chip-h);
  padding: 0 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  isolation: isolate;
}

.size-option span::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--acid-line);
  transform: skewX(var(--slant));
  transition: background-color 120ms ease, border-color 120ms ease;
}

.size-option input:hover + span::before {
  border-color: var(--acid);
}

.size-option input:checked + span {
  color: var(--void);
}

.size-option input:checked + span::before {
  background: var(--acid);
  border-color: var(--acid);
}

/* Ring the slanted shape itself so focus follows the chip's angle. */
.size-option input:focus-visible + span::before {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.size-option input:disabled + span {
  color: var(--ash);
  text-decoration: line-through;
  cursor: not-allowed;
}

/* A sold-out size drops back to the decorative line so it reads as unavailable, not just unpicked. */
.size-option input:disabled + span::before {
  border-color: var(--acid-dim);
}

.product-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: auto;
}

.product-note {
  min-height: 1.5em;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ash);
}

.product-note a {
  color: var(--bone);
}

.product-note a:hover {
  color: var(--acid);
}

.product-note.is-error {
  color: var(--signal);
}

/* ---------- Releases ---------- */

.releases {
  padding: clamp(72px, 12vh, 140px) var(--gutter);
  border-top: 1px solid var(--acid-dim);
}

.releases-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

/* A cover wall, newest first: the next release leads as an acid tile, then the back catalogue.
   Ten tiles split evenly: 5 across on desktop, 2 across on tablets and phones. */
.release-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 44px) clamp(14px, 2vw, 24px);
  list-style: none;
  margin: clamp(28px, 5vh, 56px) 0 0;
  padding: 0;
}

.release-card {
  display: grid;
  align-content: start;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.release-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin-bottom: 8px;
  background: var(--rule);
}

.release-title {
  font-size: var(--text-lg);
  font-weight: 800;
  font-variation-settings: "wdth" 78;
  line-height: 1.1;
}

.release-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: var(--text-sm);
  color: var(--ash);
}

.release-year {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.release-card:hover .release-title,
.release-card:focus-visible .release-title {
  color: var(--acid);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* With a pointer, covers rest in muted grey so the wall stays black and acid, and come to full
   colour under the pointer or keyboard focus. Touch screens always see them in colour. */
@media (hover: hover) {
  img.release-cover {
    filter: grayscale(1) brightness(0.78);
    transition: filter 260ms ease;
  }

  .release-card:hover img.release-cover,
  .release-card:focus-visible img.release-cover {
    filter: none;
  }
}

/* The next release has no cover yet: an acid tile with the skull knocked out in black. */
.release-cover--next {
  position: relative;
  display: grid;
  place-items: end;
  background: var(--acid);
  overflow: hidden;
}

.release-next-skull {
  width: 92%;
  height: auto;
  margin: 0 -6% -10% 0;
  filter: brightness(0);
}

.release-next-year {
  position: absolute;
  top: 7%;
  left: 8%;
  color: var(--void);
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.85;
}

.release--next .release-title {
  color: var(--acid);
}

.releases-listen {
  margin: 0;
  color: var(--ash);
}

.releases-listen a:hover {
  color: var(--acid);
}

/* ---------- Join ---------- */

.join {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: end;
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  background: var(--acid);
  color: var(--void);
}

.join-title {
  grid-column: 1;
  margin: 0;
  font-size: clamp(4rem, 12vw, 12rem);
  line-height: 0.84;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
}

.join-lede {
  grid-column: 1;
  margin: 0;
  max-width: 32ch;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}

.join-form {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 18px;
  align-self: end;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: var(--text-sm);
  font-weight: 700;
}

.optional {
  font-weight: 400;
}

.field input {
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid var(--void);
  border-radius: 0;
  background: transparent;
  color: var(--void);
  font: inherit;
}

.field input:focus-visible {
  outline: 3px solid var(--void);
  outline-offset: 2px;
}

.field input[aria-invalid="true"] {
  border-style: dashed;
}

/* Errors sit under the field they belong to, marked with a slanted tab like the controls. */
.field-error {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0 0;
  font-size: var(--text-sm);
  font-weight: 700;
}

.field-error::before {
  content: "";
  flex: none;
  width: 8px;
  height: 0.85em;
  background: var(--void);
  transform: skewX(var(--slant));
}

.field-error:empty {
  display: none;
}

.join .button {
  justify-self: start;
  color: var(--acid);
}

.join .button::before {
  background: var(--void);
}

/* While a sign-up is in flight the button fades back toward the slab, so it reads as busy. */
.join .button[disabled] {
  color: var(--void);
  cursor: progress;
}

.join .button[disabled]::before {
  background: color-mix(in srgb, var(--void) 45%, var(--acid));
}

.join :focus-visible,
.join .button:focus-visible::before {
  outline-color: var(--void);
}

.form-status {
  min-height: 1.5em;
  margin: 0;
  max-width: 40ch;
  font-weight: 700;
}

.form-status a {
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  padding: 48px var(--gutter) 0;
  overflow: hidden;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--acid);
}

.footer-wordmark {
  width: 100%;
  height: auto;
  margin-top: clamp(40px, 8vh, 96px);
  margin-bottom: -6%;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .drop-intro,
  .join {
    grid-template-columns: minmax(0, 1fr);
  }

  .join-form {
    grid-column: 1;
    grid-row: auto;
  }

  .drop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product--lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .release-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .site-header {
    gap: 14px;
  }

  .sound-toggle {
    padding: 0 10px;
  }

  .brand img {
    height: 22px;
  }

  .hero {
    align-items: end;
    padding-top: 96px;
  }

  .drop-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .release-title {
    font-size: var(--text-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
  }
}
