/* ============================================
   simulai.tech — Retro-Futuristic Greenhouse
   ============================================ */

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

/* Palette:
   Background primary:  #f4f1eb
   Background sections: #faf8f4
   Text headings:       #3d3d4a
   Text body:           #5a5a6a
   Text captions:       #8e8ea0
   Accent botanical:    #7a8b6e
   Accent simulation:   #b8a9c4
   Accent warm:         #c4a088
   Accent highlight:    #d4b5b0
   Hover state:         #cbbdd6
*/

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    background-color: #f4f1eb;
    color: #5a5a6a;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    padding-bottom: 10vh;
}

/* Isometric grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(
            30deg,
            transparent,
            transparent 47px,
            rgba(122, 139, 110, 0.03) 47px,
            rgba(122, 139, 110, 0.03) 48px
        ),
        repeating-linear-gradient(
            150deg,
            transparent,
            transparent 47px,
            rgba(122, 139, 110, 0.03) 47px,
            rgba(122, 139, 110, 0.03) 48px
        );
}

/* The Stem — golden ratio position */
body::after {
    content: '';
    position: fixed;
    left: 38.2vw;
    top: 0;
    width: 1px;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(122, 139, 110, 0.4) 0%,
        rgba(184, 169, 196, 0.2) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    color: #3d3d4a;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h2 {
    font-weight: 600;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    margin-bottom: 1rem;
}

.label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8e8ea0;
    display: block;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 0.8rem;
}

p:last-child {
    margin-bottom: 0;
}

/* Panels — content containers */
.panel {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-content {
    background: #faf8f4;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    box-shadow: 0 2px 24px rgba(122, 139, 110, 0.08);
    transition: box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-content:hover {
    box-shadow: 0 4px 36px rgba(122, 139, 110, 0.14);
}

/* Left-aligned panels */
.panel-left {
    width: 55vw;
    max-width: 62vw;
    margin-left: 2vw;
    margin-top: 12vh;
}

/* Right-aligned panels */
.panel-right {
    width: 50vw;
    max-width: 62vw;
    margin-left: auto;
    margin-right: 2vw;
    margin-top: 8vh;
}

/* Hero panel special */
.hero-panel {
    margin-top: 15vh;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    color: #3d3d4a;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1rem;
    text-shadow: 0 0 8px rgba(184, 169, 196, 0.2), 0 0 20px rgba(122, 139, 110, 0.06);
}

.hero-subtitle {
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: #5a5a6a;
    max-width: 480px;
    line-height: 1.72;
}

/* Hero illustration */
.hero-illustration {
    position: fixed;
    right: 6vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0;
    animation: heroFadeIn 1200ms ease forwards, heroFloat 8s ease-in-out infinite;
    animation-delay: 0ms, 1200ms;
}

@keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(calc(-50% - 6px)); }
}

.isometric-plant {
    display: block;
}

/* Node markers */
.node-marker {
    position: absolute;
    z-index: 3;
}

.panel-left .node-marker {
    right: -3vw;
    top: 2rem;
}

.panel-right .node-marker {
    left: -3vw;
    top: 2rem;
}

.rosette {
    transform: scale(0.4);
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel.visible .rosette {
    transform: scale(1);
}

/* Connector lines from node to stem */
.node-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    height: 1px;
    background: rgba(122, 139, 110, 0.25);
    z-index: -1;
}

.panel-left .node-marker::before {
    left: 100%;
    width: calc(38.2vw - 55vw - 2vw + 3vw);
    /* This needs JS to calculate correctly, use a reasonable width */
    width: 10vw;
}

.panel-right .node-marker::before {
    right: 100%;
    width: 10vw;
}

/* Divider illustration */
.divider-illustration {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    margin: 6vh 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.divider-illustration.visible {
    opacity: 0.6;
    transform: translateY(0);
}

/* Text links */
.text-link {
    color: #7a8b6e;
    text-decoration: none;
    position: relative;
    font-weight: 500;
}

.text-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #7a8b6e;
    transition: width 300ms ease;
}

.text-link:hover::after {
    width: 100%;
}

.text-link:hover {
    color: #cbbdd6;
}

/* Progress pill */
.progress-pill {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 6px;
    border-radius: 3px;
    background: rgba(122, 139, 110, 0.15);
    z-index: 100;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #b8a9c4;
    border-radius: 3px;
    transition: width 100ms linear;
}

/* Simulation particle dots */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

@keyframes drift1 { 0%,100%{transform:translate(0,0)}25%{transform:translate(8px,-6px)}50%{transform:translate(-4px,-12px)}75%{transform:translate(-10px,2px)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0)}25%{transform:translate(-6px,10px)}50%{transform:translate(5px,5px)}75%{transform:translate(12px,-4px)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0)}25%{transform:translate(10px,4px)}50%{transform:translate(-8px,8px)}75%{transform:translate(-3px,-10px)} }
@keyframes drift4 { 0%,100%{transform:translate(0,0)}25%{transform:translate(-5px,-8px)}50%{transform:translate(12px,3px)}75%{transform:translate(6px,10px)} }
@keyframes drift5 { 0%,100%{transform:translate(0,0)}25%{transform:translate(4px,12px)}50%{transform:translate(-10px,-6px)}75%{transform:translate(8px,-3px)} }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .panel {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-illustration {
        animation: heroFadeIn 0ms ease forwards;
    }
    .particle {
        animation: none !important;
    }
    .rosette {
        transform: scale(1);
        transition: none;
    }
    .divider-illustration {
        opacity: 0.6;
        transform: none;
        transition: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .panel-left, .panel-right {
        width: 88vw;
        max-width: 88vw;
        margin-left: 6vw;
        margin-right: 6vw;
    }

    .panel-content {
        padding: 1.8rem 1.5rem;
    }

    .hero-illustration {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        display: flex;
        justify-content: center;
        margin: 4vh 0;
        animation: heroFadeIn 1200ms ease forwards;
    }

    .isometric-plant {
        width: 200px;
        height: auto;
    }

    body::after {
        display: none;
    }

    .node-marker {
        display: none;
    }

    .hero-panel {
        margin-top: 8vh;
    }

    .panel-left, .panel-right {
        margin-top: 6vh;
    }
}
