/* =============================================================
   LA HISTORIA — stylesheet
   1. Tokens
   2. Reset & base
   3. Utilities
   4. Typography
   5. Components (nav, buttons, marquee, grain)
   6. Sections
   7. Effects / reveals
   8. Responsive
   ============================================================= */

/* 1. Tokens ---------------------------------------------------- */
:root {
  --bg:         #0c0b0a;
  --bg-1:       #100f0d;
  --bg-2:       #171512;
  --bg-3:       #201d19;
  --cream:      #f1ede4;
  --cream-2:    #cfc9bd;
  --mute:       #948d80;
  --mute-2:     #635e54;
  --line:       rgba(241,237,228,0.14);
  --line-strong:rgba(241,237,228,0.30);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 84px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --container: 1280px;
}

/* 2. Reset & base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1; letter-spacing: -0.01em; font-weight: 400; }
::selection { background: var(--cream); color: var(--bg); }

:focus-visible {
  outline: 1px solid var(--cream);
  outline-offset: 4px;
}

/* 3. Utilities ---------------------------------------------------- */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1.2rem; background: var(--cream); color: var(--bg);
  z-index: 9999; font-weight: 500; font-size: .85rem;
}
.skip-link:focus { top: 1rem; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.kicker {
  display: flex;
  align-items: center;
  gap: .7em;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--mute);
}
.kicker::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--mute-2);
  display: inline-block;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* 4. Typography ------------------------------------------------- */
.display {
  font-family: var(--serif);
  font-optical-sizing: auto;
}
.italic { font-style: italic; }

/* 5. Components --------------------------------------------------- */

/* film grain, fixed over everything */
.grain {
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* nav */
.nav {
  position: fixed; inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .5s var(--ease-out), border-color .5s var(--ease-out);
}
.nav.is-solid {
  background: rgba(12,11,10,0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.nav-inner {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.nav-links {
  display: none;
  gap: clamp(1.4rem, 2.4vw, 2.6rem);
  list-style: none;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cream-2);
}
.nav-links a {
  position: relative;
  padding-block: .3rem;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--cream);
  transition: right .4s var(--ease-out);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after { right: 0; }

.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  padding: .5rem;
}
.nav-toggle span { width: 22px; height: 1px; background: var(--cream); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .5s var(--ease-out), visibility .5s;
}
.menu-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.menu-overlay ul {
  list-style: none;
  text-align: center;
  display: flex; flex-direction: column; gap: 1.4rem;
}
.menu-overlay a {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 3rem);
  letter-spacing: .01em;
}
.menu-overlay a:hover { font-style: italic; }

/* buttons / links */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  padding-block: .5rem;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .35s var(--ease-out), gap .35s var(--ease-out);
}
.btn:hover { border-color: var(--cream); gap: .9rem; }

/* marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 1.6rem;
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: marquee 42s linear infinite;
}
.marquee-track span {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.9rem);
  color: var(--cream-2);
  white-space: nowrap;
}
.marquee-track span::after {
  content: "—";
  margin-left: 3rem;
  color: var(--mute-2);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 6. Sections ------------------------------------------------------ */
section { position: relative; }

/* HERO */
.hero {
  min-height: 100svh;
  display: flex; align-items: flex-end;
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  overflow: hidden;
  background: var(--bg);
}
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 84% 28%;
  filter: grayscale(1) contrast(1.02);
  opacity: .5;
  transform: scale(1.04);
  animation: heroBreathe 46s var(--ease-soft) infinite alternate;
}
@keyframes heroBreathe {
  from { transform: scale(1.04); }
  to   { transform: scale(1.1); }
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(12,11,10,.4) 0%, rgba(12,11,10,.25) 30%, rgba(12,11,10,.6) 68%, rgba(12,11,10,.97) 100%),
    linear-gradient(90deg, rgba(12,11,10,.92) 0%, rgba(12,11,10,.55) 40%, rgba(12,11,10,.15) 72%, rgba(12,11,10,.35) 100%);
}

/* the photo (2436×2048) is wider than tall — on a narrower-than-photo
   viewport (phones, portrait tablets) "cover" has to crop so much
   horizontally that only one of the three faces survives. Switch to
   "contain" there: the photo's own near-black background matches
   --bg, so the letterboxing reads as intentional negative space
   rather than a broken crop, and all three musicians stay visible. */
@media (max-aspect-ratio: 6/5) {
  .hero-bg img {
    object-fit: contain;
    object-position: 50% 14%;
    opacity: .62;
    transform: none;
    animation: none;
  }
  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(12,11,10,.15) 0%, rgba(12,11,10,.35) 42%, rgba(12,11,10,.75) 72%, rgba(12,11,10,.98) 100%);
  }
}
.hero-inner {
  width: 100%;
  padding: var(--gutter);
  padding-bottom: clamp(3rem, 8vh, 5.5rem);
}
.hero-kicker {
  font-size: .74rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--cream-2);
  margin-bottom: 1.4rem;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 9.5rem);
  letter-spacing: .01em;
  line-height: .92;
}
.hero-sub {
  max-width: 34ch;
  margin-top: 1.6rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--cream-2);
  font-weight: 300;
}
.hero-foot {
  margin-top: clamp(2.4rem, 6vh, 3.6rem);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.hero-trio {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mute);
}
.scroll-cue {
  display: flex; align-items: center; gap: .6rem;
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--mute);
}
.scroll-cue .line {
  width: 1px; height: 30px; background: var(--mute-2);
  position: relative; overflow: hidden;
}
.scroll-cue .line::after {
  content: ""; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%; background: var(--cream);
  animation: scrollLine 2.2s var(--ease-soft) infinite;
}
@keyframes scrollLine {
  0% { top: -100%; } 60% { top: 100%; } 100% { top: 100%; }
}

/* generic editorial section spacing */
.section {
  padding-block: clamp(5rem, 12vh, 9rem);
  border-top: 1px solid var(--line);
}

/* HISTORIA */
.historia-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}
.historia-lede {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  line-height: 1.3;
  color: var(--cream);
  max-width: 22ch;
}
.historia-body {
  max-width: 62ch;
  color: var(--cream-2);
  font-size: clamp(.98rem, 1.2vw, 1.08rem);
  display: flex; flex-direction: column; gap: 1.3em;
}
.historia-body strong { color: var(--cream); font-weight: 500; }

/* LA BANDA */
.banda-list {
  list-style: none;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}
.banda-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  align-items: baseline;
  gap: 1.2rem;
  padding-block: clamp(1.6rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--line);
  transition: padding-left .5s var(--ease-out);
}
.banda-item:hover { padding-left: 1rem; }
.banda-num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--mute-2);
  font-size: 1.05rem;
}
.banda-name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  letter-spacing: .01em;
}
.banda-role {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: right;
  white-space: nowrap;
}

/* INFLUENCIAS */
.influencias-head { max-width: 50ch; }
.influencias-head p { color: var(--cream-2); margin-top: 1rem; }

/* DIRECTO / VIDEO */
.video-wrap {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  position: relative;
}
.video-frame {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}
.video-frame video {
  width: 100%; height: 100%; object-fit: cover;
}
.video-caption {
  margin-top: 1.1rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mute);
}

/* CONTACTO / FOOTER */
.footer {
  padding-block: clamp(4rem, 10vh, 7rem);
  border-top: 1px solid var(--line);
}
.footer-title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 9vw, 6.5rem);
  line-height: .95;
}
.footer-title em { font-style: italic; color: var(--cream-2); }
.footer-grid {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: grid;
  gap: 2.5rem;
  padding-top: clamp(2rem, 5vh, 3rem);
  border-top: 1px solid var(--line);
}
.footer-col h4 {
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 1rem; font-weight: 500;
}
.footer-col a, .footer-col p {
  font-size: .95rem; color: var(--cream-2);
}
.footer-col a { display: block; margin-bottom: .5rem; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .72rem; letter-spacing: .08em;
  color: var(--mute-2);
}

/* sound toggle */
.sound-toggle {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 80;
  display: flex; align-items: center; gap: .65rem;
  padding: .7rem 1.1rem;
  background: rgba(12,11,10,0.72);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--cream-2);
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  transition: border-color .35s var(--ease-out), color .35s var(--ease-out);
}
.sound-toggle:hover { border-color: var(--line-strong); color: var(--cream); }
.sound-bars {
  display: inline-flex; align-items: flex-end; gap: 2px;
  width: 14px; height: 12px;
}
.sound-bars i {
  display: block; width: 3px; background: currentColor;
  height: 30%;
  transition: height .3s var(--ease-out);
}
.sound-toggle.is-playing .sound-bars i { animation: soundBar 1s ease-in-out infinite; }
.sound-toggle.is-playing .sound-bars i:nth-child(1) { animation-delay: -0.6s; }
.sound-toggle.is-playing .sound-bars i:nth-child(2) { animation-delay: -0.2s; }
.sound-toggle.is-playing .sound-bars i:nth-child(3) { animation-delay: -0.9s; }
@keyframes soundBar {
  0%, 100% { height: 25%; }
  50%      { height: 100%; }
}

/* 7. Effects / reveals ------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="1"] { transition-delay: .12s; }
[data-reveal-delay="2"] { transition-delay: .24s; }

/* 8. Responsive -------------------------------------------------------- */
@media (min-width: 720px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .historia-grid { grid-template-columns: 1fr 1.4fr; }
  .banda-item { grid-template-columns: 5rem 1fr auto; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .container { padding-inline: var(--gutter); }
}

@media (max-width: 539px) {
  .sound-label { display: none; }
  .sound-toggle { padding: .7rem; }
}
