:root {
  --cream: #f3ead8;
  --cream-2: #eae0c9;
  --green: #223d2c;
  --green-2: #16281c;
  --leather: #5b3a29;
  --gold: #c89b3c;
  --ink: #241c15;
  --stitch: #8b3a3a;
  --paper-line: rgba(36, 28, 21, 0.08);
  --shadow: 0 18px 40px rgba(22, 40, 28, 0.18);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Newsreader", serif;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
.display {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.mono {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}

/* ---------- Textured background ---------- */
.paper {
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 27px,
    var(--paper-line) 28px
  );
}

/* ---------- Stitch divider (signature element) ---------- */
.stitch {
  width: 100%;
  height: 34px;
  display: block;
}
.stitch svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(
      180deg,
      rgba(22, 40, 28, 0.15) 0%,
      rgba(15, 26, 18, 0.55) 55%,
      rgba(13, 22, 15, 0.92) 100%
    ),
    url("fotos/portada.jpg") center 30% / cover no-repeat;
  color: var(--cream);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 10px rgba(243, 234, 216, 0.08);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 6vw 7vh;
  width: 100%;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
}
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 6.2rem);
  line-height: 0.98;
}
.hero .years {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--cream-2);
  margin-top: 18px;
  opacity: 0.85;
}
.hero .tagline {
  margin-top: 22px;
  max-width: 46ch;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-style: italic;
  color: var(--cream-2);
}
.scroll-cue {
  position: absolute;
  right: 6vw;
  bottom: 5vh;
  z-index: 2;
  color: var(--cream-2);
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}
.scroll-cue span {
  writing-mode: vertical-rl;
}
.scroll-cue .line {
  width: 1px;
  height: 40px;
  background: var(--cream-2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- Section shell ---------- */
section {
  padding: 110px 6vw;
}
.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head .mono {
  font-size: 0.72rem;
  color: var(--leather);
  display: block;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.section-head p {
  margin-top: 16px;
  font-size: 1.08rem;
  color: rgba(36, 28, 21, 0.75);
}

/* ---------- Bio ---------- */
.bio {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.bio p {
  font-size: 1.28rem;
  line-height: 1.7;
  color: rgba(36, 28, 21, 0.86);
}
.bio .signoff {
  margin-top: 26px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--leather);
}

/* ---------- Search / filter ---------- */
.album-bg {
  background: var(--green);
  color: var(--cream);
}
.album-bg .section-head .mono {
  color: var(--gold);
}
.album-bg .section-head p {
  color: rgba(243, 234, 216, 0.75);
}

.controls {
  max-width: 760px;
  margin: 0 auto 52px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
}
.search-wrap input {
  width: 100%;
  padding: 14px 20px 14px 46px;
  border-radius: 999px;
  border: 1px solid rgba(243, 234, 216, 0.25);
  background: rgba(243, 234, 216, 0.08);
  color: var(--cream);
  font-family: "Newsreader", serif;
  font-size: 1rem;
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.search-wrap input::placeholder {
  color: rgba(243, 234, 216, 0.55);
}
.search-wrap input:focus {
  border-color: var(--gold);
  background: rgba(243, 234, 216, 0.13);
}
.search-wrap svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(243, 234, 216, 0.3);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover {
  border-color: var(--gold);
}
.pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-2);
  font-weight: 600;
}

.filter-wrap {
  max-width: 1200px;
  margin: 0 auto 40px;
  display: flex;
  justify-content: center;
}
.pill[data-active="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-2);
  font-weight: 600;
}

/* ---------- Grid ---------- */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 34px 28px;
}
.card {
  background: var(--cream);
  padding: 14px 14px 20px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transform: rotate(var(--rot, 0deg));
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  position: relative;
}
.card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}
.card .frame {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 5;
}
.card .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) saturate(0.92);
  transition: transform 0.5s ease;
}
.card:hover .frame img {
  transform: scale(1.06);
}
.tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 70px;
  height: 22px;
  background: rgba(200, 155, 60, 0.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ---------- Card action buttons (ver / descargar) ---------- */
.card .cap {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.dl-btn,
.view-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s,
    border-color 0.2s;
}
.dl-btn svg,
.view-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.dl-btn {
  background: var(--green);
  color: var(--cream);
}
.dl-btn:hover {
  background: var(--stitch);
  border-color: var(--stitch);
  transform: translateY(-2px);
}
.view-btn:hover {
  background: var(--green);
  color: var(--cream);
  transform: translateY(-2px);
}

.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: rgba(243, 234, 216, 0.7);
  font-style: italic;
  display: none;
}

.loadmore-wrap {
  max-width: 1200px;
  margin: 52px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.btn-loadmore {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-loadmore:hover {
  background: var(--gold);
  color: var(--green-2);
}
.btn-loadmore[hidden] {
  display: none;
}
.count-label {
  font-size: 0.68rem;
  color: rgba(243, 234, 216, 0.55);
}

/* ---------- Document section ---------- */
.doc-section {
  background: var(--cream-2);
}
.doc-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--cream);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 44px;
  display: flex;
  gap: 34px;
  align-items: center;
  flex-wrap: wrap;
}
.doc-icon {
  flex: none;
  width: 92px;
  height: 118px;
  background: var(--green);
  border-radius: 4px;
  position: relative;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
.doc-icon::before {
  content: "PDF";
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.doc-icon::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: rgba(243, 234, 216, 0.35);
  box-shadow:
    0 8px 0 rgba(243, 234, 216, 0.25),
    0 16px 0 rgba(243, 234, 216, 0.18);
}
.doc-info {
  flex: 1;
  min-width: 220px;
}
.doc-info h3 {
  font-size: 1.4rem;
}
.doc-info p {
  margin-top: 10px;
  color: rgba(36, 28, 21, 0.72);
  font-size: 1rem;
  line-height: 1.6;
}
.doc-actions {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--green);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-solid {
  background: var(--green);
  color: var(--cream);
}
.btn-solid:hover {
  background: var(--green-2);
}
.btn-outline {
  background: #f3ead8;
  color: var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: var(--cream);
  border: 1px solid #f3ead8;
}

/* Mismo look/hover que .view-btn de las fotos, en tamaño de pill */
.btn-view-doc {
  background: transparent;
  color: var(--green);
}
.btn-view-doc svg {
  width: 15px;
  height: 15px;
}
.btn-view-doc:hover {
  background: var(--green);
  color: var(--cream);
  transform: translateY(-2px);
}

/* ---------- PDF Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 18, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2vh 2vw;
}
.modal.open {
  display: flex;
}
.modal-inner {
  background: var(--cream);
  width: 100%;
  max-width: 900px;
  height: 94vh;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: var(--green);
  color: var(--cream);
}
.modal-head span {
  font-family: "Fraunces", serif;
}
.modal-close {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-inner--pdf {
  max-width: 1100px;
  background: var(--green-2);
}
/* Documento PDF */
.pdf-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
  gap: 16px;
}
.pdf-modal-body canvas {
  max-width: 100%;
  height: auto !important;
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.pdf-nav {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px;
  background: var(--green-2);
  color: var(--cream-2);
}
.pdf-nav[hidden] {
  display: none;
}
.pdf-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(243, 234, 216, 0.35);
  background: transparent;
  color: var(--cream);
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.pdf-nav-btn:hover {
  background: rgba(243, 234, 216, 0.15);
  border-color: var(--gold);
}
.pdf-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  background: transparent;
}
#pdfPageInfo {
  font-size: 0.72rem;
  opacity: 0.75;
}

.modal-inner--photo {
  max-width: 1000px;
  background: var(--green-2);
}
.photo-modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
}
.photo-modal-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ---------- Reproductor de música flotante (disco de vinilo) ---------- */
.music-toggle {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 200;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #1c1108;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: music-pulse 2.4s ease-in-out infinite;
  transition: transform 0.2s ease;
}
.music-toggle:hover {
  transform: scale(1.06);
}
.music-toggle.playing {
  animation: none;
}

@keyframes music-pulse {
  0%,
  100% {
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.45),
      0 0 0 0 rgba(139, 58, 58, 0.5);
  }
  50% {
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.45),
      0 0 0 14px rgba(139, 58, 58, 0);
  }
}

.vinyl-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    var(--stitch) 0px,
    var(--stitch) 1px,
    #1c1108 1px,
    #1c1108 4px
  );
  border: 2px solid var(--stitch);
}
.music-toggle.playing .vinyl-grooves {
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.vinyl-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--cream);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.music-toggle svg {
  position: relative;
  z-index: 3;
  width: 22px;
  height: 22px;
  color: var(--cream);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.icon-play {
  margin-left: 4px;
}

@media (max-width: 640px) {
  .music-toggle {
    bottom: 18px;
    right: 18px;
    width: 58px;
    height: 58px;
  }
}

/* ---------- Footer ---------- */
footer {
  background: var(--green-2);
  color: var(--cream-2);
  text-align: center;
  padding: 70px 6vw 46px;
}
footer .display {
  font-size: 1.6rem;
  color: var(--cream);
}
footer p {
  margin-top: 14px;
  opacity: 0.7;
  font-size: 0.95rem;
}
footer .signature {
  margin-top: 36px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.45;
}

@media (max-width: 640px) {
  section {
    padding: 80px 6vw;
  }
  .doc-card {
    padding: 30px;
  }
}
