/* ==========================================================================
   THE LASKARA PROTOCOL — STYLE SHEET
   Palette: Dusty Pink #eec0c6 · Deep Red #7e1627 · Cream #f3e5f5
   Fonts : Dancing Script (headers), Poppins (body)
   ========================================================================== */

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background: #0a0a0a;
    color: #f3e5f5;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scroll for letter scene */
.scene { scrollbar-width: thin; scrollbar-color: rgba(238,192,198,.2) transparent; }
.scene::-webkit-scrollbar { width: 4px; }
.scene::-webkit-scrollbar-thumb { background: rgba(238,192,198,.2); border-radius: 4px; }

/* ── Scenes ─────────────────────────────────────────────────────────────── */
.scene {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: none;
    z-index: 1;
}

.scene.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* =====================================================================
   SCENE 1 — THE BIOMETRIC LOCK
   ===================================================================== */
#scene-lock {
    background: radial-gradient(ellipse at center, #1a0a10 0%, #0a0a0a 70%);
    overflow: hidden;
}

/* Ambient floating orbs */
.ambient-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
    width: 200px; height: 200px;
    background: rgba(238,192,198,.08);
    top: 10%; left: -5%;
    animation-delay: 0s;
}
.orb-2 {
    width: 160px; height: 160px;
    background: rgba(126,22,39,.1);
    bottom: 15%; right: -5%;
    animation-delay: 2.5s;
}
.orb-3 {
    width: 120px; height: 120px;
    background: rgba(214,51,112,.06);
    top: 50%; left: 60%;
    animation-delay: 5s;
}

@keyframes orbFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
    50% { opacity: 1; transform: translateY(-30px) scale(1.1); }
}

.lock-container {
    text-align: center;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

/* Pulsing heart */
.pulse-heart {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.2rem;
    animation: heartPulse 1.4s ease-in-out infinite;
    filter: drop-shadow(0 0 25px rgba(238,192,198,.5));
    cursor: default;
}

.pulse-heart svg {
    width: 100%;
    height: 100%;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.18); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
}

.lock-subtitle {
    font-family: 'Dancing Script', cursive;
    font-size: .95rem;
    color: rgba(238,192,198,.35);
    margin-bottom: 1.8rem;
    letter-spacing: 2px;
}

.lock-prompt {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #eec0c6;
    margin-bottom: 1.5rem;
    letter-spacing: .3px;
}

/* Glowing input */
.lock-input-wrap {
    position: relative;
    margin-bottom: 1.2rem;
}

.lock-input {
    width: 100%;
    padding: 14px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #f3e5f5;
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(238,192,198,.2);
    border-radius: 14px;
    outline: none;
    text-align: center;
    transition: border-color .4s, box-shadow .4s, background .4s;
    letter-spacing: 1px;
}

.lock-input::placeholder {
    color: rgba(238,192,198,.3);
    letter-spacing: 0;
}

.lock-input:focus {
    border-color: #eec0c6;
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 24px rgba(238,192,198,.2), inset 0 0 10px rgba(238,192,198,.05);
}

.verify-btn {
    display: inline-block;
    padding: 12px 52px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: .9rem;
    color: #fff;
    background: linear-gradient(135deg, #7e1627, #b52546);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform .25s, box-shadow .3s, letter-spacing .3s;
    min-height: 48px;
    letter-spacing: .5px;
    position: relative;
    overflow: hidden;
}

.verify-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.1) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform .6s;
}

.verify-btn:hover::after, .verify-btn:active::after {
    transform: translateX(100%);
}

.verify-btn:hover, .verify-btn:active {
    transform: scale(1.04);
    box-shadow: 0 6px 30px rgba(126,22,39,.45);
    letter-spacing: 1.5px;
}

.lock-error {
    margin-top: 1rem;
    font-size: .82rem;
    color: #ff6b6b;
    min-height: 1.2em;
}

.lock-status {
    margin-top: 1rem;
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: #4cdf8b;
    min-height: 1.6em;
    opacity: 0;
}

/* =====================================================================
   SCENE 2 — MEMORY LANE
   ===================================================================== */
#scene-memories {
    background: #0a0a0a;
}

.memories-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Page progress dots for memories */
.memory-progress {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.memory-progress .mp-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(238,192,198,.2);
    transition: background .4s, transform .4s;
}

.memory-progress .mp-dot.active {
    background: #eec0c6;
    transform: scale(1.5);
}

.memory-slide {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.memory-slide .mem-image {
    width: 250px;
    height: 250px;
    margin: 0 auto 1.5rem;
    border-radius: 22px;
    background: rgba(238,192,198,.05);
    border: 1.5px solid rgba(238,192,198,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.memory-slide .mem-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.memory-slide .mem-caption {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: #eec0c6;
    line-height: 1.4;
    text-shadow: 0 2px 15px rgba(0,0,0,.5);
}

/* =====================================================================
   SCENE 3 — THE PROPOSAL
   ===================================================================== */
#scene-proposal {
    background: radial-gradient(ellipse at 50% 40%, #2a0a14 0%, #0a0a0a 80%);
}

.proposal-card {
    width: 90%;
    max-width: 400px;
    transform: translateY(100vh);
}

.proposal-card-inner {
    background: linear-gradient(160deg, rgba(238,192,198,.08), rgba(126,22,39,.1));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(238,192,198,.15);
    border-radius: 28px;
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer on the card */
.proposal-card-inner::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(238,192,198,.03), transparent, rgba(238,192,198,.03), transparent);
    animation: proposalShimmer 6s linear infinite;
    pointer-events: none;
}

@keyframes proposalShimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.proposal-hearts {
    font-size: 1.2rem;
    color: #eec0c6;
    margin-bottom: 1rem;
    letter-spacing: 10px;
    position: relative;
    z-index: 1;
}

.proposal-hearts span {
    display: inline-block;
    animation: proposalHeartBob 2s ease-in-out infinite;
}

.proposal-hearts span:nth-child(2) { animation-delay: .3s; }
.proposal-hearts span:nth-child(3) { animation-delay: .6s; }

@keyframes proposalHeartBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.proposal-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: #eec0c6;
    margin-bottom: .4rem;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.proposal-sub {
    font-size: .85rem;
    color: rgba(238,192,198,.45);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.proposal-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.btn-yes {
    padding: 14px 44px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #d63370, #ff5a8a);
    border: none;
    border-radius: 40px;
    cursor: pointer;
    min-height: 52px;
    box-shadow: 0 0 30px rgba(214,51,112,.35);
    animation: yesGlow 1.6s ease-in-out infinite alternate;
    transition: transform .25s, font-size .3s, padding .3s;
    position: relative;
    overflow: hidden;
}

.btn-yes::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .4s, height .4s;
}

.btn-yes:active::after {
    width: 200px; height: 200px;
}

.btn-yes:hover, .btn-yes:active {
    transform: scale(1.06);
}

@keyframes yesGlow {
    0% { box-shadow: 0 0 20px rgba(214,51,112,.25); }
    100% { box-shadow: 0 0 45px rgba(255,90,138,.5), 0 0 90px rgba(214,51,112,.15); }
}

.btn-no {
    padding: 10px 28px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: .85rem;
    color: #777;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 30px;
    cursor: pointer;
    min-height: 48px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    position: relative;
}

/* =====================================================================
   SCENE 3.5 — THE BOUQUET
   ===================================================================== */
#scene-bouquet {
    background: radial-gradient(ellipse at 50% 50%, #1a0a10 0%, #0a0a0a 80%);
}

.bouquet-container {
    text-align: center;
    position: relative;
}

.bouquet-pre-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: #eec0c6;
    opacity: 0;
    margin-bottom: .8rem;
}

.bouquet-emoji {
    font-size: 6rem;
    line-height: 1;
    opacity: 0;
    transform: scale(0) rotate(-15deg);
    filter: drop-shadow(0 0 40px rgba(238,192,198,.4));
    margin: .5rem 0;
}

.bouquet-post-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: #eec0c6;
    opacity: 0;
    margin-top: .8rem;
}

.bouquet-petals {
    position: absolute;
    inset: -100px;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0;
    pointer-events: none;
}

/* =====================================================================
   SCENE 4 — THE LIVING LETTER
   ===================================================================== */
#scene-letter {
    background: linear-gradient(180deg, #1a100e 0%, #140c0a 100%);
    overflow-y: auto;
    align-items: flex-start;
}

.letter-container {
    width: 100%;
    max-width: 600px;
    padding: 3rem 1.5rem 4rem;
    margin: 0 auto;
}

.letter-paper {
    background: linear-gradient(180deg, #fdf6f0 0%, #f7ece2 100%);
    border-radius: 18px;
    padding: 2.5rem 2rem;
    color: #3a2222;
    box-shadow:
        0 2px 4px rgba(0,0,0,.08),
        0 8px 20px rgba(0,0,0,.15),
        0 20px 60px rgba(0,0,0,.3),
        inset 0 0 60px rgba(255,255,255,.08);
    position: relative;
}

/* Ruled lines */
.letter-paper::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: 18px;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 31px,
        rgba(180,160,150,.1) 31px,
        rgba(180,160,150,.1) 32px
    );
    pointer-events: none;
}

/* Left margin line */
.letter-paper::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 36px;
    width: 1px;
    background: rgba(214,51,112,.08);
    pointer-events: none;
}

/* Wax seal */
.letter-wax-seal {
    width: 48px; height: 48px;
    background: radial-gradient(circle at 35% 35%, #c0243e, #7e1627);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(255,255,255,.7);
    margin: -3.2rem auto 1.2rem;
    box-shadow: 0 4px 15px rgba(126,22,39,.4), inset 0 -2px 4px rgba(0,0,0,.2);
    position: relative;
    z-index: 2;
}

.letter-heading {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #7e1627;
    text-align: center;
    margin-bottom: 1.5rem;
}

.letter-body {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: .93rem;
    line-height: 1.9;
    color: #4a3030;
    min-height: 160px;
    white-space: pre-wrap;
    padding-left: 12px;
}

.letter-body .cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #7e1627;
    margin-left: 2px;
    animation: blink .55s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.letter-signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem;
    color: #7e1627;
    text-align: right;
    margin-top: 2rem;
    opacity: 0;
}

/* ── Image Carousel ─────────────────────────────────────────────────── */
.carousel-wrapper {
    margin-top: 2.5rem;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(238,192,198,.08);
}

.carousel-track {
    display: flex;
    transition: transform .45s cubic-bezier(.25,.8,.25,1);
}

.carousel-slide {
    min-width: 100%;
    padding: 1.5rem;
}

.carousel-slide img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.carousel-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(238,192,198,.12), rgba(126,22,39,.08));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #eec0c6;
    border: 1px dashed rgba(238,192,198,.2);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(10,10,10,.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #eec0c6;
    border: 1px solid rgba(238,192,198,.15);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background .2s, transform .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 1;
}

.carousel-btn:hover {
    background: rgba(126,22,39,.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(238,192,198,.2);
    border: none;
    cursor: pointer;
    transition: background .3s, transform .3s, width .3s;
}

.carousel-dot.active {
    background: #eec0c6;
    transform: scale(1);
    width: 20px;
    border-radius: 4px;
}

/* ── Time Counter ───────────────────────────────────────────────────── */
.time-counter {
    margin-top: 2.5rem;
    text-align: center;
    padding: 1.5rem;
    background: rgba(255,255,255,.02);
    border-radius: 18px;
    border: 1px solid rgba(238,192,198,.08);
}

.time-label {
    font-family: 'Dancing Script', cursive;
    font-size: 1.15rem;
    color: #eec0c6;
    margin-bottom: 1rem;
}

.time-digits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
}

.time-unit span {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.7rem;
    color: #f3e5f5;
    background: rgba(126,22,39,.2);
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 54px;
    display: block;
    transition: transform .3s;
}

.time-unit small {
    font-size: .65rem;
    color: rgba(238,192,198,.4);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.time-sep {
    font-size: 1.5rem;
    color: rgba(238,192,198,.2);
    padding-bottom: 18px;
    animation: sepPulse 1s ease-in-out infinite;
}

@keyframes sepPulse {
    0%, 100% { opacity: .2; }
    50% { opacity: .6; }
}

/* ── Floating Hearts Canvas ─────────────────────────────────────────── */
#heartsCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ── Typing Indicator ("He's typing...") ────────────────────────────── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(238,192,198,.08);
    border: 1px solid rgba(238,192,198,.1);
    border-radius: 20px 20px 20px 4px;
    padding: 10px 18px;
    width: -webkit-fit-content;
    width: fit-content;
    margin-bottom: 1.2rem;
    opacity: 0;
}

.typing-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #eec0c6;
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.typing-label {
    font-family: 'Poppins', sans-serif;
    font-size: .72rem;
    color: rgba(238,192,198,.5);
    margin-left: 4px;
    font-style: italic;
}

/* ── Name Glow ──────────────────────────────────────────────────────── */
.name-glow {
    color: #7e1627;
    font-weight: 500;
    text-shadow: 0 0 8px rgba(214,51,112,.3);
    animation: nameGlowPulse 2s ease-in-out infinite alternate;
}

@keyframes nameGlowPulse {
    0% { text-shadow: 0 0 8px rgba(214,51,112,.2); }
    100% { text-shadow: 0 0 16px rgba(214,51,112,.5), 0 0 30px rgba(238,192,198,.15); }
}

/* ── Touch Sparkle Trail ────────────────────────────────────────────── */
.sparkle-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: .7rem;
    opacity: 1;
}

/* ── Double-tap Heart Burst ─────────────────────────────────────────── */
.burst-heart {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 1.2rem;
    opacity: 1;
}

/* ── Replay Button ──────────────────────────────────────────────────── */
.replay-btn {
    display: block;
    margin: 2.5rem auto 0;
    padding: 12px 36px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: .85rem;
    color: #eec0c6;
    background: rgba(126,22,39,.25);
    border: 1px solid rgba(238,192,198,.15);
    border-radius: 30px;
    cursor: pointer;
    transition: transform .25s, box-shadow .3s, background .3s;
    opacity: 0;
}

.replay-btn:hover, .replay-btn:active {
    transform: scale(1.05);
    background: rgba(126,22,39,.45);
    box-shadow: 0 4px 20px rgba(126,22,39,.3);
}

/* ── Made-with-love Footer ──────────────────────────────────────────── */
.made-with-love {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: .7rem;
    color: rgba(238,192,198,.25);
    margin-top: 2rem;
    padding-bottom: 1rem;
    letter-spacing: .5px;
    opacity: 0;
}

/* ── Utility / Responsive ───────────────────────────────────────────── */
@media (max-width: 380px) {
    .proposal-title { font-size: 1.75rem; }
    .letter-paper { padding: 2rem 1.2rem; }
    .time-unit span { font-size: 1.3rem; min-width: 44px; }
    .bouquet-emoji { font-size: 4.5rem; }
}

@media (min-width: 768px) {
    .mem-image { width: 320px !important; height: 320px !important; }
    .proposal-title { font-size: 2.6rem; }
    .letter-paper { padding: 3rem 3rem; }
    .bouquet-emoji { font-size: 8rem; }
}