/* ===== logic.day - Sun-Drenched Digital Greenhouse ===== */

:root {
    --morning-blue: #E0F2FE;
    --spring-mint: #D1FAE5;
    --clear-sky: #0EA5E9;
    --amber-reason: #F59E0B;
    --frosted-white: #F8FAFC;
    --slate-ink: #1E293B;
    --warm-slate: #334155;
    --leaf-green: #22C55E;
    --aqua-sheen: #7DD3FC;
    --sunrise-peach: #FED7AA;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--morning-blue);
    color: var(--warm-slate);
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===== Sunrise Overlay ===== */
#sunrise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--sunrise-peach), var(--morning-blue), var(--aqua-sheen));
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: clip-path 1.2s ease-in-out 0.8s, opacity 0.6s ease 2s;
    clip-path: inset(0 0 0 0);
    opacity: 1;
}

#sunrise-overlay.splitting {
    clip-path: inset(0 50% 0 50%);
}

#sunrise-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.sunrise-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--slate-ink);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
    opacity: 0;
    animation: titleFade 800ms ease-out 200ms forwards;
}

.sunrise-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

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

/* ===== Ambient Particles ===== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--aqua-sheen);
    opacity: 0.15;
}

/* ===== Split Container ===== */
#split-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.split-panel {
    position: relative;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

#panel-left {
    width: 55%;
    background: linear-gradient(135deg, var(--sunrise-peach) 0%, var(--morning-blue) 100%);
}

#panel-right {
    width: 45%;
    background: linear-gradient(135deg, var(--morning-blue) 0%, var(--spring-mint) 100%);
}

/* ===== Split Divider ===== */
#split-divider {
    position: fixed;
    top: 0;
    left: 55%;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--clear-sky), var(--leaf-green));
    z-index: 10;
    transform: translateX(-50%);
}

/* ===== Nature Background Elements ===== */
.nature-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-leaf {
    position: absolute;
    width: 60px;
    height: 80px;
    border-radius: 0 80% 0 80%;
    opacity: 0.15;
}

.leaf-1 {
    background: linear-gradient(135deg, var(--leaf-green), var(--spring-mint));
    top: 15%;
    left: 10%;
    animation: leafFloat1 25s ease-in-out infinite;
}

.leaf-2 {
    background: linear-gradient(135deg, var(--aqua-sheen), var(--leaf-green));
    top: 55%;
    right: 15%;
    width: 45px;
    height: 60px;
    animation: leafFloat2 30s ease-in-out infinite;
}

.leaf-3 {
    background: linear-gradient(135deg, var(--spring-mint), var(--leaf-green));
    top: 35%;
    left: 20%;
    width: 50px;
    height: 70px;
    animation: leafFloat1 35s ease-in-out infinite reverse;
}

@keyframes leafFloat1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -20px) rotate(5deg); }
    50% { transform: translate(-10px, -35px) rotate(-3deg); }
    75% { transform: translate(20px, -15px) rotate(4deg); }
}

@keyframes leafFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, -25px) rotate(-6deg); }
    66% { transform: translate(10px, -40px) rotate(3deg); }
}

.sunlight-patch {
    position: absolute;
    top: 5%;
    right: 0;
    width: 300px;
    height: 400px;
    background: radial-gradient(ellipse at top right, rgba(245, 158, 11, 0.1), transparent 70%);
    animation: sunlightShift 20s ease-in-out infinite;
}

@keyframes sunlightShift {
    0%, 100% { opacity: 0.6; transform: translate(0, 0); }
    50% { opacity: 1; transform: translate(-20px, 15px); }
}

.water-ripple {
    position: absolute;
    bottom: 20%;
    left: 50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px solid rgba(125, 211, 252, 0.2);
    animation: waterRipple 8s ease-out infinite;
}

@keyframes waterRipple {
    0% { transform: translate(-50%, 0) scale(0.5); opacity: 0.4; }
    100% { transform: translate(-50%, 0) scale(2.5); opacity: 0; }
}

/* ===== Glass Cards (Frutiger Aero) ===== */
.glass-card {
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.12);
    overflow: hidden;
    max-width: 520px;
    margin: 0 auto;
    transition: box-shadow 300ms ease, transform 200ms ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.18), 0 0 20px rgba(254, 215, 170, 0.15);
    transform: translateY(-2px);
}

.glass-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* ===== Typography ===== */
h2 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--slate-ink);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h3 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--slate-ink);
    margin-bottom: 0.75rem;
}

p {
    color: var(--warm-slate);
    margin-bottom: 0.5rem;
}

.logic-notation {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--clear-sky);
    display: inline-block;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.final-notation {
    display: block;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
}

/* ===== Dewdrop Elements ===== */
.dewdrop {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.8), rgba(125, 211, 252, 0.4) 50%, rgba(125, 211, 252, 0.1));
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

/* ===== Logic Sections ===== */
.logic-section {
    margin-bottom: 6rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.logic-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SVG Connectors ===== */
.connector {
    position: absolute;
    left: -60px;
    top: 50%;
    width: 60px;
    height: 40px;
    transform: translateY(-50%);
    overflow: visible;
}

.connector-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 600ms ease-out 200ms;
}

.conclusion.revealed .connector-path {
    stroke-dashoffset: 0;
}

/* ===== Synthesis Section ===== */
#synthesis {
    background: linear-gradient(135deg, var(--morning-blue) 0%, var(--spring-mint) 50%, var(--morning-blue) 100%);
    padding: 8rem 2rem;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.synthesis-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.synthesis-card {
    max-width: 700px;
    text-align: center;
}

.synthesis-card h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

/* ===== Prism Visual ===== */
.prism-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    height: 80px;
    position: relative;
}

.prism-beam {
    width: 80px;
    height: 3px;
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.prism-shape {
    width: 60px;
    height: 60px;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: linear-gradient(135deg, var(--aqua-sheen), rgba(248, 250, 252, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.prism-spectrum {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 80px;
}

.spectrum-line {
    height: 2px;
    border-radius: 1px;
}

.s1 { background: var(--clear-sky); width: 70px; }
.s2 { background: var(--leaf-green); width: 60px; }
.s3 { background: var(--amber-reason); width: 50px; }
.s4 { background: var(--sunrise-peach); width: 40px; }
.s5 { background: #E879A8; width: 30px; }

/* ===== Ripple Container ===== */
.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
    z-index: 0;
}

.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--aqua-sheen);
    opacity: 0;
    animation: rippleExpand 6s ease-out infinite;
}

.r1 { width: 100px; height: 100px; animation-delay: 0s; }
.r2 { width: 100px; height: 100px; animation-delay: 1.5s; }
.r3 { width: 100px; height: 100px; animation-delay: 3s; }
.r4 { width: 100px; height: 100px; animation-delay: 4.5s; }

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

/* ===== Aero Chrome Buttons ===== */
.aero-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), rgba(248, 250, 252, 0.3));
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: var(--clear-sky);
    cursor: pointer;
    transition: box-shadow 200ms ease, background 200ms ease;
    text-decoration: none;
}

.aero-btn:hover {
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.5));
}

.aero-btn:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .floating-leaf,
    .sunlight-patch,
    .water-ripple,
    .ripple {
        animation: none;
    }

    .logic-section {
        opacity: 1;
        transform: none;
        transition: none;
    }

    #sunrise-overlay {
        display: none;
    }

    .sunrise-title {
        animation: none;
        opacity: 1;
    }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    #split-container {
        flex-direction: column;
    }

    #panel-left,
    #panel-right {
        width: 100%;
    }

    #split-divider {
        position: relative;
        left: 0;
        width: 100%;
        height: 4px;
        transform: none;
    }

    .connector {
        display: none;
    }

    .glass-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 1.5rem;
    }

    .split-panel {
        padding: 4rem 1rem 2rem;
    }

    .logic-section {
        margin-bottom: 3rem;
    }
}
