/* ============================================================
   Johnander Rabal — Film Composer
   Design system: bold, dark, cinematic. Generous negative space.
   ============================================================ */

:root {
  --bg:        #0a0a0b;
  --bg-elev:   #131316;
  --line:      #26262b;
  --text:      #f3f1ec;
  --muted:     #8b8b93;
  --accent:    #c9a24e;   /* champagne gold */
  --accent-dim:#9c7d38;
  --maxw:      1340px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.02;
  margin: 0;
  letter-spacing: -0.02em;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 2.5vw, 34px); }

.eyebrow {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 22px;
}

/* Vertical padding only — horizontal gutter comes from .wrap so every
   section lines up with the hero at the same width. */
.section { padding-top: clamp(70px, 11vw, 150px); padding-bottom: clamp(70px, 11vw, 150px); }
.section--tight { padding-top: clamp(48px, 7vw, 90px); padding-bottom: clamp(48px, 7vw, 90px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 2.5vw, 34px);
  mix-blend-mode: difference;
}
.nav__brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  position: relative;
  padding-bottom: 3px;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease);
}
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(48px, 7vw, 96px);
  padding-top: 140px;
  position: relative;
}
.hero__title {
  font-size: clamp(3rem, 11vw, 10rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

/* Home hero: top-aligned so the video + featured row flow naturally */
.hero--home {
  min-height: auto;
  justify-content: flex-start;
  padding-top: clamp(120px, 15vh, 175px);
  padding-bottom: clamp(56px, 8vw, 100px);
}
.hero--home .hero-video { margin-top: clamp(28px, 4vw, 52px); }
/* Featured trio sits directly under the video, gap matched to the grid gap */
.vgrid--featured { margin-top: clamp(14px, 1.6vw, 24px); }
.hero__sub {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  max-width: 46ch;
  margin-top: 26px;
}

/* Video frame (16:9) */
.videoframe {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  overflow: hidden;
}
.videoframe iframe,
.videoframe video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; display: block; }

/* Hero self-hosted video */
.hero-vwrap { cursor: pointer; }
.hero-vwrap .vtile__play svg { width: 74px; height: 74px; }
.hero-vwrap .vtile__play,
.hero-vwrap .vtile__label { transition: opacity 0.4s var(--ease); }
.hero-vwrap.playing .vtile__play,
.hero-vwrap.playing .vtile__label { opacity: 0; pointer-events: none; }
.hero-vwrap.previewing .vtile__play { opacity: 0; }

.hero-video { margin-top: clamp(40px, 6vw, 72px); }
.hero-video .videoframe { box-shadow: 0 40px 120px -40px rgba(0,0,0,0.8); }
/* full-bleed hero video (breaks out of padded wrap) */
.hero-video--full { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.hero-video--full .videoframe { border-left: 0; border-right: 0; }

/* ---------- Section headers ---------- */
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.section__head h2 { font-size: clamp(1.8rem, 4.5vw, 3.4rem); }
.section__head .note { color: var(--muted); font-size: 14px; letter-spacing: 0.02em; }

/* ---------- Video tiles (Watch) ---------- */
.vgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 24px);
}
.vtile {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  cursor: pointer;
}
.vtile img,
.vtile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.vtile video { opacity: 0; transition: opacity 0.5s var(--ease); z-index: 1; }
.vtile.previewing video { opacity: 1; }
.vtile__play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.vtile__play svg {
  width: 56px; height: 56px; opacity: 0.94;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,0.7));
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
}
.vtile:hover .vtile__play svg { transform: scale(1.14); }
.vtile.previewing .vtile__play svg { opacity: 0; }
.vtile__label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 20px 20px 17px; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0.15) 65%, transparent);
}
.vtile__brand {
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: clamp(15px, 1.4vw, 21px); letter-spacing: 0.005em; line-height: 1.1;
}
.vtile__sub { color: #b9b9c0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; margin-top: 5px; }

/* Full catalog grid (Watch page — Thoughtcrime /films style) */
.filmgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.2vw, 34px);
}
.filmgrid .vtile__label { padding: 24px 24px 22px; }
.filmgrid .vtile__brand { font-size: clamp(18px, 2vw, 30px); }
.filmgrid .vtile__sub { font-size: 12px; margin-top: 7px; }
.filmgrid .vtile__play svg { width: 66px; height: 66px; }

/* Filmstrip carousel */
.vfilm {
  display: flex;
  gap: clamp(12px, 1.4vw, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 22px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.vfilm::-webkit-scrollbar { height: 6px; }
.vfilm::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.vfilm__item {
  position: relative;
  flex: 0 0 auto;
  height: clamp(300px, 40vw, 420px);
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  cursor: pointer;
}
.vfilm__item img { height: 100%; width: auto; display: block; }
.vfilm__item .vtile__label { padding: 15px 15px 13px; }
.vfilm__item .vtile__play svg { width: 44px; height: 44px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6,6,7,0.95);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 60px);
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox video {
  max-width: min(1100px, 92vw); max-height: 88vh;
  width: auto; height: auto; background: #000;
  box-shadow: 0 30px 120px -30px rgba(0,0,0,0.9);
  transform: scale(0.96); transition: transform 0.4s var(--ease);
}
.lightbox.open video { transform: scale(1); }
.lightbox__spin {
  position: absolute; top: 50%; left: 50%; margin: -23px 0 0 -23px;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.16); border-top-color: var(--accent);
  opacity: 0; pointer-events: none;
  animation: spin 0.8s linear infinite;
  transition: opacity 0.25s var(--ease);
}
.lightbox.loading .lightbox__spin { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox__close {
  position: absolute; top: 20px; right: 24px;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: #fff;
  cursor: pointer; font-size: 20px; line-height: 1;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox__close:hover { border-color: #fff; transform: rotate(90deg); }

.carousel-hint {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; margin-top: 8px;
}
.carousel-hint .arrow { animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 0%,100%{transform:translateX(0)} 50%{transform:translateX(6px)} }

/* ---------- Listen: album rows ---------- */
.album {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: clamp(40px, 6vw, 80px) 0;
  border-top: 1px solid var(--line);
}
.album:nth-child(even) .album__art { order: 2; }
.album__art {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 30px 90px -40px rgba(0,0,0,0.9);
}
.album__art img { width: 100%; height: 100%; object-fit: cover; }
.album__meta .kicker {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 11px; color: var(--accent); margin-bottom: 14px;
}
.album__meta h3 { font-size: clamp(1.5rem, 3.4vw, 2.6rem); margin-bottom: 6px; }
.album__meta .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }

/* ---------- Custom audio player ---------- */
.player { border: 1px solid var(--line); background: var(--bg-elev); }
.player__bar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.player__btn {
  flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--accent);
  background: transparent; color: var(--accent);
  cursor: pointer; display: grid; place-items: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.player__btn:hover { background: var(--accent); color: #0a0a0b; }
.player__btn svg { width: 18px; height: 18px; }
.player__now { flex: 1 1 auto; min-width: 0; }
.player__now .t {
  font-family: "Space Grotesk", sans-serif; font-weight: 500;
  font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player__now .time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.player__seek {
  height: 4px; background: var(--line); position: relative; cursor: pointer; margin-top: 8px;
}
.player__seek .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }

.player__amlink {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; color: var(--muted); font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.player__amlink:hover { color: var(--accent); }

.tracklist { list-style: none; margin: 0; padding: 6px 0; }
.tracklist li {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease);
}
.tracklist li:hover { background: rgba(255,255,255,0.03); }
.tracklist li.active { background: rgba(201,162,78,0.08); }
.tracklist li.active .num { color: var(--accent); }
.tracklist .num {
  font-variant-numeric: tabular-nums; color: var(--muted);
  font-size: 13px; width: 20px; flex: 0 0 auto;
}
.tracklist .name { flex: 1 1 auto; font-size: 15px; }
.tracklist .dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tracklist li.active .eq { display: flex; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.eq span { width: 3px; background: var(--accent); animation: eq 0.9s var(--ease) infinite; }
.eq span:nth-child(2){ animation-delay: 0.25s } .eq span:nth-child(3){ animation-delay: 0.5s }
@keyframes eq { 0%,100%{height:4px} 50%{height:14px} }

/* ---------- About ---------- */
.about-lead {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  line-height: 1.22; letter-spacing: -0.02em;
  max-width: 20ch;
}
.about-body { max-width: 62ch; color: #d7d5cf; font-size: clamp(1rem,1.6vw,1.18rem); }
.about-body p { margin: 0 0 1.3em; }
.about-grid {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: clamp(32px, 6vw, 90px); align-items: start;
}
.credits { list-style: none; margin: 0; padding: 0; }
.credits li {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.credits li span:last-child { color: var(--muted); text-align: right; }
/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 90px) 0 60px;
}
.footer__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.footer__big {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 8vw, 6rem);
  text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.9;
}
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer__links a { color: var(--muted); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.footer__links a:hover { color: var(--text); }
.footer__legal { color: var(--muted); font-size: 12px; margin-top: 40px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Tasteful motion — atmosphere, editorial reveals, navigation.
   All restrained; reduced-motion safe.
   ============================================================ */

/* --- 1. Cinematic atmosphere --- */
.grain, .vignette { position: fixed; pointer-events: none; }
.vignette {
  inset: 0; z-index: 88;
  background: radial-gradient(120% 120% at 50% 45%, transparent 55%, rgba(0,0,0,0.42));
}
.grain {
  top: -50%; left: -50%; width: 200%; height: 200%; z-index: 90;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: grain 6s steps(8) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-4%, -5%); }
  20%  { transform: translate(-8%, 4%); }
  30%  { transform: translate(6%, -6%); }
  40%  { transform: translate(-3%, 7%); }
  50%  { transform: translate(-8%, 3%); }
  60%  { transform: translate(5%, 5%); }
  70%  { transform: translate(-5%, -4%); }
  80%  { transform: translate(6%, 6%); }
  90%  { transform: translate(-2%, -6%); }
  100% { transform: translate(0, 0); }
}

/* Hero intro — staggered fade + rise */
.hero .eyebrow { transition-delay: 0.05s; }
.hero__title   { transition-delay: 0.15s; }
.hero__sub     { transition-delay: 0.32s; }
.hero-video    { transition-delay: 0.46s; }

/* --- 2. Editorial hover + section line draw --- */
.vtile img { transition: transform 1s var(--ease); }
.vtile:hover img { transform: scale(1.06); }
.vtile.previewing:hover img { transform: none; }
.vtile__label { transition: transform 0.5s var(--ease); }
.vtile:hover .vtile__label { transform: translateY(-4px); }

.section__head { position: relative; }
.section__head::before {
  content: ""; position: absolute; top: -1px; left: 0;
  height: 2px; width: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease) 0.1s;
}
.section__head.in::before { transform: scaleX(1); }

/* --- 3. Nav states + page transition --- */
.nav { transition: transform 0.5s var(--ease), background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease); border-bottom: 1px solid transparent; }
.nav--scrolled {
  mix-blend-mode: normal;
  background: rgba(10,10,11,0.72);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--line);
}
.nav--scrolled .nav__brand,
.nav--scrolled .nav__links a { color: var(--text); }
.nav--hidden { transform: translateY(-100%); }

.page-curtain {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  pointer-events: none; opacity: 0; transition: opacity 0.35s var(--ease);
}
.page-curtain.show { opacity: 1; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .filmgrid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .vgrid { grid-template-columns: 1fr; }
  .album { grid-template-columns: 1fr; gap: 28px; }
  .album:nth-child(even) .album__art { order: 0; }
  .album__art { max-width: 380px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav__brand { font-size: 12px; }
  .nav__links { gap: 14px; }
  .nav__links a { font-size: 11px; letter-spacing: 0.12em; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .section__head::before { transform: scaleX(1) !important; }
  .vtile:hover img { transform: none !important; }
  .nav--hidden { transform: none !important; }
  .grain { animation: none !important; }
  .page-curtain { display: none !important; }
}
