/* ============================================
   sora.day - The Sky Through One Day
   ============================================ */

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(0.875rem, 1.2vw, 1.125rem);
    line-height: 1.9;
    color: #E8EDF5;
    background: #0B0E2A;
    overflow-x: hidden;
}

/* --- Persistent Horizon Line --- */
.horizon-line {
    position: fixed;
    top: 62vh;
    left: 0;
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        rgba(194, 204, 217, 0.3) 0px,
        rgba(194, 204, 217, 0.15) 4px,
        rgba(194, 204, 217, 0.3) 8px
    );
    background-size: 200% 100%;
    animation: horizonShimmer 120s linear infinite;
    z-index: 50;
    pointer-events: none;
}

@keyframes horizonShimmer {
    0% { background-position: 0 0; }
    100% { background-position: 200% 0; }
}

/* --- Celestial Navigation --- */
.celestial-nav {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    z-index: 60;
}

.pip {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #C2CCD9;
    display: block;
    opacity: 0.4;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.pip:hover {
    transform: scale(1.3);
    opacity: 0.8;
}

.pip-crescent {
    background: transparent;
    box-shadow: inset -4px 0 0 #D4788C;
}

.pip-half-sun {
    background: linear-gradient(90deg, #4A90D9 50%, transparent 50%);
}

.pip-full-sun {
    background: #F5D76E;
    border-color: #F5D76E;
}

.pip-setting {
    background: linear-gradient(180deg, #D4864A 50%, transparent 50%);
}

.pip-star {
    background: #B8C4D6;
    width: 8px;
    height: 8px;
    margin: 2px;
}

/* --- Sun Disc --- */
.sun-disc {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F5D76E;
    box-shadow:
        0 0 40px rgba(245, 215, 110, 0.4),
        0 0 80px rgba(245, 215, 110, 0.2),
        0 0 120px rgba(245, 215, 110, 0.1);
    z-index: 40;
    pointer-events: none;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.3s ease, opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
    top: 60vh;
    opacity: 0;
}

/* --- Panels --- */
.panel {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

/* --- Atmosphere Layers --- */
.atmosphere-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 62%;
    z-index: 1;
}

/* --- Reflection Zone --- */
.reflection-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 38%;
    z-index: 1;
    opacity: 0.2;
    filter: blur(2px);
    transform: scaleY(-1);
}

/* --- Panel 1: Yoake (Dawn) --- */
.panel-yoake {
    background: #0B0E2A;
}

.panel-yoake .atmosphere-layer {
    background:
        radial-gradient(ellipse at 20% 100%, rgba(212, 120, 140, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 90%, rgba(212, 120, 140, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 110%, rgba(250, 240, 230, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 20%, rgba(11, 14, 42, 0.8) 0%, transparent 80%);
}

.panel-yoake .reflection-zone {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(212, 120, 140, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 0%, rgba(26, 30, 46, 0.9) 0%, transparent 70%);
}

/* --- Panel 2: Asa (Morning) --- */
.panel-asa {
    background: #4A90D9;
}

.panel-asa .atmosphere-layer {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(232, 237, 245, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(74, 144, 217, 0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 40%, rgba(100, 160, 230, 0.4) 0%, transparent 70%),
        radial-gradient(ellipse at 50% 100%, rgba(194, 204, 217, 0.2) 0%, transparent 30%);
}

.panel-asa .reflection-zone {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(74, 144, 217, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 0%, rgba(26, 30, 46, 0.3) 0%, transparent 70%);
}

/* --- Panel 3: Mahiru (Midday) --- */
.panel-mahiru {
    background: #FAFBFD;
}

.panel-mahiru .atmosphere-layer {
    background:
        radial-gradient(circle at 50% 10%, rgba(245, 215, 110, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 0%, rgba(250, 251, 253, 0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 50%, rgba(200, 220, 245, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(200, 220, 245, 0.2) 0%, transparent 50%);
}

.panel-mahiru .reflection-zone {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(200, 220, 245, 0.3) 0%, transparent 50%),
        linear-gradient(to bottom, rgba(250, 251, 253, 0.1), rgba(194, 204, 217, 0.2));
}

/* --- Panel 4: Yuugure (Dusk) --- */
.panel-yuugure {
    background: #5B3A6E;
}

.panel-yuugure .atmosphere-layer {
    background:
        radial-gradient(ellipse at 80% 100%, rgba(212, 134, 74, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(212, 134, 74, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 30%, rgba(91, 58, 110, 0.8) 0%, transparent 60%),
        radial-gradient(ellipse at 60% 60%, rgba(140, 80, 100, 0.3) 0%, transparent 50%);
}

.panel-yuugure .reflection-zone {
    background:
        radial-gradient(ellipse at 80% 0%, rgba(212, 134, 74, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(26, 30, 46, 0.5) 0%, transparent 60%);
}

/* --- Panel 5: Yoru (Night) --- */
.panel-yoru {
    background: #0A1628;
}

.panel-yoru .atmosphere-layer {
    background:
        radial-gradient(ellipse at 40% 30%, rgba(20, 30, 55, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 50%, rgba(15, 25, 50, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(26, 30, 46, 0.3) 0%, transparent 40%);
    animation: nightShift 120s ease-in-out infinite;
}

@keyframes nightShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(5deg); }
}

.panel-yoru .reflection-zone {
    background: radial-gradient(ellipse at 50% 0%, rgba(10, 22, 40, 0.5) 0%, transparent 50%);
}

/* --- Constellation --- */
.constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 62%;
    z-index: 5;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.4); opacity: 1; }
}

.star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: #B8C4D6;
    animation: twinkle var(--dur) ease-in-out infinite;
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 62%;
    z-index: 4;
    pointer-events: none;
}

/* --- Cirrus Wisps --- */
.cirrus-wisps {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 62%;
    z-index: 3;
    pointer-events: none;
}

@keyframes wispDrift1 { 0% { transform: translateX(0); } 100% { transform: translateX(80px); } }
@keyframes wispDrift2 { 0% { transform: translateX(0); } 100% { transform: translateX(-60px); } }
@keyframes wispDrift3 { 0% { transform: translateX(0); } 100% { transform: translateX(50px); } }

.wisp-1 { animation: wispDrift1 60s ease-in-out infinite alternate; }
.wisp-2 { animation: wispDrift2 80s ease-in-out infinite alternate; }
.wisp-3 { animation: wispDrift3 45s ease-in-out infinite alternate; }
.wisp-4 { animation: wispDrift1 90s ease-in-out infinite alternate; }
.wisp-5 { animation: wispDrift2 55s ease-in-out infinite alternate; }
.wisp-6 { animation: wispDrift3 70s ease-in-out infinite alternate; }
.wisp-7 { animation: wispDrift1 40s ease-in-out infinite alternate; }

/* --- Panel Text --- */
.panel-text {
    position: absolute;
    z-index: 10;
    top: 30%;
    max-width: 42ch;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.panel-text.visible {
    opacity: 1;
}

.text-left {
    left: 8%;
}

.text-right {
    right: 8%;
    text-align: right;
}

.domain-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 300;
    letter-spacing: 0.2em;
    color: #D4788C;
    line-height: 1;
    background: linear-gradient(135deg, #D4788C, #E8EDF5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.panel-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #E8EDF5;
    line-height: 1;
    margin-bottom: 1rem;
}

.panel-title-bright {
    color: #3A2A5A;
}

.panel-title-dusk {
    color: #E8EDF5;
}

.panel-title-night {
    color: #B8C4D6;
}

.panel-desc {
    font-family: 'Commissioner', sans-serif;
    font-size: clamp(0.875rem, 1.2vw, 1.125rem);
    font-weight: 300;
    line-height: 1.9;
    color: #C2CCD9;
    margin-bottom: 1rem;
}

.panel-desc-bright {
    color: #5B3A6E;
}

.panel-desc-dusk {
    color: #D4864A;
}

.panel-desc-night {
    color: #B8C4D6;
}

.time-annotation {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.7rem;
    font-weight: 300;
    opacity: 0.4;
    color: #C2CCD9;
    display: block;
    margin-top: 0.5rem;
}

.time-bright {
    color: #5B3A6E;
}

.time-night {
    color: #B8C4D6;
}

/* Earth shadow reference: #1A1E2E */
.earth-shadow-ref {
    background: #1A1E2E;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .panel-text {
        top: 20%;
        max-width: 90%;
    }

    .text-left { left: 5%; }
    .text-right { right: 5%; text-align: left; }

    .celestial-nav {
        right: 0.75rem;
        gap: 0.8rem;
    }

    .pip {
        width: 10px;
        height: 10px;
    }
}
