:root {
  --night: #07060c;
  --cream: #f4efe6;
  --gold: #d9c7a4;
  --ink: #241c17;
  --paper: #f3eadc;
  --blue-bg: #d5e4f3;
  --liquid: #d64558;
  --liquid-hi: #f4a0a8;
  --heart-line: rgba(244, 239, 230, 0.92);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --heart-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 21s-7-4.4-7-9a4 4 0 0 1 7-2 4 4 0 0 1 7 2c0 4.6-7 9-7 9z'/></svg>");
  --heart-line-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='1.6' d='M12 20.2s-6-3.8-6-8a3.4 3.4 0 0 1 6-1.8 3.4 3.4 0 0 1 6 1.8c0 4.2-6 8-6 8z'/></svg>");
  color-scheme: dark;
}

@property --liquid {
  syntax: "<color>";
  inherits: true;
  initial-value: #d64558;
}

@property --liquid-hi {
  syntax: "<color>";
  inherits: true;
  initial-value: #f4a0a8;
}

@property --heart-line {
  syntax: "<color>";
  inherits: true;
  initial-value: #f4efe6;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

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

html, body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  touch-action: manipulation;
}

body {
  font-family: "Cormorant Garamond", Palatino, "Palatino Linotype", Georgia, serif;
  overflow-x: clip;
  transition: --liquid 1.15s ease, --liquid-hi 1.15s ease, --heart-line 1.15s ease;
}

body:not(.story) {
  overflow: hidden;
  height: 100dvh;
}

[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

p, h2, h3, figure { margin: 0; }

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

::selection {
  background: rgba(201, 168, 110, 0.35);
  color: inherit;
}

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

/* ---------- cielo ---------- */

#cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background: #03040c;
  transition: opacity 3.4s var(--ease);
}

body.is-galaxy #cosmos { opacity: 1; }

#cosmos.notrans { transition: none; }

#sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.nebula, .core, #grain { display: none; }

#sparkles {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  position: absolute;
  width: var(--s);
  height: var(--s);
  background: currentColor;
  -webkit-mask: var(--heart-mask) center / contain no-repeat;
  mask: var(--heart-mask) center / contain no-repeat;
  animation: rise var(--dur) ease-out forwards;
}

.spark.line {
  -webkit-mask-image: var(--heart-line-mask);
  mask-image: var(--heart-line-mask);
}

@keyframes rise {
  0% { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.7); }
  16% { opacity: var(--a); }
  100% { opacity: 0; transform: translate3d(var(--dx), -128px, 0) scale(1); }
}

#veil {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #03040c;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s var(--ease);
}

body.warp #veil { opacity: 0.28; }
body.cut #veil { opacity: 1; transition-duration: 0.32s; }

/* ---------- intro ---------- */

#intro {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: #09080c;
  color: var(--cream);
  transition:
    background 1.8s var(--ease),
    color 1.2s var(--ease),
    --liquid 1.6s var(--ease),
    --liquid-hi 1.6s var(--ease),
    --heart-line 1.6s var(--ease);
}

#intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.34) 100%);
}

body.is-blue #intro {
  background: var(--blue-bg);
  color: #1c3348;
  --liquid: #6f9ed9;
  --liquid-hi: #d7e9ff;
  --heart-line: #3d6ca5;
}

body.is-galaxy #intro {
  background: transparent;
  --liquid: #8eb6ef;
  --liquid-hi: #e7f1ff;
  --heart-line: rgba(232, 240, 255, 0.95);
  transition:
    background 3.2s var(--ease),
    color 1.4s var(--ease),
    --liquid 1.8s var(--ease),
    --liquid-hi 1.8s var(--ease),
    --heart-line 1.8s var(--ease);
}

body.text-light #intro { color: var(--cream); }

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10vh 24px 18vh;
  transition: opacity 0.9s var(--ease);
}

body.warp .stage { opacity: 0; }

.lockup {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  text-align: center;
  pointer-events: none;
  transform: translateY(-58%);
  transform-origin: top center;
  transition: opacity 1.15s var(--ease), transform 1.45s var(--ease), top 1.45s var(--ease);
}

body.show-heart .lockup {
  top: 6.5vh;
  transform: scale(0.84);
}

body.is-typing .lockup {
  opacity: 0;
  transform: translateY(-10px) scale(0.84);
}

.ten {
  font-weight: 300;
  font-size: clamp(7.4rem, 34vw, 11.2rem);
  line-height: 0.78;
  letter-spacing: -0.045em;
  font-variant-numeric: lining-nums;
}

.ten span {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.7s var(--ease), transform 1.7s var(--ease);
}

.ten span:nth-child(2) { transition-delay: 0.18s; }

body.show-ten .ten span {
  opacity: 1;
  transform: none;
}

.rule-ten {
  display: block;
  width: 34px;
  height: 1px;
  margin: 22px auto 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1s var(--ease) 0.25s;
}

body.show-ten .rule-ten { transform: scaleX(1); }

.meses {
  margin-top: 16px;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.85rem, 7vw, 2.65rem);
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  color: #e7d7bc;
}

body.is-blue .meses { color: #3e6288; }

.meses span {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.15s var(--ease), transform 1.15s var(--ease);
  transition-delay: calc(var(--i) * 110ms);
}

body.show-meses .meses span {
  opacity: 1;
  transform: none;
}

.heart-wrap {
  text-align: center;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 1.2s var(--ease), transform 1.25s var(--ease);
}

body.show-heart .heart-wrap {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

body.is-typing .heart-wrap { transform: translateY(-15vh) scale(0.76); }
body.ready .heart-wrap { opacity: 0; pointer-events: none; }

.heart-btn {
  -webkit-user-select: none;
  user-select: none;
}

.heart-svg {
  width: min(46vw, 176px);
  height: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.28));
}

.heart-svg * { pointer-events: none; }

.heart-btn.pop .heart-svg { animation: pop 0.7s var(--ease); }

@keyframes pop {
  45% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.heart-line {
  fill: none;
  stroke: var(--heart-line);
  stroke-width: 2.6;
  stroke-linejoin: round;
}

.liquid {
  transform: translateY(172px);
  transition: transform 1.05s var(--ease);
}

.liquid rect { fill: var(--liquid); }
.wave { fill: var(--liquid-hi); opacity: 0.55; animation: tide 2.2s linear infinite; }
.gloss { fill: #fff; opacity: 0.22; }

@keyframes tide {
  from { transform: translateX(0); }
  to { transform: translateX(-50px); }
}

.hint {
  margin-top: 18px;
  min-height: 1.2em;
  font-family: Outfit, "Trebuchet MS", sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.show-heart .hint { opacity: 0.72; transition-delay: 0.4s; }
body.is-blue .hint { opacity: 0; }

.hint-soft {
  margin-top: 8px;
  min-height: 1.2em;
  font-family: Outfit, "Trebuchet MS", sans-serif;
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.is-blue .hint-soft { opacity: 0.82; }

.typed-wrap {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 47%;
  opacity: 0;
  transition: opacity 0.7s ease;
}

body.is-typing .typed-wrap { opacity: 1; }

.typed-block {
  max-width: 34ch;
  min-height: 8.6em;
  margin: 0 auto;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
  line-height: 1.75;
  text-align: left;
  white-space: pre-wrap;
  color: #1a3148;
  transition: color 1.3s var(--ease);
}

body.text-light .typed-block {
  color: var(--cream);
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.45);
}

.caret {
  display: inline-block;
  width: 0.55ch;
  height: 0.95em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -0.06em;
  opacity: 0;
}

body.is-typing .caret { animation: blink 1.05s steps(1) infinite; }
body.ready .caret { display: none; }

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.go {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(6vh, 28px);
  width: 92px;
  height: 84px;
  margin: auto;
  color: var(--cream);
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  transition: opacity 0.7s ease, transform 0.7s var(--ease);
}

body.ready .go {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.go-svg { width: 84px; height: auto; overflow: visible; display: block; margin: 0 auto; }
body.ready .go-svg { animation: pulse 2.8s ease-in-out infinite; }

@keyframes pulse {
  50% { transform: scale(1.045); }
}

/* ---------- historia ---------- */

#story { position: relative; z-index: 2; }

#listen {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease);
}

body.is-listening #listen { opacity: 1; }

body.is-listening #cosmos {
  z-index: 4;
  opacity: 1;
  animation: galaxyHue 18s linear infinite;
}

@keyframes galaxyHue {
  from { filter: hue-rotate(0deg) saturate(1.25); }
  to { filter: hue-rotate(360deg) saturate(1.45); }
}

#spectrum {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.listen-copy {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 40px));
  margin-bottom: max(8vh, 36px);
  text-align: center;
  color: var(--cream);
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.listen-kicker {
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e6d3ae;
}

.listen-title {
  margin-top: 8px;
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  line-height: 0.95;
}

.listen-pause {
  margin-top: 18px;
  pointer-events: none;
  padding: 10px 22px;
  border: 1px solid rgba(244, 239, 230, 0.45);
  border-radius: 999px;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}

body.is-listening .listen-pause { pointer-events: auto; }

.sec-head {
  width: min(440px, calc(100% - 40px));
  margin: 0 auto 26px;
}

.sec-head h2 {
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.05rem, 8vw, 2.75rem);
  line-height: 1.02;
  text-wrap: balance;
}

.sec-head i,
.count-line {
  display: block;
  width: 36px;
  height: 1px;
  margin-top: 14px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s var(--ease) 0.12s;
}

.sec-head.in i,
.counter.in .count-line { transform: scaleX(1); }

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.35s var(--ease), transform 1.35s var(--ease);
  transition-delay: var(--d, 0ms);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

.ph {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

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

.tone-1 { background: radial-gradient(circle at 30% 18%, #f0c2b2, transparent 40%), linear-gradient(165deg, #2a3148, #8d4e57 68%, #e6cbb8); }
.tone-2 { background: radial-gradient(circle at 70% 20%, #d5e4ff, transparent 36%), linear-gradient(180deg, #141a2e, #3d5f8a 60%, #c9b7a4); }
.tone-3 { background: radial-gradient(circle at 40% 30%, #f2d2ae, transparent 42%), linear-gradient(160deg, #3a241c, #a86448 70%, #efd3b4); }
.tone-4 { background: radial-gradient(circle at 50% 20%, #efe6d4, transparent 35%), linear-gradient(180deg, #596055, #c7b59a); }
.tone-5 { background: radial-gradient(circle at 35% 25%, #e7b7c4, transparent 40%), linear-gradient(165deg, #2a1520, #7a3148 62%, #e4c2b0); }
.tone-6 { background: radial-gradient(circle at 60% 16%, #f7e7d8, transparent 34%), linear-gradient(180deg, #1c2430, #6d7f90 55%, #ddcabb); }
.tone-7 { background: radial-gradient(circle at 40% 24%, #f6c9a8, transparent 42%), linear-gradient(170deg, #3e2a24, #c47a58 70%, #f0d2bc); }
.tone-8 { background: radial-gradient(circle at 55% 18%, #d9e7ea, transparent 40%), linear-gradient(180deg, #1a2424, #4f6d68 64%, #d9cfc2); }
.tone-9 { background: radial-gradient(circle at 30% 22%, #e6d4f2, transparent 38%), linear-gradient(165deg, #241c2e, #6d5278 66%, #e6d5c8); }
.tone-10 { background: radial-gradient(circle at 50% 16%, #f3e2c2, transparent 36%), linear-gradient(180deg, #2c2418, #8a6a42 62%, #ead7bf); }

/* círculos */

#circulos { padding: 16vh 0 6vh; }

.orbit {
  text-align: center;
  margin: 0 0 15vh;
}

.orb {
  width: min(64vw, 268px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 0 0 11px rgba(255, 255, 255, 0.05),
    0 28px 70px rgba(0, 0, 0, 0.38);
  animation: float 8.5s ease-in-out infinite;
}

.orbit:nth-child(even) .orb { animation-delay: -3.4s; }

@keyframes float {
  50% { transform: translateY(-8px); }
}

.orbit figcaption { margin-top: 22px; padding: 0 28px; }

.orbit figcaption span {
  display: block;
  margin-bottom: 8px;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  color: var(--gold);
}

.orbit figcaption p {
  max-width: 16em;
  margin: 0 auto;
  font-style: italic;
  font-size: 1.38rem;
  line-height: 1.3;
  text-wrap: balance;
}

/* portada y vinilo */

#portada { padding: 4vh 0 14vh; }

.sheet {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  background: #f4eee6;
  color: var(--ink);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.sheet-photo { height: min(92vw, 420px); }

.sheet-body { padding: 22px 24px 30px; }

.player { margin-top: 0; }

.disc-wrap {
  position: relative;
  width: 250px;
  height: 236px;
  margin: 0 auto 18px;
}

.disc-wrap::before {
  content: "";
  position: absolute;
  left: 46px;
  right: 46px;
  bottom: 4px;
  height: 16px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.35), transparent 70%);
}

#yt {
  position: absolute;
  left: 18px;
  top: 12px;
  width: 214px;
  height: 214px;
  opacity: 0.02;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

.disc {
  position: absolute;
  z-index: 1;
  left: 18px;
  top: 12px;
  width: 214px;
  height: 214px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(255, 255, 255, 0.05) 30.4% 30.8%, transparent 31%),
    repeating-radial-gradient(circle at 50% 50%, #101010 0 1px, #1b1b1b 2px, #090909 3px);
  box-shadow:
    inset 0 0 0 9px #141414,
    inset 0 0 0 10px rgba(255, 255, 255, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.28);
  animation: spin 3.8s linear infinite;
  animation-play-state: paused;
}

.player.is-playing .disc { animation-play-state: running; }

.disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 28deg, transparent 0 12%, rgba(255, 255, 255, 0.1) 18%, transparent 30%, transparent 62%, rgba(255, 255, 255, 0.06) 74%, transparent 86%);
}

.wine {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 28%),
    radial-gradient(circle at 50% 50%, #e8b4a6 0%, #b94b4f 46%, #6e2430 80%);
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.28);
}

@keyframes spin { to { transform: rotate(360deg); } }

.disc-btn {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 12px;
  width: 214px;
  height: 214px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
}

.arm {
  position: absolute;
  z-index: 3;
  right: 8px;
  top: 22px;
  width: 104px;
  height: 18px;
  transform-origin: calc(100% - 8px) 8px;
  transform: rotate(-34deg);
  transition: transform 0.7s var(--ease);
  pointer-events: none;
}

.player.is-playing .arm { transform: rotate(-8deg); }

.arm::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #c8c8c8 42%, #6a6a6a);
}

.arm::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 7px;
  width: 78px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #9a9a9a, #f3f3f3 30%, #d0d0d0);
}

.glyph-play {
  width: 0;
  height: 0;
  border-left: 13px solid currentColor;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 4px;
}

.glyph-pause {
  display: none;
  gap: 5px;
}

.glyph-pause i {
  display: block;
  width: 3px;
  height: 14px;
  border-radius: 1px;
  background: currentColor;
}

.is-playing .glyph-play { display: none; }
.is-playing .glyph-pause { display: flex; }

.track { text-align: center; padding: 0 8px; }

.track-kicker {
  margin-bottom: 8px;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a68456;
}

.track-kicker:empty,
.track-note:empty { display: none; }

.track-title { font-size: 1.45rem; line-height: 1.15; }

.track-artist {
  margin-top: 4px;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8d7f6e;
}

.track-artist.is-error {
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.track-note {
  margin-top: 7px;
  font-family: "La Belle Aurore", cursive;
  font-size: 1.45rem;
  line-height: 1;
  color: #8d4e57;
}

.player.is-own .wine {
  box-shadow:
    0 0 0 2px rgba(217, 199, 164, 0.9),
    0 0 0 7px rgba(0, 0, 0, 0.28);
}

.scrub {
  height: 2px;
  margin: 16px 6px 8px;
  background: rgba(36, 28, 22, 0.12);
  border-radius: 99px;
  cursor: pointer;
  touch-action: none;
}

.scrub span {
  display: block;
  height: 100%;
  width: 100%;
  background: #1d1a17;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
}

.times {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  font-family: Outfit, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #8d7f6e;
}

/* momentos */

#momentos { padding: 6vh 0 10vh; }

.swipe-hint {
  margin-top: 12px;
  text-align: right;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(217, 196, 160, 0.86);
  transition: opacity 0.5s ease;
}

.swipe-hint.gone { opacity: 0; }

.scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  padding: 8px 20px 28px;
  scrollbar-width: none;
  cursor: grab;
  overscroll-behavior-x: contain;
}

.scroller::-webkit-scrollbar { display: none; }
.scroller.is-grabbing { cursor: grabbing; }

.moment {
  flex: 0 0 auto;
  width: min(74vw, 280px);
  scroll-snap-align: center;
  background: #f7f3ec;
  color: var(--ink);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.moment .ph { height: 236px; }

.t-body p {
  margin-top: 6px;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #5c534a;
}

/* carta */

#carta {
  --grow: 0;
  height: 380vh;
  background: radial-gradient(ellipse at 50% 42%, #171310 0%, #090808 62%);
}

.letter-pin {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    calc(8px * (1 - var(--grow)) + 10px * var(--grow) + env(safe-area-inset-top) * var(--grow))
    calc(12px * (1 - var(--grow)) + 10px * var(--grow) + env(safe-area-inset-right) * var(--grow))
    calc((8px + env(safe-area-inset-bottom)) * (1 - var(--grow)) + (10px + env(safe-area-inset-bottom)) * var(--grow))
    calc(12px * (1 - var(--grow)) + 10px * var(--grow) + env(safe-area-inset-left) * var(--grow));
}

.letter-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: calc(1 - var(--grow));
  background: radial-gradient(ellipse at center, transparent 28%, rgba(0, 0, 0, 0.58) 100%);
}

.paper {
  position: relative;
  width: min(100%, 400px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding:
    calc(20px + 6px * var(--grow))
    calc(20px + 4px * var(--grow))
    calc(14px + 12px * var(--grow));
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.7), transparent 32%),
    linear-gradient(180deg, #f7f1e6, #f0e2cf);
  color: #2c241c;
  border-radius: calc(18px * (1 - var(--grow)) + 8px * var(--grow));
  box-shadow: 0 30px 70px rgba(0, 0, 0, calc(0.45 * (1 - var(--grow))));
  opacity: 0;
}

.letter-sheet {
  position: relative;
  width: min(100%, 46rem);
  flex: none;
  padding: 2px 4px 16px;
  text-align: center;
  will-change: transform;
}

.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-style: solid;
  border-color: rgba(122, 92, 58, 0.45);
  border-width: 0;
}

.corner.tl { top: 16px; left: 16px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 16px; right: 16px; border-bottom-width: 1px; border-right-width: 1px; }

.letter-kicker {
  text-align: center;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #8d7354;
}

.flourish {
  display: block;
  width: min(62%, 220px);
  height: 12px;
  margin: 0.65em auto 0.8em;
  overflow: visible;
  transform-origin: center;
}

.flourish path {
  fill: none;
  stroke: rgba(122, 92, 58, 0.75);
  stroke-width: 1;
  stroke-linecap: round;
}

.flourish circle { fill: rgba(122, 92, 58, 0.8); }

.letter-line {
  font-family: "La Belle Aurore", "Segoe Script", cursive;
  font-size: clamp(1.95rem, 7.4vw, 2.95rem);
  line-height: 1.38;
  text-align: center;
}

.sign {
  margin-top: 0.28em;
  padding-right: 0;
  text-align: center;
  font-family: "La Belle Aurore", "Segoe Script", cursive;
  font-size: clamp(2.55rem, 9vw, 3.55rem);
  line-height: 1.05;
}

.seal-wrap { display: grid; place-items: center; margin-top: 12px; }

.seal {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: rotate(-8deg);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.28), transparent 26%),
    radial-gradient(circle at 50% 50%, #c84860, #7c1e32 72%);
  color: #fdecef;
  font-size: 1.22rem;
  font-variant-numeric: lining-nums;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.22),
    0 8px 16px rgba(80, 10, 24, 0.28);
}

.paper [data-at] { opacity: 0; }

/* tiempo */

#tiempo { padding: 16vh 0 10vh; }

.counter {
  width: min(440px, calc(100% - 40px));
  margin: 8px auto 36px;
  text-align: center;
}

.count-num {
  font-weight: 300;
  font-size: clamp(5.6rem, 26vw, 8.2rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
  font-variant-numeric: lining-nums;
}

.count-rest {
  margin-top: 12px;
  font-style: italic;
  font-size: 1.28rem;
  line-height: 1.35;
  color: rgba(244, 239, 230, 0.84);
}

.count-line { margin-right: auto; margin-left: auto; transform-origin: center; }

.timeline { position: relative; }

.t-card[data-reveal],
.t-card[data-reveal].in {
  transform: none;
}

.t-card {
  position: sticky;
  top: 14px;
  width: min(440px, calc(100% - 32px));
  margin: 0 auto 18px;
  background: #f6f1e8;
  color: var(--ink);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

.t-card .ph { height: 196px; }

.t-card .ph.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: #efe8dc;
}

.t-card .ph.split .half {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.t-body { padding: 16px 18px 20px; }

.t-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8d7f6e;
}

.t-body h3 {
  margin-top: 6px;
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1.05;
}

.t-body p {
  margin-top: 8px;
  font-size: 1.02rem;
  line-height: 1.38;
}

/* voz */

#voz { padding: 8vh 0 20vh; }

.voice {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.voice-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.voice-bubble {
  flex: 1;
  min-width: 0;
  height: 58px;
  padding: 0 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f1ec;
  color: #1b1b1b;
  border-radius: 999px;
}

.voice-btn {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: #1b1b1b;
  color: #fff;
  display: grid;
  place-items: center;
}

.voice-btn .glyph-play {
  border-left-width: 10px;
  border-top-width: 6px;
  border-bottom-width: 6px;
}

.voice-btn .glyph-pause i { height: 11px; }

.wave {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  cursor: pointer;
}

.wave i {
  flex: 1;
  height: calc(var(--h) * 100%);
  min-height: 3px;
  border-radius: 99px;
  background: #1b1b1b;
  opacity: 0.22;
}

.wave i.on { opacity: 1; }

.voice-time {
  flex: none;
  min-width: 2.6em;
  text-align: right;
  font-family: Outfit, sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.voice-note {
  display: none;
  width: min(440px, calc(100% - 32px));
  margin: 12px auto 0;
  text-align: center;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  color: rgba(244, 239, 230, 0.7);
}

.voice-note.show { display: block; }

/* cierre */

.closing {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 214, 186, 0.4), transparent 24%),
    linear-gradient(180deg, #1c2436 0%, #6d5966 40%, #d9c3b4 70%, #efe6dc 100%);
}

.closing video,
.closing img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  z-index: 0;
  background: #14110f;
}

.veil-white {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top,
    #ffffff 0%,
    #ffffff 16%,
    rgba(255, 255, 255, 0.94) 30%,
    rgba(255, 255, 255, 0.7) 43%,
    rgba(255, 255, 255, 0) 66%);
}

.closing-copy {
  position: relative;
  z-index: 2;
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 0 28px calc(52px + env(safe-area-inset-bottom));
  text-align: center;
  color: #1c1916;
}

.closing-rule {
  display: block;
  width: 32px;
  height: 1px;
  margin: 0 auto 16px;
  background: #1c1916;
}

.closing-copy h2 {
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.8rem, 12vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.closing-copy p {
  margin-top: 16px;
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.4;
}

@media (max-height: 740px) {
  .heart-svg { width: 132px; }
  body.show-heart .lockup { top: 4vh; transform: scale(0.72); }
  body.is-typing .heart-wrap { transform: translateY(-10vh) scale(0.66); }
  .typed-wrap { top: 50%; }
  .typed-block { min-height: 7.2em; font-size: 0.9rem; }
}

