/* ==========================================================================
   Home page — "A Life, in Bloom" landing scene
   Scoped entirely to index.php. Never touches main.css or Js/main.js.

   Background photography credits (Images/HomePage/scene/):
   - Milky Way night sky: ESO/F. Char, CC BY 4.0
     (eso.org/public/images/milkywaylasilla-cc)
   - Golden-hour hills (Glencolmcille, Donegal, Ireland): Samuel Philip,
     Pexels License (pexels.com/photo/37918670). Night variant is the same
     photo, day-for-night graded via tools/generate-scene-assets.php.
   Rose bloom sprites: rendered in-house with Blender (Cycles).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scene shell
   -------------------------------------------------------------------------- */
.main-content.home-main {
    margin-top: 0;
}

.home-scene {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 480px;
    overflow: hidden;
    background-color: #0a0f24;
}

#homeSceneCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* --------------------------------------------------------------------------
   2. Bloom links
   -------------------------------------------------------------------------- */
.bloom-links {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.bloom-link {
    position: absolute;
    display: inline-flex;
    align-items: center;
    pointer-events: auto;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.2);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s 0.5s;
}

.bloom-link.is-open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bloom-photo {
    display: block;
    position: relative;
    width: var(--bloom-d, 96px);
    height: var(--bloom-d, 96px);
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 251, 240, 0.85);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease;
}

/* Inner shadow overlay: dark upper rim + soft light lower rim makes the
   photo read as recessed into the rose. (Inset shadow must live on an
   overlay — set directly on .bloom-photo it would paint under the img.) */
.bloom-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    box-shadow:
        inset 0 3px 7px rgba(35, 8, 18, 0.55),
        inset 0 6px 16px rgba(35, 8, 18, 0.3),
        inset 0 -2px 5px rgba(255, 235, 220, 0.28);
}

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

.bloom-chip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: rgba(255, 251, 246, 0.93);
    color: #6d1f3c;
    border: 1px solid rgba(122, 30, 58, 0.35);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: Georgia, serif;
    font-size: 14px;
    transition: background 0.25s ease;
}

.bloom-link.chip-left .bloom-chip {
    right: calc(100% + 12px);
}

.bloom-link.chip-right .bloom-chip {
    left: calc(100% + 12px);
}

.bloom-link:hover .bloom-photo,
.bloom-link:focus-visible .bloom-photo {
    transform: scale(1.06);
}

.bloom-link:hover .bloom-chip,
.bloom-link:focus-visible .bloom-chip {
    background: rgba(255, 251, 246, 1);
}

.bloom-link:focus-visible {
    outline: 3px solid #ffe9a8;
    outline-offset: 3px;
    border-radius: 50%;
}

/* Bud variant — no photo, chip centered under the anchor point */
.bloom-link--bud {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bloom-link--bud .bloom-chip {
    position: static;
    transform: none;
}

/* --------------------------------------------------------------------------
   3. Title
   -------------------------------------------------------------------------- */
.home-scene-title {
    position: absolute;
    /* Below the love banner — the banner's bottom edge lands ~230px down. */
    top: max(244px, 26%);
    left: 0;
    right: 0;
    z-index: 6;
    width: 100%;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    color: #f7ead8;
    /* Layered warm-dark shadow keeps the title legible against the bright
       golden sky once the scene settles at daybreak. */
    text-shadow:
        0 1px 2px rgba(58, 27, 12, 0.85),
        0 2px 10px rgba(58, 27, 12, 0.6),
        0 5px 26px rgba(40, 18, 8, 0.55);
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.home-scene-title.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Landscape: the vine tip + bud chip occupy top-center, so the title moves
   into the open sky on the right. */
.home-scene.is-landscape .home-scene-title {
    text-align: right;
    padding-right: 5%;
    /* Right-aligned text clears the centered banner, so it can ride higher
       than the portrait default. */
    top: max(196px, 20%);
}

.home-scene-subtitle {
    display: block;
    font-family: 'Great Vibes', cursive;
    font-style: normal;
    font-size: clamp(1.3rem, 3vw, 2rem);
    color: #ffedd0;
    text-shadow:
        0 1px 3px rgba(58, 27, 12, 0.9),
        0 2px 8px rgba(58, 27, 12, 0.65),
        0 4px 20px rgba(40, 18, 8, 0.55);
}

/* --------------------------------------------------------------------------
   4. Skip button
   -------------------------------------------------------------------------- */
.scene-skip {
    position: absolute;
    top: 86px;
    right: 16px;
    z-index: 20;
    background: rgba(10, 15, 36, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.2s ease;
}

.scene-skip:hover,
.scene-skip:focus-visible {
    background: rgba(10, 15, 36, 0.8);
}

.scene-skip.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. Love banner (moved verbatim from index.php inline <style>, with
      positioning overrides at the end to seat it inside .home-scene)
   -------------------------------------------------------------------------- */
.hero { position: relative; }

/* === Electric glow wrapper === */
.love-banner-glow {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    max-width: 90vw;
    padding: 3px;
    border-radius: 33px;
    overflow: hidden;
    animation: loveBannerIn 1.2s ease-out both;
    box-shadow:
        0 0 15px rgba(192, 132, 252, 0.7),
        0 0 35px rgba(192, 132, 252, 0.4),
        0 0 60px rgba(147, 197, 253, 0.25);
}

/* Rotating gradient — only 1/3 is colored = electricity effect */
.love-banner-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 600%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        #d8b4fe 4%,
        #f472b6 10%,
        #60a5fa 17%,
        #a78bfa 24%,
        #d8b4fe 30%,
        transparent 36%,
        transparent 100%
    );
    transform-origin: center;
    transform: translate(-50%, -50%);
    animation: electricRotate 2.5s linear infinite;
    z-index: -1;
}

@keyframes electricRotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Dark shield to block conic gradient from bleeding through transparent banner */
.love-banner-glow::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 30px;
    background: rgb(10, 18, 40);
    z-index: 0;
}

/* === Banner (visual styles only, no positioning) === */
.love-banner {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(0, 119, 190, 0.7) 0%, rgba(64, 224, 208, 0.7) 50%, rgba(135, 206, 235, 0.7) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: #fff;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    text-align: center;
    padding: 14px 28px;
    border-radius: 30px;
    letter-spacing: 0.3px;
    overflow: hidden;
}

/* Shimmer sweep across the banner */
.love-banner::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 15%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0.2) 60%,
        transparent 85%
    );
    animation: shimmerSweep 3.5s ease-in-out 2s infinite;
    z-index: 1;
    pointer-events: none;
}

/* Keep banner text above the shimmer */
.love-banner-text {
    position: relative;
    z-index: 2;
}

/* Signature line */
.love-banner-sig {
    display: block;
    position: relative;
    z-index: 2;
    font-family: 'Great Vibes', cursive;
    font-style: normal;
    font-size: 1.35em;
    opacity: 0.85;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

@keyframes shimmerSweep {
    0%   { left: -100%; }
    35%  { left: 200%; }
    100% { left: 200%; }
}

/* Pulsing heart glow */
.love-heart {
    display: inline-block;
    position: relative;
    z-index: 2;
    animation: heartPulse 1.5s ease-in-out 1s infinite;
}

@keyframes heartPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 0px transparent;
    }
    15% {
        transform: scale(1.4);
        text-shadow: 0 0 12px rgba(255, 80, 80, 0.9), 0 0 24px rgba(255, 80, 80, 0.5);
    }
    30% { transform: scale(1); text-shadow: 0 0 0px transparent; }
    45% {
        transform: scale(1.25);
        text-shadow: 0 0 10px rgba(255, 80, 80, 0.7), 0 0 20px rgba(255, 80, 80, 0.4);
    }
    60% { transform: scale(1); text-shadow: 0 0 0px transparent; }
}

@keyframes loveBannerIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-18px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === Mobile: full-width with small margins === */
@media (max-width: 768px) {
    .love-banner-glow {
        left: 12px;
        right: 12px;
        max-width: none;
        width: auto;
        transform: none;
        border-radius: 19px;
        animation: loveBannerInMobile 1.2s ease-out both;
    }
    .love-banner {
        padding: 14px 20px;
        border-radius: 16px;
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }
    .love-banner-glow::after {
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .love-banner-glow {
        left: 10px;
        right: 10px;
        border-radius: 17px;
        top: 10px;
    }
    .love-banner {
        padding: 12px 16px;
        border-radius: 14px;
    }
    .love-banner-glow::after {
        border-radius: 14px;
    }
}

@keyframes loveBannerInMobile {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.heart-confetti {
    position: fixed;
    top: -5vh;
    z-index: 9999;
    pointer-events: none;
    font-size: 22px;
    opacity: 0;
    animation: heartFall linear forwards;
}

@keyframes heartFall {
    0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
    25%  { transform: translateY(25vh) rotate(15deg) translateX(15px); }
    50%  { transform: translateY(50vh) rotate(-10deg) translateX(-10px); }
    75%  { transform: translateY(75vh) rotate(20deg) translateX(12px); }
    100% { opacity: 0; transform: translateY(110vh) rotate(-15deg) translateX(-8px); }
}

/* Positioning overrides: seat the banner inside .home-scene, below the navbar */
.home-scene .love-banner-glow {
    top: 84px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 10;
}

@media (max-width: 768px) {
    .home-scene .love-banner-glow {
        left: 12px;
        right: 12px;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   6. No-JS fallback
   -------------------------------------------------------------------------- */
html:not(.js) .home-scene {
    height: auto;
    min-height: 100svh;
    background: linear-gradient(180deg, #5d7fb5 0%, #e8a86e 42%, #ef8556 58%, #3f7a2f 58.5%, #2c5c22 100%);
}

html:not(.js) #homeSceneCanvas,
html:not(.js) .scene-skip {
    display: none;
}

html:not(.js) .bloom-links {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 140px;
    padding-bottom: 40px;
}

html:not(.js) .bloom-link {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
}

html:not(.js) .bloom-photo {
    display: none;
}

html:not(.js) .bloom-chip {
    position: static;
    transform: none;
}

html:not(.js) .home-scene-title {
    position: relative;
    top: 0;
    opacity: 1;
    transform: none;
    padding-top: 24px;
}

/* --------------------------------------------------------------------------
   7. Below-the-fold section
   -------------------------------------------------------------------------- */
.home-below {
    background-color: #fff;
    padding: 2.5rem 1rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   8. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .bloom-link,
    .bloom-photo,
    .bloom-chip,
    .home-scene-title,
    .scene-skip {
        transition: none !important;
    }

    .love-banner-glow,
    .love-banner-glow::before,
    .love-banner::before,
    .love-heart {
        animation: none !important;
    }

    .heart-confetti {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   9. Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Tuck the title up under the love banner (banner bottom lands ~185px)
       so the vine/roses below get more vertical room. */
    .home-scene-title {
        top: max(204px, 22%);
    }

    .bloom-chip {
        font-size: 13px;
    }

    .scene-skip {
        top: 78px;
        right: 10px;
    }
}
