@font-face {
  font-family: Cormorant; src: url("../assets/fonts/cormorant.woff2") format("woff2");
  font-style: normal; font-weight: 300 700; font-display: swap;
}
@font-face {
  font-family: Cormorant; src: url("../assets/fonts/cormorant-italic.woff2") format("woff2");
  font-style: italic; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: Vibes; src: url("../assets/fonts/great-vibes.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: PressStart; src: url("../assets/fonts/press-start.woff2") format("woff2"); font-display: swap;
}
:root {
  --serif: Cormorant, Georgia, serif;
  --script: Vibes, "Snell Roundhand", cursive;
  --pixel: PressStart, "Courier New", monospace;
  --ink: #344052;
  --navy: #395771;
  --pine: #496653;
  --ivory: #fffdf8;
  --paper: #f9f6f2;
  --rose: #c94471;
  --dark: #1c1826;
  color: var(--ink);
  font-family: var(--serif);
  background: var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
body.cover-open { overflow: hidden; }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #a15679; outline-offset: 5px; }
h1, h2, p, figure, dl, dd { margin: 0; }
h2 { font-size: clamp(2.65rem, 6.1vw, 4.5rem); line-height: .97; font-weight: 400; letter-spacing: -.028em; }
h2:focus { outline: 0; }
.cover {
  position: fixed; z-index: 10; inset: 0; overflow: auto; overflow-x: hidden; overscroll-behavior: contain;
  display: grid; align-items: center; justify-items: center;
  color: #fff4f6;
  background: radial-gradient(ellipse at 50% 40%, #302738, transparent 65%),
    radial-gradient(ellipse at 45% 24%, #251e30, #17131e 83%, #110f18);
}
.cover-content {
  z-index: 1; width: min(100%, 760px); display: grid; justify-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  gap: clamp(14px, 2.8vh, 27px);
}
.cover h1 {
  margin-top: 2px; font: 400 clamp(1.34rem, 5.2vw, 3rem)/1.24 var(--pixel);
  text-align: center; white-space: nowrap; text-shadow: 3px 4px #723047;
}
.ornament {
  width: min(100%, 635px); display: flex; align-items: center; gap: 14px;
  font: 12px/1 system-ui, sans-serif; letter-spacing: .28em; color: #f4c9d9;
}
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; }
.ornament::before { background: linear-gradient(90deg, transparent, #ae7b92); }
.ornament::after { background: linear-gradient(90deg, #ae7b92, transparent); }
.heart {
  display: block; width: min(100%, 570px, 67vh); width: min(100%, 570px, 67svh);
  height: auto; aspect-ratio: 530 / 480; overflow: visible;
  filter: drop-shadow(0 12px 18px #0d091364);
}
.piece-outline { fill: none; stroke: #241b2b; stroke-width: 6; stroke-linejoin: round; }
.heart-photo:not([href]) { display: none; }
.cover-action { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 17px); color: #e49db7; }
.cover-action > span { font: 13px/1 system-ui, sans-serif; }
.pixel-button {
  display: grid; place-items: center; border: 2px solid #342b43; border-radius: 0;
  font-family: var(--pixel); font-weight: 400; text-align: center; text-transform: uppercase;
  text-decoration: none; color: #422b44; background: #fff2ec;
  box-shadow: inset 0 2px #fffaf7, inset 0 -3px #e5cbd0, 2px 2px #211d2a66;
  transition: background-color .18s, color .18s, transform .14s, box-shadow .14s;
}
.pixel-button:active { transform: translateY(2px); box-shadow: inset 0 2px #21142744; }
.enter-button {
  background: var(--rose); color: white; border: 2px solid #efc1d3;
  box-shadow: inset 0 2px #f499b2, inset 0 -4px #a72e56, 0 0 0 2px #2e172a, 3px 5px #110b16;
  text-shadow: 1px 2px #842745; font-size: clamp(.60rem, 2.55vw, .92rem);
  line-height: 1.55; min-height: 49px; padding: 10px clamp(12px, 4.1vw, 32px); white-space: nowrap;
}
@media (hover: hover) { .enter-button:hover { background: #d3527e; } }
.site-header {
  position: fixed; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; padding: 0 10px; pointer-events: none;
}
.nav-frame {
  display: grid; grid-template-columns: 1fr .93fr .93fr 1.18fr; gap: 4px;
  width: min(100%, 540px); pointer-events: auto; padding: 5px;
  border: 2px solid #77889a; background: #394050;
  box-shadow: inset 0 0 0 1px #252234, 4px 4px #4c374842;
}
.nav-frame a { min-width: 0; min-height: 44px; padding: 4px 2px; font-size: clamp(.43rem, 1.86vw, .72rem); }
.nav-frame a[aria-current] {
  color: #fff; background: #42647b;
  box-shadow: inset 0 2px #7088a4, inset 0 -3px #263754, 2px 2px #201b2a7a;
  text-shadow: 1px 1px #25374d;
}
@media (hover: hover) { .nav-frame a:hover:not([aria-current]) { background: #ffe4e9; } }
.panel {
  position: relative; display: grid; align-items: center;
  min-height: 100vh; min-height: 100svh; padding: 108px 0 99px;
}
.section-inner { position: relative; width: min(calc(100% - 54px), 1060px); margin-inline: auto; }
.section-heading { margin-bottom: clamp(37px, 7.5vh, 76px); text-align: center; }
.eyebrow { margin-bottom: 14px; letter-spacing: .3em; text-transform: uppercase; color: #587080; font-size: .77rem; line-height: 1.5; }
.pixel { font-family: var(--pixel); font-size: clamp(.48rem, 1.45vw, .65rem); letter-spacing: .08em; }
.messages { background: radial-gradient(ellipse at 50% 40%, #fffdf8 8%, transparent 76%), linear-gradient(145deg, #e4edf2, #f9f6f2 80%); }
.letters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(15px, 3.2vw, 33px); }
.letter {
  --edge: var(--navy); --tilt: -2.2deg; background: var(--ivory);
  aspect-ratio: 1.2; display: flex; flex-direction: column; justify-content: center; gap: 13px;
  min-height: 176px; padding: clamp(19px, 3.5vw, 36px);
  border: 1.5px solid var(--edge); transform: rotate(var(--tilt));
  box-shadow: 5px 6px #69536d32; overflow-wrap: anywhere;
}
.letter p { font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 500; line-height: 1.25; }
.letter-sign { color: #a05373; font: 16px/1 system-ui, sans-serif; }
.letter:nth-child(2) { --tilt: 1.9deg; --edge: #283955; background: #42647b; color: #fffdf8; }
.letter:nth-child(2) .letter-sign { color: #f4c7de; }
.letter:nth-child(3) { --tilt: -1.2deg; --edge: var(--pine); background: #f5f8f2; }
.letter:nth-child(3) .letter-sign { color: #687950; }
.reasons { background: radial-gradient(ellipse at 22% 70%, #e1ece4 0%, transparent 69%), #f9f6f2; }
.reason-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 24px); }
.reason {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; margin: 0;
  border: 0; background: none; perspective: 900px; color: var(--ink);
}
.reason-sheet { position: absolute; inset: 0; }

.reason-face {
  position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 9px;
  background: linear-gradient(152deg, #eaf0f2, #dce7ec); padding: 10px;
  border: 1.5px solid var(--navy); box-shadow: 4px 5px #5d687a31;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transform: perspective(900px) rotateY(0);
  transition: transform .62s ease-in-out, visibility 0s linear .31s;
  font-size: clamp(1.05rem, 2.8vw, 1.65rem); line-height: 1.03; overflow-wrap: anywhere;
}
.reason-back { visibility: hidden; transform: perspective(900px) rotateY(-180deg); background: #e7eee5; border-color: var(--pine); align-content: safe center; overflow: auto; }
.reason[aria-pressed="true"] .reason-face:not(.reason-back) { visibility: hidden; transform: perspective(900px) rotateY(180deg); }
.reason[aria-pressed="true"] .reason-back { visibility: visible; transform: perspective(900px) rotateY(0); }
.reason-number { color: #3c577c; font: clamp(.98rem, 3.5vw, 2.04rem)/1.25 var(--pixel); }
.gallery { background: radial-gradient(ellipse at 80% 32%, #e5edf0 0%, transparent 64%), linear-gradient(#f9f6f2, #e8e4e8); }
.gallery .section-heading { margin-bottom: clamp(36px, 6vh, 65px); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 52px) clamp(15px, 3.5vw, 35px); }
.gallery-item { --tilt: -3deg; min-width: 0; }
.gallery-item:nth-child(3n + 2) { --tilt: 2.6deg; }
.gallery-item:nth-child(3n) { --tilt: -1.1deg; }
.gallery-item:nth-child(even) .photo-slot { --slot-a: #eff1e5; --slot-b: #dce7db; }
.gallery-item:nth-child(3n) .photo-slot { --slot-a: #f4e9ee; --slot-b: #e8d6de; }
.polaroid, .viewer-card {
  background: #fffdfa; border: 1px solid #69576b; box-shadow: 5px 6px #6f4d6334;
  padding: clamp(7px, 1.45vw, 15px); color: #8b4564;
}
.polaroid { display: block; width: 100%; transform: rotate(var(--tilt)); transition: transform .28s; }
@media (hover: hover) { .polaroid:hover { transform: rotate(0) translateY(-4px); } }
.photo-slot {
  position: relative; width: 100%; aspect-ratio: 1.1; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--slot-a, #e9eff1), var(--slot-b, #d9e5ed));
  color: #766e84; overflow: hidden;
}
.photo-slot img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { opacity: .65; font: clamp(.8rem, 2vw, 1.2rem)/1 system-ui, sans-serif; }
.polaroid-caption, .viewer figcaption {
  display: grid; place-items: center; min-height: clamp(42px, 7vw, 66px);
  padding: 8px 3px 3px; color: #496653; font: clamp(1.2rem, 3.2vw, 2rem)/1.12 var(--script);
  text-align: center; overflow-wrap: anywhere;
}
.finale {
  isolation: isolate; color: #fcf0f3; text-align: center; padding-top: 155px;
  background: radial-gradient(ellipse at 50% 72%, #382a42 0%, transparent 55%),
    linear-gradient(180deg, #e8e4e8, #bcb1c5 9%, #66566e 23%, #272031 40%, #181420 92%);
}
.finale h2 { font-size: clamp(3rem, 9vw, 6.9rem); }
.final-stars { color: #e7ca9f; margin-bottom: 18px; font-size: .92rem; }
.countdown { width: min(100%, 540px); margin: clamp(25px, 5.6vw, 48px) auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.countdown div { display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; min-width: 0; }
.countdown dt { font: clamp(.36rem, 1.6vw, .64rem)/1.5 var(--pixel); text-transform: uppercase; color: #e7c7d6; }
.countdown dd { font: clamp(2.45rem, 7.8vw, 5.3rem)/.96 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.countdown dd.long-number { font-size: clamp(1.3rem, 4vw, 3rem); }
.final-message { margin: 26px auto 0; max-width: 36ch; font: clamp(1.5rem, 3vw, 2.2rem)/1.2 var(--script); }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sparkle { position: absolute; left: var(--x); top: var(--y); color: var(--light, #f5d9e9); opacity: var(--opacity); font: var(--size)/1 Georgia, serif; }
.viewer {
  margin: auto; padding: 0; border: 0; width: min(560px, calc(100% - 26px)); max-width: none;
  max-height: calc(100% - 20px); overflow: auto; color: #fff5f7; background: transparent;
}
.viewer::backdrop { background: #140f1cea; }
.viewer-content { display: grid; justify-items: center; padding: 48px 7px 5px; position: relative; }
.viewer-close { position: absolute; right: 7px; top: 0; }
.viewer button {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px 4px;
  font: 31px/1 var(--serif); color: #fff5f7; border: 1px solid #a47a93; background: #352a40;
}
.viewer button:disabled { opacity: .45; cursor: default; }
.viewer-card { width: min(100%, 460px, 67vh); width: min(100%, 460px, 67svh); }
.viewer-card .photo-slot { aspect-ratio: auto; height: min(57vh, 380px); height: min(57svh, 380px); }
.viewer-card .photo-slot img { object-fit: contain; }
.viewer-controls { margin-top: 13px; display: grid; grid-template-columns: 44px 82px 44px; align-items: center; text-align: center; }
body.viewer-open { overflow: hidden; }
@media (max-width: 640px) {
  :root { scroll-padding-top: 61px; }
  .panel { padding-block: 104px 76px; }
  .section-inner { width: calc(100% - 42px); }
  .section-heading { margin-bottom: 35px; }
  .section-heading h2 { text-wrap: balance; }
  .letters { grid-template-columns: minmax(0, 1fr); width: min(100%, 335px); margin-inline: auto; gap: 19px; }
  .letter { min-height: 164px; aspect-ratio: auto; padding: 25px 27px; }
  .letter p { font-size: clamp(1.35rem, 5.5vw, 1.63rem); }
  .reason-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 450px; margin-inline: auto; gap: 15px; }
  .reason-number { font-size: clamp(1.06rem, 5vw, 1.6rem); }
  .reason-face { font-size: clamp(1.12rem, 5vw, 1.54rem); }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px 12px; }
  .finale { padding-top: 133px; }
}
@media (max-width: 355px) {
  .nav-frame { gap: 2px; padding: 3px; }
  .nav-frame a { padding-inline: 1px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .cover-content { gap: 9px; padding-block: 9px; }
  .cover h1 { font-size: 1.45rem; }
  .heart { width: min(100%, 61vh); width: min(100%, 61svh); }
  .enter-button { min-height: 42px; }
  .viewer-card .photo-slot { height: 45vh; height: 45svh; }
}
/* Refinamientos: composición editorial y controles táctiles. */
.cover { background: radial-gradient(ellipse at 50% 36%, #393043 0%, transparent 62%), radial-gradient(ellipse at 48% 45%, #241d30, #17131f 75%, #120f18); }
.heart { filter: drop-shadow(0 13px 20px #0d091388); }
.ornament { opacity: .9; }
.cover h1 { letter-spacing: .035em; }
.site-header { top: max(12px, calc(env(safe-area-inset-top) + 7px)); }
.nav-frame a:not([aria-current]) { background: #f9f5ee; color: #394d60; }
.section-heading h2 { text-wrap: balance; }
.letter { aspect-ratio: auto; min-height: clamp(180px, 24vw, 285px); }
.letter p { white-space: pre-line; }
.reason-back { padding: 14px; line-height: 1.15; }
.polaroid-caption { min-height: 64px; }
.finale .section-inner { padding-bottom: 8px; }
.countdown dt { font: 500 clamp(.67rem, 2.5vw, .9rem)/1.5 var(--serif); letter-spacing: .12em; }
@media (max-width: 640px) {
  .cover-content { padding-inline: 20px; gap: 24px; }
  .cover h1 { font-size: clamp(1.2rem, 5.7vw, 2.1rem); }
  .heart { width: min(100%, 475px, 57svh); }
  .enter-button { min-height: 54px; }
  .site-header { padding-inline: 8px; }
  .nav-frame { gap: 3px; padding: 4px; }
  .nav-frame a { font-size: clamp(.42rem, 1.75vw, .62rem); }
  .section-heading { margin-bottom: 43px; }
  .section-heading h2 { font-size: clamp(2.5rem, 10vw, 3.4rem); }
  .letter { min-height: 164px; }
  .gallery-grid { width: min(100%, 350px); margin-inline: auto; grid-template-columns: 1fr; gap: 30px; }
  .photo-slot { aspect-ratio: 1.13; }
  .polaroid-caption { min-height: 59px; font-size: 1.8rem; }
  .finale { padding-top: 165px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .cover-content { gap: 8px; padding-block: 8px; }
  .heart { width: min(100%, 48svh); }
  .cover h1 { font-size: 1.25rem; }
  .enter-button { min-height: 42px; }
}
/* Personalización final. */
.reason-pagination { margin: 26px auto 0; width: min(100%, 320px); text-align: center; color: var(--navy); }
.reason-controls { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 12px; }
.reason-controls button { font-size: 1rem; min-height: 44px; background: #eef2f2; }
.reason-controls button:disabled { opacity: .38; cursor: default; }
#reason-page { font: .68rem/1.5 var(--pixel); }
.reason-progress { height: 5px; background: #d4e1e5; margin-top: 14px; overflow: hidden; }
#reason-progress-fill { width: 0; height: 100%; background: #52758b; transition: width .35s; }
#reason-discovered { font: 500 1rem/1.5 var(--serif); margin-top: 7px; }
.reason-back { font-style: italic; font-weight: 500; color: #324f46; }
.reason-special .reason-back { background: #42647b; color: #fff5fa; border-color: #9f617d; }
.reason-special .special-celebrate { animation: final-glow 2s .45s ease-out; }
.polaroid-caption { min-height: 86px; line-height: 1.16; }
.gallery-grid { align-items: start; }
.finale h2 { font-family: var(--script); font-size: clamp(3.3rem, 10.2vw, 7.3rem); color: #f6d7e6; line-height: 1.15; overflow-wrap: anywhere; }
.final-message { max-width: 36ch; font: 500 clamp(1.55rem, 4vw, 2.45rem)/1.2 var(--serif); color: #f7e9f1; margin: 22px auto 0; }
.music-toggle { position: fixed; z-index: 6; right: max(14px, env(safe-area-inset-right)); bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px)); width: 44px; height: 44px; background: #42647b; color: white; border-color: #29394d; box-shadow: inset 0 2px #7998ad, inset 0 -3px #283d51, 2px 2px #1e1c2b55; font: bold 19px/1 system-ui,sans-serif; }
@media(max-width:640px){ .reason-pagination { margin-top: 22px; } .polaroid-caption { min-height: 76px; } .reason-back { font-size: clamp(1rem,5vw,1.45rem); padding: 10px; } .finale h2 { font-size: clamp(3rem, 11vw, 4.6rem); } }
/* Las capturas de mensajes se leen completas, sin recortar su contenido. */
.polaroid .screenshot-request { aspect-ratio: 1.7; }
.polaroid .screenshot-message { aspect-ratio: 3.25; }

/* Ajustes exclusivos para las razones extensas. */
.reason-back { line-height: 1.2; }
.reason-back.reason-long { font-size: clamp(1rem, 2.25vw, 1.4rem); }
.reasons-closing { margin-top: 18px; font: italic 600 clamp(1.25rem, 3vw, 1.7rem)/1.3 var(--serif); color: var(--navy); }
@media (max-width: 640px) {
  .reason { min-height: 170px; }
  .reason-back { font-size: clamp(1.05rem, 4.4vw, 1.4rem); }
  .reason-back.reason-long { font-size: clamp(1rem, 3.9vw, 1.25rem); padding: 8px; }
}

/* Cuenta regresiva elegante debajo de la dedicatoria. */
.countdown { max-width: 510px; gap: 8px; margin-top: clamp(32px, 6vw, 52px); }
.countdown dd { margin: 0; color: #f6d7e6; font-size: clamp(2.2rem, 9vw, 4.6rem); }
.countdown dt { color: #e7c7d6; letter-spacing: .06em; }
