/* ============================================================
   shinonome.moe — CSS
   Palette:
     Deep Night:       #050a1a
     Midnight Blue:    #0d1635
     Pre-dawn Earth:   #0d0f1a
     Horizon Glow:     #1e3a6e
     Cold Star:        #e8eeff
     Pale Horizon:     #b8c8e8
     Constellation Gold: #c8a96e
     Celestial Blue:   #4a6fa1
     Dawn Blush:       #7b9fd4
     Glass Midnight:   rgba(15, 25, 60, 0.4)
     Bright Star:      #ffffff (80% opacity, brightest stars only)
   Fonts: Outfit (display), DM Sans (body), Space Grotesk (accent)
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: #050a1a;
    color: #b8c8e8;
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Custom Cursor ---- */
.custom-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(74, 111, 161, 0.6);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
    z-index: 9999;
    mix-blend-mode: screen;
}

.custom-cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #7b9fd4;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: transform 0.05s ease;
}

/* ---- Constellation SVG ---- */
.constellation-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

/* ---- Site Wrapper — Horizon Split ---- */
.site-wrapper {
    height: 100vh;
    display: grid;
    grid-template-rows: 60vh 40vh;
    overflow: hidden;
    background: #050a1a;
    position: relative;
}

/* ============================================================
   SKY PLANE (60vh)
   ============================================================ */
.sky-plane {
    position: sticky;
    top: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at 30% 40%, #0d1635 0%, #050a1a 70%);
    cursor: none;
    z-index: 10;
}

/* stars and cards float above */
.sky-plane .star,
.sky-plane .glass-card {
    position: absolute;
}

/* Horizon glow at bottom edge of sky plane */
.sky-horizon-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: radial-gradient(ellipse 80% 100% at 50% 100%, rgba(30, 58, 110, 0.5) 0%, transparent 80%);
    pointer-events: none;
    z-index: 2;
}

/* Horizon Pulse Line */
.horizon-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #4a6fa1;
    opacity: 0.6;
    z-index: 20;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 4px 1px rgba(74, 111, 161, 0.3);
        opacity: 0.6;
    }
    50% {
        box-shadow: 0 0 12px 3px rgba(74, 111, 161, 0.6);
        opacity: 0.9;
    }
}

/* Stars (injected by JS) */
@keyframes twinkle {
    from {
        opacity: 0.4;
        transform: scale(1);
    }
    to {
        opacity: 0.9;
        transform: scale(1.4);
        filter: drop-shadow(0 0 2px #ffffff);
    }
}

/* Shooting star */
@keyframes shoot {
    from {
        transform: translate(0, 0) scaleX(0.1);
        opacity: 1;
    }
    to {
        transform: translate(-320px, 160px) scaleX(1);
        opacity: 0;
    }
}

.shooting-star {
    position: absolute;
    width: 80px;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(90deg, rgba(232, 238, 255, 0.9) 0%, rgba(74, 111, 161, 0.3) 60%, transparent 100%);
    pointer-events: none;
    transform-origin: right center;
    animation: shoot 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 6;
}

/* ============================================================
   GLASSMORPHIC CARDS
   ============================================================ */
.glass-card {
    position: absolute;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background: rgba(15, 25, 60, 0.4);
    border: 1px solid rgba(100, 150, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 32px rgba(20, 40, 120, 0.3);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
    z-index: 15;
    min-width: 200px;
    max-width: 260px;
    cursor: none;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 30px;
    background: radial-gradient(ellipse at 50% 50%, rgba(74, 111, 161, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.glass-card:hover {
    border-color: rgba(100, 150, 255, 0.45);
    box-shadow: 0 8px 40px rgba(30, 60, 160, 0.45);
}

.card-glow {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: radial-gradient(ellipse at 30% 30%, rgba(74, 111, 161, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.card-constellation-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #c8a96e;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.card-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: #b8c8e8;
    margin: 0;
}

.card-coords {
    display: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #c8a96e;
    opacity: 0.6;
    margin-top: 0.75rem;
}

.glass-card:hover .card-coords {
    display: block;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 0.6; transform: translateY(0); }
}

/* ============================================================
   EARTH PLANE (40vh)
   ============================================================ */
.earth-plane {
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background: #0d0f1a;
    position: relative;
    z-index: 8;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.earth-plane::-webkit-scrollbar {
    display: none;
}

/* Horizon glow at top of earth plane (city below horizon simulation) */
.earth-horizon-glow {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(30, 58, 110, 0.35) 0%, transparent 80%);
    pointer-events: none;
    z-index: 5;
    margin-bottom: -60px;
}

/* ---- Scroll Snap Sections ---- */
.section-snap {
    scroll-snap-align: start;
    height: 40vh;
    padding: 2rem 3rem;
    display: flex;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-snap.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-inner {
    max-width: 680px;
    position: relative;
    z-index: 2;
}

/* Section vertical alignment variations */
.section-intro .section-inner {
    text-align: left;
}

.section-moment .section-inner {
    text-align: left;
}

.section-welcome .section-inner {
    text-align: right;
    margin-left: auto;
}

.section-about .section-inner {
    text-align: left;
}

.section-close .section-inner {
    text-align: center;
    margin: 0 auto;
}

/* ---- Kinetic Headline ---- */
.kinetic-headline {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(48px, 8vw, 96px);
    letter-spacing: -0.02em;
    color: rgba(232, 238, 255, 0.9);
    line-height: 1;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

/* Individual letter wrappers injected by JS */
.kinetic-headline .letter {
    display: inline-block;
    animation: kinetic-drift 4s ease-in-out infinite;
}

.kinetic-headline .letter:nth-child(odd) {
    animation-duration: 3.7s;
}

.kinetic-headline .letter:nth-child(3n) {
    animation-duration: 4.3s;
}

.kinetic-headline .letter-space {
    display: inline-block;
    width: 0.3em;
}

@keyframes kinetic-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ---- Section Subtitle / Body ---- */
.section-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #c8a96e;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.section-body {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    color: #b8c8e8;
    margin-top: 0.5rem;
    max-width: 520px;
}

.section-welcome .section-body {
    margin-left: auto;
}

/* ---- Close section coord label ---- */
.coord-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #c8a96e;
    opacity: 0.5;
    display: block;
    margin-bottom: 0.75rem;
}

.section-close-text {
    display: block;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .site-wrapper {
        grid-template-rows: 55vh 45vh;
    }

    .sky-plane {
        /* on small screens allow normal scroll */
    }

    .section-snap {
        padding: 1.5rem 1.5rem;
        height: 45vh;
    }

    .kinetic-headline {
        font-size: clamp(36px, 10vw, 72px);
    }

    .glass-card {
        padding: 1rem 1.25rem;
        min-width: 160px;
        max-width: 200px;
    }

    .card-text {
        font-size: 12px;
    }

    .section-welcome .section-inner {
        text-align: left;
        margin-left: 0;
    }

    .section-close .section-inner {
        text-align: left;
        margin: 0;
    }
}
