/* ============================================
   VALENTINE'S WEB APP - MODERN RE-DESIGN
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   COLOR VARIABLES & ROOT STYLES
   ============================================ */

:root {
    --white: #ffffff;
    --dark: #0b0b0f; /* Apple-like deep neutral */
    --gray: rgba(11, 11, 15, 0.6);
    --light-gray: #f5f5f7;
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    --focus-ring: #f5576c;
}

/* ============================================
   BODY & GENERAL STYLES
   ============================================ */

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0b0b0f;
    background-image: none;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

#device-gate {
    display: none;
}

#main-content {
    display: block;
}

body.gate-open {
    overflow: hidden;
}

.intro-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.intro-actions .btn-primary,
.intro-actions .btn-secondary {
    margin-top: 0;
    width: 100%;
    max-width: 260px;
}

.tease-image {
    width: 100%;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--light-gray);
}

.tease-image .responsive-picture {
    height: 100%;
}

.tease-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tease-image.blurred img {
    filter: blur(12px) saturate(1.1);
    transform: scale(1.05);
}

.pulse {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.microcopy {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 14px;
}

.microcopy.notice {
    display: none;
    color: rgba(0, 0, 0, 0.7);
}

.microcopy.notice.show {
    display: block;
}

.device-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.94);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    padding: 24px;
    pointer-events: none;
}

.device-gate.active {
    opacity: 1;
    visibility: visible;
    animation: fadeIn 0.5s ease both;
    pointer-events: auto;
}

.device-gate::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #000;
    background-image:
        radial-gradient(1px 1px at 15% 30%, rgba(255, 255, 255, 0.55), transparent 60%),
        radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.4), transparent 60%),
        radial-gradient(1.5px 1.5px at 60% 70%, rgba(255, 255, 255, 0.35), transparent 60%),
        radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.25), transparent 60%);
    background-repeat: repeat;
    background-size: 500px 500px, 420px 420px, 620px 620px, 560px 560px;
    animation: starDrift 120s linear infinite;
    opacity: 0.7;
    z-index: 0;
}

.device-gate::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(80% 70% at 50% 20%, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.75) 70%);
    z-index: 0;
}

.gate-card {
    position: relative;
    z-index: 1;
    width: min(560px, 90vw);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
    animation: cinematicIntro 0.7s ease both;
}

.gate-title {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.gate-text {
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.68);
    margin-bottom: 10px;
}

.gate-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gate-actions .btn-primary,
.gate-actions .btn-secondary {
    margin-top: 0;
}

.gate-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gate-step {
    display: none;
}

.gate-step.is-active {
    display: block;
}

.gate-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
}

.music-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(20, 20, 24, 0.6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.music-toggle.is-on {
    background: rgba(255, 255, 255, 0.85);
    color: var(--dark);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.music-toggle:hover {
    transform: translateY(-1px) scale(1.02);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes starDrift {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 200px 400px, -300px 250px, 150px -200px, -180px 220px;
    }
}

/* ============================================
   SECTIONS & GLASSMORPHIC CARDS
   ============================================ */

.section {
    display: none;
    min-height: 100vh;
    width: 100%;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    overflow: hidden;
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--section-bg, linear-gradient(135deg, #E0C3FC 0%, #8EC5FC 100%));
    background-size: cover;
    background-position: var(--section-bg-position, center);
    background-repeat: no-repeat;
    transform: scale(1.02);
    filter: saturate(1.08) brightness(0.9);
    z-index: 0;
}

.section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 120% at 50% 10%, rgba(255, 255, 255, 0.22) 0%, rgba(0, 0, 0, 0.38) 70%);
    z-index: 0;
}

#welcome-section::before {
    background-color: #000;
    background-image:
        radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.6), transparent 60%),
        radial-gradient(1px 1px at 76% 22%, rgba(255, 255, 255, 0.45), transparent 60%),
        radial-gradient(1.5px 1.5px at 52% 68%, rgba(255, 255, 255, 0.4), transparent 60%),
        radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.3), transparent 60%);
    background-repeat: repeat;
    background-size: 520px 520px, 440px 440px, 640px 640px, 600px 600px;
    filter: none;
    animation: starDrift 140s linear infinite;
}

#welcome-section::after {
    background: radial-gradient(85% 80% at 50% 20%, rgba(255, 255, 255, 0.12) 0%, rgba(0, 0, 0, 0.85) 70%);
}

#welcome-section {
    overflow: visible;
    align-items: center;
    padding-top: clamp(40px, 8vh, 120px);
}

/* hero head positioning (anchors to hero card, safe across zoom) */
.hero-wrap {
    position: relative;
    width: 100%;
    max-width: 660px;
    padding-top: clamp(28px, 4vw, 44px);
    margin: 0 auto;
    overflow: visible;
}

.hero-head {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    width: clamp(120px, 20vw, 170px);
    height: auto;
    z-index: 3;
    pointer-events: none;
}

.hero-head img {
    width: 100%;
    height: auto;
    display: block;
}

.responsive-picture {
    display: block;
}

.responsive-picture img {
    display: block;
}

#main-content {
    overflow: visible;
}

#welcome-section .container {
    overflow: visible;
    position: relative;
}

#video-section::before,
#video-section::after {
    display: none;
}

.section.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(245, 245, 248, 0.8) 100%);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    padding: 60px 40px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    max-width: 660px;
    width: 100%;
    position: relative;
    z-index: 2;
    animation: slideIn 0.7s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
    animation-fill-mode: both;
}

.container h1,
.container h2,
.container p {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   MEMORY WALL BACKGROUND
   ============================================ */

.memory-wall {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.memory-card {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size, 170px);
    transform: translate(-50%, -50%) rotate(var(--rotate, 0deg));
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0.75;
    animation: memoryIn 0.9s ease forwards;
    animation-delay: var(--delay, 0s);
}

.memory-photo {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.memory-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.memory-caption {
    font-size: 0.72rem;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.78);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 10px;
    padding: 6px 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    max-width: 220px;
    white-space: pre-line;
}

.memory-caption:empty {
    display: none;
}

@keyframes memoryIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.96) rotate(var(--rotate, 0deg));
    }
    to {
        opacity: 0.75;
        transform: translate(-50%, -50%) scale(1) rotate(var(--rotate, 0deg));
    }
}

@keyframes masonryIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 900px) {
    .memory-card {
        width: var(--size, 150px);
        opacity: 0.65;
    }
}

@media (max-width: 768px) {
    .memory-card[data-hide='tablet'] {
        display: none;
    }
}

@media (max-width: 480px) {
    .memory-card[data-hide='mobile'] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cinematicIntro {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

#welcome-section .container {
    animation: cinematicIntro 1.1s ease 0.15s both;
}

#welcome-section .identity-header {
    animation: cinematicIntro 1.1s ease 0.3s both;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
    letter-spacing: -0.015em;
    line-height: 1.15;
    user-select: none;
}

h2 {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
    letter-spacing: -0.015em;
    line-height: 1.2;
    user-select: none;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 30px;
    font-weight: 400;
    line-height: 1.6;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    user-select: none;
}

.typing-section {
    padding: 0;
}

.typing-section.active {
    align-items: stretch;
}

.typing-scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px;
    overflow: hidden;
}

.typing-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.typing-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.6s ease;
    transform: scale(1.02);
    animation: kenBurns 18s ease-in-out infinite;
}

.typing-slide.is-active {
    opacity: 1;
}

@keyframes kenBurns {
    0% { transform: scale(1.02); }
    100% { transform: scale(1.08); }
}

.typing-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.65) 50%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 1;
}

.typing-card {
    position: relative;
    z-index: 2;
    width: min(720px, 92vw);
    background: rgba(12, 12, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 30px 26px;
    color: #f5f5f7;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
}

.typing-line {
    display: block;
    min-height: 220px;
}

.typing-text {
    white-space: pre-wrap;
    display: block;
    font-size: 1.05rem;
    line-height: 1.7;
}

.typing-caret {
    display: inline-block;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.typing-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
}

.typing-controls .btn-secondary {
    margin-top: 0;
    padding: 10px 18px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.typing-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.speed-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.speed-btn.is-active {
    background: rgba(255, 255, 255, 0.9);
    color: #111;
}

.typing-next {
    margin-top: 18px;
    width: 100%;
}

.typing-back {
    z-index: 3;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.typing-back:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #111;
}

.typing-next.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.music-nudge {
    opacity: 0;
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    transition: opacity 0.4s ease;
}

.music-nudge.is-visible {
    opacity: 1;
}

body.music-pulse .typing-card {
    animation: musicPulse 1.2s ease;
}

@keyframes musicPulse {
    0% {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.0);
    }
    50% {
        box-shadow: 0 0 22px rgba(255, 255, 255, 0.25);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.0);
    }
}

.question-subtitle {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ============================================
   QUIZ STYLES
   ============================================ */

.quiz-container {
    max-width: 720px;
    width: 100%;
}

.quiz-title {
    margin-bottom: 8px;
}

.quiz-score {
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: 24px;
}

.quiz-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-frame {
    margin: 0 auto;
    max-width: 520px;
}

.quiz-image {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    background: rgba(0, 0, 0, 0.06);
}

.quiz-image img {
    width: 100%;
    height: auto;
    display: block;
}

.quiz-clue {
    font-size: 0.95rem;
    color: var(--gray);
    margin: 0;
}

.quiz-question {
    font-size: 1.35rem;
    margin: 0;
}

.quiz-options {
    display: grid;
    gap: 12px;
}

.quiz-options .option-btn {
    width: 100%;
    text-align: center;
}

.quiz-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.quiz-hint-text {
    display: none;
    font-size: 0.95rem;
    color: var(--gray);
}

.quiz-hint-text.is-visible {
    display: block;
}

.quiz-actions .btn-secondary.is-disabled,
.quiz-actions .btn-secondary:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.quiz-reaction,
.quiz-reveal {
    display: none;
    margin: 0;
    font-size: 1rem;
    color: var(--dark);
}

.quiz-reaction.is-visible,
.quiz-reveal.is-visible {
    display: block;
}

.quiz-final-screen {
    display: none;
    margin-top: 8px;
    padding: 18px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.quiz-final-screen.is-visible {
    display: block;
}

.quiz-final-emoji {
    font-size: 2rem;
    margin-bottom: 6px;
}

.quiz-final-title {
    font-size: 1.35rem;
    margin: 0 0 6px;
}

.quiz-final-text {
    margin: 0 0 8px;
    white-space: pre-line;
    color: var(--gray);
    line-height: 1.5;
}

.quiz-final-score {
    margin: 0;
    font-weight: 600;
}

.quiz-options .option-btn.is-disabled {
    opacity: 0.65;
    pointer-events: none;
}

.quiz-options .option-btn.is-correct {
    background: #1f7a4f;
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 122, 79, 0.3);
}

.quiz-options .option-btn.is-wrong {
    background: #a43a3a;
    color: #fff;
    box-shadow: 0 10px 22px rgba(164, 58, 58, 0.3);
}

.quiz-options .option-btn.is-selected {
    transform: translateY(-1px) scale(1.01);
}

.quiz-next {
    display: none;
    align-self: center;
    margin-top: 8px;
}

.quiz-next.is-visible {
    display: inline-block;
}

/* ============================================
   COMPONENT STYLES
   ============================================ */

.message {
    display: none;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

.message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.question-block {
    display: none;
    animation: fadeIn 0.5s ease;
}

.question-block.active {
    display: block;
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */

.btn-primary,
.btn-secondary,
.option-btn {
    padding: 16px 35px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 100px; /* Fully rounded */
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 20px;
    display: inline-block;
    user-select: none;
}

.btn-primary {
    background: #111217;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.85);
    color: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: var(--white);
}

.option-btn {
    background: rgba(255, 255, 255, 0.78);
    color: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.55);
    width: 100%;
}

.emoji-btn {
    font-size: 1.6rem;
    letter-spacing: 0;
}

.option-btn:hover {
    transform: translateY(-2px) scale(1.01);
    background: var(--white);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-primary:active,
.btn-secondary:active,
.option-btn:active {
    transform: translateY(0) scale(0.98);
}

button:focus-visible,
.back-btn:focus-visible,
.masonry-card:focus-visible,
.lightbox-close:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
}

.back-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--dark);
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    appearance: none;
    font: inherit;
    transition: all 0.3s ease;
    z-index: 100;
    user-select: none;
}

.back-btn:hover {
    background: var(--white);
    transform: translateX(-5px);
}

/* ============================================
   IMAGE FRAMES & ASSETS
   ============================================ */

.question-image,
.teaser-image {
    width: 100%;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    background: var(--light-gray);
    position: relative;
    transform: scale(1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.question-image:hover,
.teaser-image:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.question-image img,
.teaser-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: breath 8s infinite ease-in-out;
}

@keyframes breath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* More prominent frame style */
.image-frame {
    padding: 15px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    display: inline-block;
}

.image-frame img {
    border-radius: 12px;
}


/* ============================================
   FINAL VALENTINE BUTTONS
   ============================================ */

.button-container {
    position: relative;
    min-height: 180px;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 12px;
}

.btn-no {
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 20;
}

.btn-no:hover {
    background: var(--dark);
    color: var(--white);
    transform: translateY(-2px) scale(1.02);
}

.btn-yes {
    padding: 22px 55px;
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    background: var(--dark);
    color: var(--white);
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
    min-width: 220px;
    z-index: 50;
}

.btn-yes:hover {
    transform: translateX(-50%) scale(1.06);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.heart-burst {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 300;
}

.heart-burst span {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9rem;
    opacity: 0;
    animation: heartBurst 1.1s ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes heartBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(1.1);
    }
}

.btn-yes.is-evading {
    transform: translateX(0);
}

.btn-yes.is-evading:hover {
    transform: translateX(0) scale(1.06);
}

/* ============================================
   REMAINING SECTIONS (to be styled)
   ============================================ */

/* ============================================
   CELEBRATION STYLES
   ============================================ */
.final-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 30px 0;
}

.final-gallery img {
    width: 100px;
    height: 100px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
    animation: appear 0.5s ease-out forwards;
    opacity: 0;
}

.share-note {
    margin-top: 6px;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.6);
}

.share-panel {
    margin: 12px auto 0;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.share-panel[hidden] {
    display: none;
}

.share-label {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: rgba(0, 0, 0, 0.7);
}

.share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.share-link {
    flex: 1 1 260px;
    min-height: 70px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    font: inherit;
    resize: vertical;
    background: rgba(255, 255, 255, 0.8);
}

.share-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7);
}

.share-status.is-error {
    color: rgba(150, 30, 40, 0.8);
}

.final-card {
    margin: 24px auto 30px;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.final-card img {
    width: 100%;
    border-radius: 14px;
    display: block;
    margin-bottom: 12px;
}

.final-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.75);
}

@keyframes appear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.heart {
    position: absolute;
    bottom: -50px;
    font-size: 2rem;
    animation: rise 5s ease-in infinite;
}

@keyframes rise {
    to {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.emoji-options {
    /* These can be styled later to match the new aesthetic */
    display: none; /* Temporarily hide for initial redesign */
}


/* ============================================
   GALLERY STYLES
   ============================================ */

.masonry-wrap {
    margin: 40px auto 10px;
    width: 100%;
}

.masonry-grid {
    column-count: 3;
    column-gap: 22px;
}

.masonry-card {
    display: inline-block;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    margin: 0 0 22px;
    padding: 12px;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.65);
    appearance: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    opacity: 0;
    animation: masonryIn 0.8s ease forwards;
    animation-delay: var(--delay, 0s);
    break-inside: avoid;
}

.masonry-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.masonry-card:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
}

.masonry-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    display: block;
    margin-bottom: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.7);
}

.masonry-caption {
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.72);
    white-space: pre-line;
}

.masonry-caption:empty {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 7, 0.78);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 400;
    padding: 30px;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: min(90vw, 900px);
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    text-align: center;
    max-height: 85vh;
    overflow-y: auto;
}

.lightbox-content img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 14px;
    margin-bottom: 14px;
}

.lightbox-caption {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.75);
    white-space: pre-line;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

body.lightbox-open {
    overflow: hidden;
}



/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* ============================================
   IDENTITY HEADER (SPLIT FLAP)
   ============================================ */

.identity-header {
    display: flex;
    justify-content: center;
    margin-bottom: 40px; /* Increased margin */
    perspective: 1000px;
    overflow: hidden; /* Prevent stray glyph layers from leaking */
}

.identity-header .flap-text {
    display: inline-flex;
    gap: 8px; /* Reduced gap */
}

.flap-char {
    position: relative;
    display: inline-flex;
    width: 50px;
    height: 75px;
    font-size: 2.1rem;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
    will-change: transform;
}

.flap-char .top,
.flap-char .bottom,
.flap-char .top-back,
.flap-char .bottom-back {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    backface-visibility: hidden;
    background: rgba(0,0,0,0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-ligatures: none;
}

.flap-char .top,
.flap-char .top-back {
    top: 0;
    transform-origin: bottom;
}

.flap-char .bottom,
.flap-char .bottom-back {
    bottom: 0;
    transform-origin: top;
}

/* Hinge line */
.flap-char .top::after,
.flap-char .bottom::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}
.flap-char .bottom::after {
    top: -1px;
}

.flap-char .top-back {
    transform: rotateX(180deg);
}

.flap-char .bottom-back {
    transform: rotateX(-180deg);
}

/* Animation states */
.flap-char.jumble .top {
    animation: flip-top 0.4s ease-in forwards;
}
.flap-char.jumble .bottom {
    animation: flip-bottom 0.4s ease-out forwards;
}

@keyframes flip-top {
    100% { transform: rotateX(-90deg); }
}
@keyframes flip-bottom {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}


@media (max-width: 768px) {
    .section {
        min-height: 100svh;
    }

    .section.active {
        align-items: flex-start;
    }

    .btn-primary,
    .btn-secondary,
    .option-btn,
    .btn-no,
    .btn-yes,
    .back-btn,
    .music-toggle,
    .speed-btn,
    .quiz-next,
    .typing-next {
        min-height: 44px;
    }

    .speed-btn {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .identity-header .flap-text {
        gap: 5px;
        flex-wrap: wrap; /* Allow wrapping on small screens */
        justify-content: center;
    }
    .flap-char {
        width: 35px; /* Further reduced width */
        height: 50px; /* Further reduced height */
        font-size: 1.5rem; /* Further reduced font size */
        line-height: 50px; /* Adjusted line-height */
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .container {
        padding: 40px 25px;
        border-radius: 25px;
    }

    .btn-yes {
        padding: 18px 40px;
        font-size: 1.2rem;
        min-width: 180px;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .question-image,
    .teaser-image {
        height: 250px;
    }

    .tease-image {
        height: 240px;
    }

    .hero-wrap {
        padding-top: clamp(160px, 26vw, 240px);
    }

    .hero-head {
        width: clamp(110px, 26vw, 160px);
    }

    .typing-card {
        padding: 24px 20px;
    }

    .typing-text {
        font-size: 0.95rem;
    }

    .typing-controls {
        gap: 8px;
    }

    .masonry-grid {
        column-count: 2;
        column-gap: 16px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }
    
    body {
        /* Prevent horizontal scroll on very small screens */
        overflow-x: hidden;
    }

    .container {
        padding: 30px 20px;
        width: 95%;
        margin: 0 auto; /* Center it */
    }

    .btn-yes {
        padding: 16px 35px;
        font-size: 1.1rem;
        min-width: 160px;
        top: 0;
    }

    .subtitle {
        font-size: 1rem;
    }

    .question-image,
    .teaser-image {
        height: 200px;
    }

    .tease-image {
        height: 210px;
    }

    .typing-text {
        font-size: 0.9rem;
    }

    .typing-controls {
        flex-direction: column;
    }

    .masonry-grid {
        column-count: 1;
    }

    .music-toggle {
        top: 12px;
        right: 12px;
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}
