﻿@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  color-scheme: dark;
  --paper: #101b2d;
  --ink: #f4ecdc;
  --muted: #b9bdc8;
  --rose: #d6b779;
  --line: #4e5360;
  --serif: 'Playfair Display', Georgia, serif
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 35px
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px
}

button,
a {
  -webkit-tap-highlight-color: transparent
}

button {
  font: inherit;
  cursor: pointer
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 6px
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 20
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rose)
}

.topbar {
  max-width: 1240px;
  margin: auto;
  height: 104px;
  padding: 0 55px;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.brand {
  font: italic 25px var(--serif)
}

.brand span {
  color: var(--rose);
  padding: 0 5px
}

.topbar>span {
  font-size: 10px;
  letter-spacing: 2.8px
}

.header-heart {
  font-size: 29px;
  color: var(--rose)
}

.hero {
  max-width: 1180px;
  margin: auto;
  min-height: 690px;
  padding: 70px 55px 110px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  position: relative;
  gap: 50px
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2.8px;
  color: var(--rose);
  font-weight: 700
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400
}

h1 {
  font-size: clamp(46px, 5.4vw, 72px);
  line-height: 1.13;
  margin: 26px 0
}

em {
  font-weight: 400;
  color: var(--rose)
}

.hero-copy>p,
.section-intro>p,
.ending>p {
  color: var(--muted);
  line-height: 1.95
}

.button {
  background: var(--rose);
  color: #101b2d;
  border: 0;
  border-radius: 4px;
  padding: 17px 23px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  font-size: 12px;
  transition: background .2s, transform .2s
}

.button:hover {
  background: #e8ca8b;
  transform: translateY(-2px)
}

.hero-copy .button {
  margin-top: 23px
}

.button span {
  font-size: 19px
}

.little-note {
  display: block;
  font-size: 11px;
  margin-top: 20px;
  color: #aab2c0
}

.hero-art {
  position: relative;
  padding: 25px;
  isolation: isolate
}

.polaroid {
  margin: 0;
  background: #1b2940;
  padding: 14px 14px 0;
  transform: rotate(7deg);
  box-shadow: 0 16px 38px #00000040;
  position: relative
}

.polaroid:before {
  content: '';
  position: absolute;
  top: -12px;
  left: 36%;
  width: 95px;
  height: 27px;
  background: #d6b77966;
  transform: rotate(-13deg);
  z-index: 2
}

.photo-placeholder {
  background: #2a3b55;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1
}

.cover-photo {
  aspect-ratio: 4/4.3;
  background: radial-gradient(ellipse at 75% 20%, #586278, transparent 70%), linear-gradient(145deg, #263e5b, #35455d 60%, #665d59)
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0
}

.placeholder-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  color: #e4dccb;
  font: italic 23px var(--serif);
  padding: 25px
}

.placeholder-content small {
  font: 9px 'DM Sans', sans-serif;
  letter-spacing: 1.5px
}

.flower {
  font-size: 65px;
  color: #e7c98abf;
  font-style: normal
}

.polaroid figcaption {
  text-align: center;
  font: italic 18px var(--serif);
  padding: 22px 0 26px
}

.orbit {
  position: absolute;
  border: 1px solid #736748;
  border-radius: 50%;
  inset: 0;
  transform: rotate(-25deg);
  z-index: -1
}

.orbit-two {
  inset: 30px -24px;
  transform: rotate(20deg)
}

.floating-heart {
  position: absolute;
  right: -14px;
  top: -8px;
  font: 65px var(--serif);
  color: var(--rose);
  transform: rotate(20deg);
  z-index: 2
}

.art-note {
  position: absolute;
  bottom: -41px;
  right: 5px;
  font: italic 16px/1.5 var(--serif);
  color: var(--rose);
  transform: rotate(-7deg)
}

.sparkle {
  position: absolute;
  bottom: 30px;
  left: -25px;
  font-size: 46px;
  color: var(--rose)
}

.scroll-note {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
  color: var(--muted)
}

.scroll-note span {
  display: block;
  font-size: 23px;
  margin-top: 13px
}

.journey {
  max-width: 960px;
  margin: auto;
  padding: 110px 35px 25px
}

.section-intro {
  text-align: center;
  margin-bottom: 70px
}

h2 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.25;
  margin: 19px 0
}

.section-intro>p {
  font-size: 13px
}

.timeline {
  position: relative
}

.timeline:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 2px dashed var(--line)
}

.memory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  align-items: center;
  position: relative;
  margin-bottom: 80px
}

.memory:before {
  content: '♡';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 50%;
  text-align: center;
  line-height: 33px;
  color: var(--rose)
}

.memory-photo {
  margin: 0;
  background: #1b2940;
  padding: 10px 10px 0;
  transform: rotate(-3deg);
  box-shadow: 0 8px 25px #00000030
}

.memory-photo figcaption {
  padding: 15px 0;
  text-align: center;
  font: italic 14px var(--serif);
  color: var(--muted)
}

.memory:nth-of-type(even) .memory-photo {
  grid-column: 2;
  grid-row: 1;
  transform: rotate(3deg)
}

.memory:nth-of-type(even) .memory-copy {
  grid-column: 1;
  grid-row: 1;
  text-align: right
}

.memory:nth-of-type(2) .photo-placeholder {
  background: #304759
}

.memory:nth-of-type(3) .photo-placeholder {
  background: #3d4059
}

.memory-copy h3 {
  font-size: 29px;
  margin: 15px 0
}

.memory-copy p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.95
}

.memory-copy .eyebrow {
  font-size: 9px;
  letter-spacing: 2px
}

.ending {
  text-align: center;
  padding: 85px 24px 90px;
  background: radial-gradient(ellipse at center, #d6b77912, transparent 65%)
}

.ending-heart {
  display: block;
  color: var(--rose);
  font: 64px var(--serif);
  margin: 23px 0 12px
}

.ending>p {
  font-size: 14px
}

.ending .button {
  margin-top: 20px
}

.last-note {
  display: block;
  margin-top: 45px;
  font: italic 19px var(--serif);
  color: var(--rose)
}

.letter {
  max-width: 580px;
  margin: 40px auto 0;
  padding: 38px;
  background: #1b2940;
  border: 1px solid #4e5360;
  text-align: left;
  box-shadow: 0 12px 40px #00000030
}

.letter h3 {
  font-size: 28px
}

.letter p {
  line-height: 1.95;
  white-space: pre-line;
  color: var(--muted)
}

.signature {
  font: italic 20px var(--serif);
  color: var(--rose)
}

footer {
  text-align: center;
  padding: 26px 20px 125px;
  border-top: 1px solid #344158;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted)
}

footer span {
  color: var(--rose);
  margin-left: 7px
}

.music-player {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1b2940f5;
  border: 1px solid #4e5360;
  border-radius: 12px;
  padding: 13px 16px;
  width: min(365px, calc(100% - 30px));
  box-shadow: 0 8px 35px #00000040;
  z-index: 10
}

.play-button {
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 50%;
  background: var(--rose);
  color: white;
  flex-shrink: 0
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1
}

.track-info>span {
  font-size: 7px;
  letter-spacing: 1.7px;
  color: var(--rose)
}

.track-info strong {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.track-info small {
  font-size: 9px;
  color: var(--muted)
}

.next-button {
  border: 0;
  background: transparent;
  color: var(--rose);
  font-size: 26px;
  padding: 5px
}

[hidden] {
  display: none !important
}

@media(max-width:700px) {
  .topbar {
    height: 78px;
    padding: 0 24px
  }

  .topbar>span {
    font-size: 8px;
    letter-spacing: 1.4px
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 44px 27px 85px;
    gap: 50px;
    text-align: center
  }

  .hero-art {
    width: min(320px, 85%);
    margin: 0 auto 40px
  }

  .hero h1 {
    font-size: 49px
  }

  .hero-copy>p {
    font-size: 14px
  }

  .little-note {
    font-size: 10px
  }

  .journey {
    padding: 80px 25px 0
  }

  .section-intro {
    margin-bottom: 45px
  }

  .timeline:before {
    left: 10px
  }

  .memory {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-left: 42px;
    margin-bottom: 55px
  }

  .memory:before {
    left: 10px;
    top: 30px;
    width: 27px;
    height: 27px;
    line-height: 25px
  }

  .memory-photo {
    max-width: 340px;
    width: 100%;
    justify-self: center
  }

  .memory:nth-of-type(even) .memory-photo,
  .memory:nth-of-type(even) .memory-copy {
    grid-column: 1;
    grid-row: auto;
    text-align: left
  }

  .memory-copy h3 {
    font-size: 27px
  }

  .ending {
    padding-top: 30px
  }

  .ending>p br {
    display: none
  }

  .letter {
    padding: 25px
  }

  .orbit-two {
    inset: 30px -12px
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto
  }

  *,
  *:before,
  *:after {
    transition: none !important
  }
}

/* La nitidez depende de cuánto se ha avanzado, sin temporizadores. */
.camino-animado::before {
  border-color: var(--rose);
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--camino-visible), transparent var(--camino-difuso));
  mask-image: linear-gradient(to bottom, #000 var(--camino-visible), transparent var(--camino-difuso));
}

.recuerdo-animado>.memory-photo,
.recuerdo-animado>.memory-copy,
.recuerdo-animado>.song-card,
.recuerdo-animado::before {
  opacity: var(--claridad, 1);
  filter: blur(var(--desenfoque, 0px));
}

.recuerdo-animado>.memory-photo,
.recuerdo-animado>.memory-copy,
.recuerdo-animado>.song-card {
  translate: 0 var(--desplazamiento, 0px);
}

@media (prefers-reduced-motion: reduce) {
  .camino-animado::before {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .recuerdo-animado>.memory-photo,
  .recuerdo-animado>.memory-copy,
  .recuerdo-animado>.song-card,
  .recuerdo-animado::before {
    opacity: 1;
    filter: none;
    translate: none;
  }
}

.song-stop {
  position: relative;
  margin: 0 auto 90px;
  padding: 24px 0;
}

.song-card {
  position: relative;
  width: min(100%, 380px);
  margin: auto;
  padding: 12px;
  background: #1b2940;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 35px #00000040;
}

.song-photo {
  margin: 0;
}

.song-photo .photo-placeholder {
  aspect-ratio: 4 / 3;
  background: #3d4059;
}

.song-photo figcaption {
  padding: 17px 8px;
  text-align: center;
  color: var(--muted);
  font: italic 15px var(--serif);
}

.song-controls {
  padding: 16px 10px 8px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.song-controls .eyebrow {
  font-size: 8px;
  letter-spacing: 1.7px;
}

.song-controls h3 {
  font-size: 25px;
  margin: 14px 0 20px;
}

.song-controls audio {
  display: block;
  width: 100%;
  height: 44px;
}

.song-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 15px 0 5px;
}

footer {
  padding-bottom: 35px;
}

@media (max-width: 700px) {
  .song-stop {
    padding: 12px 0 12px 42px;
    margin-bottom: 55px;
  }

  .song-controls {
    padding-left: 0;
    padding-right: 0;
  }
}

.song-controls audio {
  color-scheme: dark;
  accent-color: var(--rose);
}
/* Menos adornos, superficies mates y movimientos pequeños. */
.orbit, .floating-heart, .sparkle, .art-note, .polaroid::before { display: none; }
:root { --line: #354154; --rose: #c5ad80; }
.progress { height: 2px; }
.polaroid, .memory-photo, .memory:nth-of-type(even) .memory-photo {
  transform: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #172336;
  box-shadow: 0 8px 24px #0000001a;
}
.hero-art { padding: 16px; }
.flower { font-size: 36px; opacity: .65; }
.timeline::before { border-left-width: 1px; border-left-style: solid; }
.memory::before { content: ''; width: 9px; height: 9px; background: var(--rose); border: 3px solid var(--paper); box-sizing: content-box; }
.song-card { border-radius: 3px; background: #172336; box-shadow: none; }
.ending { background: none; }
.ending-heart { font-size: 38px; }
.button { background: transparent; color: var(--ink); border: 1px solid #8e8066; }
.button:hover { background: #c5ad8012; }
.photo-placeholder img { transition: transform 1.2s ease; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .polaroid:hover img, .memory-photo:hover img, .song-photo:hover img { transform: scale(1.025); }
}
.letter:not([hidden]) { animation: letter-open .65s ease both; }
@keyframes letter-open {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.scratch-cover { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .8s ease; }
.scratch-cover.is-scratching { pointer-events: auto; touch-action: none; cursor: crosshair; }
.scratch-cover.is-revealed { opacity: 0; pointer-events: none; }
.scratch-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; padding: 3px 10px 17px; }
.scratch-actions button { background: none; border: 0; padding: 7px 0; color: var(--rose); font-size: 11px; border-bottom: 1px solid #c5ad8033; }
.scratch-actions button:hover { color: var(--ink); }
.scratch-actions button[aria-disabled='true'] { cursor: default; border-color: transparent; }
.scratch-status { flex-basis: 100%; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) {
  .letter:not([hidden]) { animation: none; }
  .photo-placeholder img { transform: none; }
}

/* Bordes iluminados y sombras en capas para dar volumen sin recargar. */
.polaroid.depth-card, .memory-photo.depth-card, .song-card.depth-card {
  position: relative;
  background: linear-gradient(145deg, #24334a, #172336 65%);
  border-color: #ffffff1c;
  border-top-color: #ffffff30;
  border-radius: 8px;
  box-shadow: 0 2px 3px #00000035, 0 16px 32px -12px #00000080, inset 0 1px 0 #ffffff08;
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .3s ease-out, box-shadow .35s ease, border-color .35s ease;
}
.depth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--light-x, 30%) var(--light-y, 0%), #f4ecdc0d, transparent 65%);
}
.depth-card .photo-placeholder { border-radius: 4px; box-shadow: 0 1px 0 #ffffff12; }
.letter { background: linear-gradient(145deg, #223149, #172336); border-top-color: #ffffff30; border-radius: 7px; box-shadow: 0 18px 45px -20px #000000aa; }
.song-status:empty, .scratch-status:empty { display: none; }
.song-controls { margin-top: 14px; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .depth-card:hover { box-shadow: 0 3px 5px #00000040, 0 25px 45px -15px #000000aa, inset 0 1px 0 #ffffff12; border-color: #c5ad8055; }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid.depth-card, .memory-photo.depth-card, .song-card.depth-card { transform: none; }
}

/* El sendero conserva el mismo revelado difuminado que acompaña al scroll. */
.timeline:has(.winding-path)::before,
.timeline:has(.winding-path) > .memory::before { display: none; }
.winding-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  color: var(--rose);
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--camino-visible), transparent var(--camino-difuso));
  mask-image: linear-gradient(to bottom, #000 var(--camino-visible), transparent var(--camino-difuso));
}
.winding-line { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.path-stop { fill: var(--paper); stroke: currentColor; stroke-width: 1.3; }
@media (prefers-reduced-motion: reduce) {
  .winding-path { -webkit-mask-image: none; mask-image: none; }
}

/* Portada independiente, sin fotos ni contenido de la historia adelantado. */
.welcome-page { background: radial-gradient(ellipse at 50% 40%, #20314b 0, #101b2d 65%); }
.welcome { min-height: 100svh; max-width: 900px; margin: auto; padding: 60px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-thread { width: 190px; height: 95px; margin: 20px 0 5px; stroke: var(--rose); stroke-width: 1.2; opacity: .8; }
.welcome-thread circle { fill: var(--paper); }
.welcome h1 { font-size: clamp(40px, 6vw, 70px); margin: 12px 0 22px; }
.welcome p { color: var(--muted); margin: 0 0 35px; font-size: 14px; }
.welcome-signature { margin-top: 55px; color: var(--muted); font: italic 16px var(--serif); }
@media (prefers-reduced-motion: no-preference) {
  .welcome > * { animation: letter-open 1s ease both; }
  .welcome .button { animation-delay: .15s; }
}
/* Más espacio para que los bucles se vean entre las fotos y las canciones. */
.memory { margin-bottom: 130px; }
.song-stop { margin-bottom: 130px; }
.winding-line { stroke-width: 2; opacity: .95; }
.path-stop { stroke-width: 1.8; }
@media (max-width: 700px) {
  .memory { padding-left: 60px; margin-bottom: 90px; }
  .song-stop { padding-left: 60px; margin-bottom: 90px; }
  .journey { padding-left: 16px; padding-right: 20px; }
  .winding-line { stroke-width: 1.7; }
}
