/* ============================================================
   JOSE MENDEZ — composer & percussionist
   "a record, thus far"  ·  © Vice Records
   ============================================================ */

:root {
  --bg: #0a0908;
  --bg-2: #100e0d;
  --ink: #eae4d8;
  --ink-dim: rgba(234, 228, 216, 0.55);
  --ink-faint: rgba(234, 228, 216, 0.32);
  --line: rgba(234, 228, 216, 0.14);
  --red: #a50d0f;
  --red-bright: #c81114;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--red); color: var(--ink); }

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

a { color: inherit; text-decoration: none; }

/* ---------- film grain ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.4%); }
  50% { transform: translate(1.2%, -1.8%); }
  75% { transform: translate(-1.6%, -0.8%); }
  100% { transform: translate(0, 0); }
}

/* ---------- typography helpers ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: lowercase;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  transition: background 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
}
.nav.scrolled {
  background: rgba(10, 9, 8, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.nav-mark {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}
.nav-mark span { color: var(--red-bright); transition: color .4s; }
.nav-mark:hover span { color: var(--ink); }
.nav-links {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.4rem);
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--ink-dim);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.35s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.here { color: var(--ink); }
.nav-links a.here::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--red-bright);
}

/* ---------- reveal animations ---------- */
.rv {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.rv.in { opacity: 1; transform: translateY(0); }
.rv.d1 { transition-delay: 0.12s; }
.rv.d2 { transition-delay: 0.24s; }
.rv.d3 { transition-delay: 0.38s; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 0 1.5rem;
}
.hero-label {
  color: var(--ink-dim);
  font-size: 0.8rem;
  letter-spacing: 0.34em;
}
.hero-sub {
  margin-top: 2.4rem;
  color: var(--ink-dim);
}
.hero-sub .amp { color: var(--red-bright); }
.hero-cue {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 88px;
  background: var(--line);
  overflow: hidden;
}
.hero-cue::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--red-bright);
  animation: cue 2.6s var(--ease) infinite;
}
@keyframes cue {
  0% { top: -40%; }
  60%, 100% { top: 110%; }
}

/* ---------- interlude (full-bleed image) ---------- */
.interlude {
  position: relative;
  height: clamp(40vh, 72vh, 82vh);
  overflow: hidden;
}
.interlude img {
  width: 100%;
  height: 130%;
  object-fit: cover;
  will-change: transform;
  filter: grayscale(1) contrast(1.04);
}
.interlude::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 18%, transparent 82%, var(--bg) 100%);
}

/* ---------- chapters ---------- */
.chapters {
  padding: clamp(4rem, 10vh, 8rem) clamp(1.25rem, 5vw, 4rem);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
.chapters-intro {
  color: var(--ink-faint);
  margin-bottom: clamp(3rem, 8vh, 6rem);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.chapters-intro::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding: clamp(3rem, 9vh, 7rem) 0;
}
.chapter:nth-child(even) .chapter-art { order: 2; }
.chapter-art {
  position: relative;
}
.chapter-art img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.chapter-art a {
  display: block;
  overflow: hidden;
}
.chapter-art a:hover img { transform: scale(1.035); }
.chapter-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--red-bright);
  display: block;
  margin-bottom: 1.4rem;
}
.chapter-title {
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.9rem);
  line-height: 1.02;
  margin-bottom: 1.2rem;
}
.chapter-title a { transition: color 0.4s; }
.chapter-title a:hover { color: var(--red-bright); }
.chapter-meta {
  color: var(--ink-faint);
  display: flex;
  gap: 1.6rem;
  align-items: baseline;
}
.chapter-meta .credits-link {
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.35s, border-color 0.35s;
}
.chapter-meta .credits-link:hover {
  color: var(--ink);
  border-color: var(--red-bright);
}

/* ---------- footer ---------- */
.footer {
  margin-top: auto;
  padding: clamp(5rem, 14vh, 10rem) clamp(1.25rem, 5vw, 4rem) 2.4rem;
  text-align: center;
  position: relative;
}
.thusfar {
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.thusfar .dots { color: var(--red-bright); }
.footer-row {
  margin-top: 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}
.footer-logo { width: 92px; opacity: 0.85; }
.footer-fine {
  color: var(--ink-faint);
  display: flex;
  gap: 1.8rem;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-fine a {
  color: var(--ink-dim);
  transition: color 0.35s;
}
.footer-fine a:hover { color: var(--ink); }

/* ---------- page head (subpages) ---------- */
.page-head {
  padding: clamp(9rem, 20vh, 13rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 7vh, 5rem);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.page-head h1 {
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1;
}
.page-head .mono {
  color: var(--ink-faint);
  display: block;
  margin-bottom: 1.6rem;
}

/* ---------- discography ---------- */
.disco {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(1.25rem, 5vw, 4rem) clamp(3rem, 8vh, 6rem);
}
.disco-section {
  margin-bottom: clamp(3rem, 8vh, 5.5rem);
}
.disco-section > .mono {
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}
.disco-section > .mono::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.release {
  border-bottom: 1px solid var(--line);
}
.release:first-of-type { border-top: 1px solid var(--line); }
.release-head {
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 84px 1fr auto auto;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: 1.1rem 0.2rem;
  text-align: left;
  transition: padding 0.4s var(--ease);
}
.release-head:focus-visible {
  outline: 1px solid var(--red-bright);
  outline-offset: 4px;
}
.release-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  filter: grayscale(0.25);
  transition: filter 0.5s, transform 0.6s var(--ease);
}
.release-head:hover .release-thumb {
  filter: grayscale(0);
  transform: scale(1.04);
}
.release-title {
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.1;
  transition: color 0.35s;
}
.release-head:hover .release-title { color: var(--red-bright); }
.release-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}
.release-x {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink-faint);
  transition: transform 0.5s var(--ease), color 0.35s;
  transform-origin: center;
  line-height: 1;
}
.release.open .release-x {
  transform: rotate(45deg);
  color: var(--red-bright);
}
.release-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.7s var(--ease);
}
.release-inner {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  padding: 1rem 0.2rem 2.6rem;
}
.release-inner .full-art img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.credits-block .prod-line {
  font-weight: 400;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.credits-block ul {
  list-style: none;
}
.credits-block li {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  line-height: 2.1;
  color: var(--ink-dim);
}
.credits-block li b {
  font-weight: 400;
  color: var(--ink);
}
.credits-block .art-line {
  margin-top: 1.4rem;
  color: var(--ink-dim);
}
.credits-pending {
  color: var(--ink-faint);
  font-size: 1.1rem;
}
.listen {
  margin-top: 2rem;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.listen a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 0.7rem 1.2rem;
  transition: color 0.35s, border-color 0.35s, background 0.35s;
}
.listen a:hover {
  color: var(--ink);
  border-color: var(--red);
  background: rgba(165, 13, 15, 0.12);
}

.disco-crane {
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 8vh, 5rem) 0 0;
}
.disco-crane img {
  width: clamp(150px, 24vw, 240px);
}

/* ---------- bio ---------- */
.bio-wrap {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.bio-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(7rem, 16vh, 10rem) clamp(1.5rem, 5vw, 5rem) clamp(3rem, 8vh, 5rem);
}
.bio-text h1 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: lowercase;
  line-height: 2;
}
.bio-text h1 .amp {
  color: var(--red-bright);
}
.bio-ig {
  margin-top: 3.2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  align-self: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color 0.35s, border-color 0.35s;
}
.bio-ig:hover { color: var(--ink); border-color: var(--red-bright); }
.bio-art {
  position: relative;
  overflow: hidden;
  min-height: 60vh;
}
.bio-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bio-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg), transparent 30%);
}

/* ---------- 404 ---------- */
.lost {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.4rem;
  text-align: center;
  padding: 1.5rem;
}
.lost img { width: clamp(180px, 30vw, 300px); }
.lost a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.lost a:hover { color: var(--ink); border-color: var(--red-bright); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .chapter {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding: clamp(2.4rem, 7vh, 4rem) 0;
  }
  .chapter:nth-child(even) .chapter-art { order: 0; }
  .release-head { grid-template-columns: 60px 1fr auto; }
  .release-thumb { width: 60px; height: 60px; }
  .release-year { display: none; }
  .release-inner { grid-template-columns: 1fr; }
  .release-inner .full-art { max-width: 340px; }
  .bio-wrap { grid-template-columns: 1fr; }
  .bio-art { order: -1; min-height: 58svh; }
  .bio-art::after {
    background: linear-gradient(to top, var(--bg), transparent 35%);
  }
  .bio-text { padding-top: 2rem; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .hero-cue::after { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .interlude img { height: 100%; transform: none !important; }
  * { transition-duration: 0.01ms !important; }
}
