/* ============================================
   SIMULAI.ORG - Simulation AI Command Center
   ============================================ */

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

:root {
    --command-dark: #0e1420;
    --system-blue: #3a7ae8;
    --allied-teal: #38b8a8;
    --signal-green: #4ade80;
    --briefing-gray: #8a94a4;
    --display-white: #e8ecf4;
    --glow-blue: #5a9af8;
    --glow-blue-alpha: rgba(90, 154, 248, 0.3);
    --timeline-left: 15%;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--command-dark);
    color: var(--display-white);
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* --- Floating Bubbles --- */
#bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(58, 122, 232, 0.15), transparent 70%);
    animation: bubbleRise linear infinite;
    will-change: transform;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) translateX(30px);
        opacity: 0;
    }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    opacity: 0;
    transform: scale(1.1);
    animation: heroReveal 0.8s ease-out 0.4s forwards;
}

@keyframes heroReveal {
    0% {
        opacity: 0;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1.0);
    }
}

#hero-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 120px);
    letter-spacing: 0.08em;
    color: var(--display-white);
    text-shadow: 0 0 60px rgba(58, 122, 232, 0.3), 0 0 120px rgba(58, 122, 232, 0.1);
    line-height: 1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: 'Fira Mono', monospace;
    font-size: clamp(12px, 1.5vw, 16px);
    color: var(--briefing-gray);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 1.2s forwards;
}

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 0.5s ease-out 2.5s forwards;
}

.scroll-arrow {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--system-blue);
    border-bottom: 2px solid var(--system-blue);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
    50% { transform: rotate(45deg) translateY(8px); opacity: 1; }
}

/* --- Timeline Container --- */
#timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
    z-index: 1;
}

/* Timeline Spine */
.timeline-spine {
    position: absolute;
    left: var(--timeline-left);
    top: 0;
    width: 2px;
    height: 0;
    background: var(--system-blue);
    z-index: 1;
    transition: height 0.05s linear;
}

/* --- Timeline Entry --- */
.timeline-entry {
    position: relative;
    margin-left: 20%;
    padding-left: 3rem;
    padding-bottom: 5rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-entry.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Timeline Node */
.timeline-node {
    position: absolute;
    left: calc(-5% - 6px);
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--system-blue);
    box-shadow: 0 0 4px var(--system-blue);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}

.timeline-entry.visible .timeline-node {
    opacity: 1;
    animation: nodePulse 1s ease-out forwards;
}

@keyframes nodePulse {
    0% { box-shadow: 0 0 4px var(--system-blue); }
    50% { box-shadow: 0 0 20px var(--system-blue), 0 0 40px rgba(58, 122, 232, 0.3); }
    100% { box-shadow: 0 0 8px var(--system-blue); }
}

/* Timeline Connector */
.timeline-connector {
    position: absolute;
    left: calc(-5% + 6px);
    top: 13px;
    height: 1px;
    width: 0;
    background: var(--system-blue);
    z-index: 1;
    transition: width 0.4s ease-out 0.2s;
}

.timeline-entry.visible .timeline-connector {
    width: calc(5% - 6px + 3rem);
}

/* Timeline Date */
.timeline-date {
    display: inline-block;
    font-family: 'Fira Mono', monospace;
    font-size: 14px;
    color: var(--allied-teal);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

/* Timeline Heading */
.timeline-heading {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(24px, 3vw, 36px);
    color: var(--display-white);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

/* Timeline Text */
.timeline-text {
    color: var(--display-white);
    opacity: 0.85;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

/* --- System Diagrams --- */
.diagram-container {
    margin-top: 1rem;
    max-width: 500px;
}

.system-diagram {
    width: 100%;
    height: auto;
}

.system-diagram line,
.system-diagram rect,
.system-diagram circle,
.system-diagram polygon {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.timeline-entry.visible .system-diagram line,
.timeline-entry.visible .system-diagram rect,
.timeline-entry.visible .system-diagram circle,
.timeline-entry.visible .system-diagram polygon {
    stroke-dashoffset: 0;
}

/* --- Metrics --- */
.metric-row {
    display: flex;
    gap: 2.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.metric-value {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 42px);
    color: var(--signal-green);
    line-height: 1.1;
}

.metric-label {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: var(--briefing-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* --- CTA Block --- */
.cta-block {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border: 1px solid var(--system-blue);
    background: rgba(58, 122, 232, 0.05);
}

.cta-label {
    font-family: 'Fira Mono', monospace;
    font-size: 13px;
    color: var(--briefing-gray);
    letter-spacing: 0.1em;
}

.cta-status {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--signal-green);
    letter-spacing: 0.15em;
    animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Footer --- */
#site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(58, 122, 232, 0.2);
    padding: 3rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--display-white);
    letter-spacing: 0.1em;
}

.footer-tagline {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: var(--briefing-gray);
    letter-spacing: 0.1em;
}

.footer-year {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: var(--briefing-gray);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --timeline-left: 8%;
    }

    #timeline-container {
        padding: 2rem 1rem 4rem;
    }

    .timeline-entry {
        margin-left: 15%;
        padding-left: 2rem;
        padding-bottom: 3rem;
    }

    .timeline-node {
        left: calc(-7% - 6px);
    }

    .timeline-connector {
        left: calc(-7% + 6px);
    }

    .timeline-entry.visible .timeline-connector {
        width: calc(7% - 6px + 2rem);
    }

    .metric-row {
        gap: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .timeline-entry {
        margin-left: 20%;
        padding-left: 1.5rem;
    }

    .metric-row {
        flex-direction: column;
        gap: 1rem;
    }
}
