@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #09080d;
  --paper: #f5eee9;
  --ink: #2a2025;
  --muted: #7a6870;
  --rose: #b86d7c;
  --rose-dark: #743b4d;
  --line: rgba(83, 55, 67, .16);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --shadow: 0 24px 70px rgba(18, 8, 14, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: #fff; font-family: var(--sans); overflow-x: hidden; }
body.is-locked { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { display: block; max-width: 100%; }

.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 100; background: rgba(255,255,255,.08); }
.progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #dca2ad, #fff); }

.intro { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; min-height: 100svh; background: #07060a; transition: opacity 1s ease, visibility 1s ease; }
.intro.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-glow { position: absolute; width: 45rem; height: 45rem; border-radius: 50%; background: radial-gradient(circle, rgba(183,104,126,.14), transparent 65%); filter: blur(18px); }
.intro-content { position: relative; z-index: 2; width: min(90vw, 680px); min-height: 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.candle-scene { position: relative; width: 90px; height: 170px; margin-bottom: 3rem; }
.halo { position: absolute; left: 50%; top: 0; width: 160px; height: 160px; transform: translate(-50%, -40%); border-radius: 50%; background: radial-gradient(circle, rgba(255,194,122,.28), transparent 70%); animation: breathe 3.2s ease-in-out infinite; }
.flame { position: absolute; left: 50%; top: 16px; width: 24px; height: 42px; transform: translateX(-50%) rotate(2deg); transform-origin: 50% 100%; border-radius: 55% 45% 55% 45% / 65% 65% 35% 35%; background: linear-gradient(#fff7c7 5%, #ffbd69 55%, #ef6f4d); box-shadow: 0 0 25px rgba(255,166,83,.8); animation: flicker 1.4s ease-in-out infinite alternate; }
.wick { position: absolute; left: 50%; top: 53px; width: 2px; height: 15px; transform: translateX(-50%); background: #31221d; }
.wax { position: absolute; left: 50%; bottom: 0; width: 68px; height: 108px; transform: translateX(-50%); border-radius: 10px 10px 6px 6px; background: linear-gradient(90deg, #e7d6c8, #fff8ee 46%, #dbc5b7); box-shadow: inset -10px 0 16px rgba(90,45,30,.12); }
.intro-line { min-height: 3.5em; margin: 0; font: 600 clamp(1.7rem, 4vw, 3rem)/1.18 var(--serif); letter-spacing: .01em; }
.intro-button { opacity: 0; pointer-events: none; transform: translateY(10px); transition: .7s ease; }
.intro-button.is-visible { opacity: 1; pointer-events: auto; transform: none; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 1.45rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; color: #fff; background: rgba(255,255,255,.08); text-decoration: none; cursor: pointer; backdrop-filter: blur(12px); transition: transform .25s ease, background .25s ease; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); background: rgba(255,255,255,.14); }

.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transform: scale(1.04); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,4,8,.18), rgba(5,4,8,.35) 45%, rgba(5,4,8,.92)); }
.hero-copy { position: relative; z-index: 2; width: min(92vw, 820px); margin: 0 auto; padding: 8rem 1rem 8rem; text-align: center; }
.kicker { margin: 0 0 .65rem; font-size: .73rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.hero h1 { margin: 0; font: 700 clamp(5rem, 20vw, 10rem)/.8 var(--serif); }
.hero p:not(.kicker) { width: min(100%, 650px); margin: 2rem auto; font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.8; color: rgba(255,255,255,.84); }
.scroll-cue { position: absolute; left: 50%; bottom: 1.5rem; z-index: 2; transform: translateX(-50%); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; opacity: .65; animation: float 2s ease-in-out infinite; }

main { background: var(--paper); color: var(--ink); }
.letter-shell { width: min(100%, 1080px); margin: auto; padding: 7rem clamp(1.25rem, 5vw, 4rem); }
.letter-heading { text-align: center; margin-bottom: 5rem; }
.letter-heading h2 { margin: 0; font: 700 clamp(3.1rem, 8vw, 6.5rem)/.95 var(--serif); color: var(--rose-dark); }
.ornament { display: block; margin-top: 1.4rem; color: var(--rose); font-size: 1.5rem; }
.letter-copy { width: min(100%, 720px); margin: 0 auto; }
.letter-copy > p { margin: 0 0 2rem; font: 500 clamp(1.35rem, 2.5vw, 1.72rem)/1.65 var(--serif); }
.accent-line { color: var(--rose-dark); font-size: clamp(1.7rem, 3vw, 2.25rem) !important; }
blockquote { margin: 5rem 0; padding: 1.2rem 0 1.2rem 2rem; border-left: 2px solid var(--rose); font: 600 clamp(1.8rem, 4vw, 3rem)/1.25 var(--serif); color: var(--rose-dark); }

.portrait-composition { position: relative; min-height: 780px; margin: 7rem 0; }
.photo-frame { position: absolute; border: 0; padding: 0; background: #fff; box-shadow: var(--shadow); cursor: zoom-in; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.photo-frame:hover img { transform: scale(1.035); }
.photo-frame span { position: absolute; inset: auto 0 0; padding: 5rem 1.5rem 1.5rem; color: #fff; text-align: left; font: 600 1.25rem/1.3 var(--serif); background: linear-gradient(transparent, rgba(10,4,8,.75)); }
.portrait-main { left: 5%; top: 0; width: 58%; height: 710px; }
.portrait-small { right: 4%; width: 34%; height: 320px; }
.portrait-small.top { top: 45px; transform: rotate(2.5deg); }
.portrait-small.bottom { bottom: 20px; transform: rotate(-2deg); }

.details-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 8rem 0; background: var(--line); border: 1px solid var(--line); }
.detail-card { min-height: 240px; padding: clamp(1.5rem, 4vw, 3rem); background: var(--paper); }
.detail-card span { display: block; margin-bottom: 2.5rem; color: var(--rose); font-size: .72rem; letter-spacing: .18em; }
.detail-card p { margin: 0; font: 600 clamp(1.35rem, 2.4vw, 1.9rem)/1.35 var(--serif); }

.featured-memory { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); margin: 9rem 0; }
.featured-image { border: 0; padding: 0; background: transparent; cursor: zoom-in; box-shadow: var(--shadow); }
.featured-image img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.featured-memory h3 { margin: .4rem 0 1.3rem; font: 700 clamp(2.5rem, 5vw, 4.5rem)/1 var(--serif); color: var(--rose-dark); }
.featured-memory p:last-child { line-height: 1.8; color: var(--muted); }

.memory-strip { display: grid; grid-template-columns: repeat(5, minmax(180px,1fr)); gap: 1rem; margin: 8rem calc(50% - 50vw); padding: 1rem clamp(1rem, 5vw, 4rem); overflow-x: auto; scrollbar-width: none; }
.memory-strip::-webkit-scrollbar { display: none; }
.memory-strip button { border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.memory-strip img { width: 100%; aspect-ratio: 3/4; object-fit: cover; box-shadow: 0 14px 40px rgba(30,12,22,.13); transition: transform .35s ease; }
.memory-strip button:nth-child(odd) { transform: rotate(-1deg); }
.memory-strip button:nth-child(even) { transform: rotate(1.4deg); }
.memory-strip button:hover img { transform: translateY(-6px); }

.closing-copy { margin-top: 7rem; }
.voice-section { margin-top: 9rem; padding: clamp(1rem, 3vw, 2rem); border-radius: 32px; background: #0b0910; color: #fff; box-shadow: 0 30px 80px rgba(23,6,16,.28); }
.voice-card { padding: clamp(2rem, 6vw, 5rem); text-align: center; border: 1px solid rgba(255,255,255,.09); border-radius: 24px; background: radial-gradient(circle at top, rgba(183,109,124,.18), transparent 55%); }
.voice-card h3 { margin: .4rem auto 1rem; font: 700 clamp(2.6rem, 6vw, 5rem)/1 var(--serif); }
.voice-card > p:not(.kicker) { width: min(100%, 650px); margin: 0 auto 2.4rem; line-height: 1.8; color: rgba(255,255,255,.7); }
.voice-button { display: inline-flex; gap: .7rem; align-items: center; min-height: 54px; padding: 0 1.5rem; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; }
.voice-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #161018; font-size: .7rem; }
.audio-track { position: relative; width: min(100%, 560px); height: 4px; margin: 2.5rem auto .7rem; border-radius: 999px; background: rgba(255,255,255,.16); cursor: pointer; }
.audio-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; }
.audio-time { display: flex; justify-content: space-between; width: min(100%, 560px); margin: auto; font-size: .7rem; color: rgba(255,255,255,.55); }
.code-finale { display: none; min-height: 260px; padding: 4rem 1rem 2rem; text-align: center; }
.code-finale.is-visible { display: grid; place-items: center; }
.code-finale > p { font: 500 clamp(1rem, 2.4vw, 1.2rem)/1.7 var(--sans); letter-spacing: .05em; color: rgba(255,255,255,.88); }
.code-finale > p::after { content: ''; display: inline-block; width: .55em; height: 1.1em; margin-left: .35em; vertical-align: -.16em; background: currentColor; animation: blink .8s steps(1) infinite; }
.final-copy { display: none; opacity: 0; transform: translateY(12px); }
.final-copy.is-visible { display: block; animation: revealFinal 1.2s ease forwards; }
.final-copy span { display: block; font: 700 clamp(2.4rem, 6vw, 4.5rem)/1 var(--serif); }
.final-copy p { margin: 2rem 0 .5rem; font-family: var(--serif); font-size: 1.35rem; }
.final-copy strong { font-family: var(--serif); font-size: 1.5rem; }
.signature { margin: 7rem auto 1rem; text-align: center; font: 500 1.3rem/1.6 var(--serif); color: var(--muted); }
.signature strong { display: block; font-size: 2.3rem; color: var(--rose-dark); }
footer { padding: 2rem; text-align: center; font-size: .72rem; letter-spacing: .08em; color: rgba(255,255,255,.55); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

.lightbox { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 2rem; border: 0; background: rgba(8,5,10,.94); }
.lightbox::backdrop { background: rgba(8,5,10,.94); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; }
.lightbox button { position: fixed; right: 1.2rem; top: 1rem; z-index: 2; width: 48px; height: 48px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 2rem; cursor: pointer; }

@keyframes flicker { from { transform: translateX(-50%) rotate(-3deg) scaleY(.96); } to { transform: translateX(-50%) rotate(4deg) scaleY(1.06); } }
@keyframes breathe { 50% { opacity: .62; transform: translate(-50%, -40%) scale(1.08); } }
@keyframes float { 50% { transform: translate(-50%, 7px); opacity: .9; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes revealFinal { to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .hero-copy { padding-bottom: 7rem; }
  .letter-shell { padding-top: 5rem; }
  .portrait-composition { min-height: 620px; }
  .portrait-main { left: 0; width: 72%; height: 540px; }
  .portrait-small { right: 0; width: 38%; height: 235px; }
  .portrait-small.top { top: 30px; }
  .portrait-small.bottom { bottom: 15px; }
  .details-grid { grid-template-columns: 1fr; }
  .detail-card { min-height: 190px; }
  .featured-memory { grid-template-columns: 1fr; }
  .featured-memory > div { padding: 0 .4rem; }
  .memory-strip { grid-template-columns: repeat(5, 72vw); }
  .voice-section { margin-left: -.45rem; margin-right: -.45rem; border-radius: 24px; }
}

@media (max-width: 430px) {
  .intro-content { min-height: 400px; padding: 1rem; }
  .candle-scene { transform: scale(.86); margin-bottom: 2rem; }
  .hero h1 { font-size: clamp(5rem, 27vw, 7.5rem); }
  .portrait-composition { min-height: 510px; }
  .portrait-main { width: 77%; height: 450px; }
  .portrait-small { width: 42%; height: 190px; }
  .photo-frame span { font-size: 1rem; }
  .voice-card { padding: 2.3rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
