/* ============================================
   simulai.xyz - Scandinavian + Neon Electric
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    color: #2C2E33;
    background-color: #F7F5F0;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* --- Typography --- */
.identity-title,
.card-title,
.node-label,
.signal-statement {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.body-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.75;
}

.body-text.emphasis {
    font-weight: 500;
}

.body-text.inverted {
    color: #E8E6E1;
}

.identity-subtitle,
.metadata-label,
.signal-coordinate,
.section-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Marble Base Layer --- */
.marble-base {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 30%, #E8E6E1 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, #B8B4AC 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, #E8E6E1 0%, transparent 45%),
        radial-gradient(ellipse at 80% 20%, #B8B4AC 0%, transparent 35%),
        conic-gradient(from 45deg at 30% 50%, #F7F5F0 0deg, #E8E6E1 90deg, #F7F5F0 180deg, #B8B4AC 270deg, #F7F5F0 360deg),
        radial-gradient(ellipse at 60% 40%, #F7F5F0 0%, #E8E6E1 100%);
    background-size: 200% 200%;
    animation: marbleDrift 60s linear infinite;
    opacity: 0.7;
}

@keyframes marbleDrift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100px 100px; }
    100% { background-position: 200px 0%; }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: fixed;
    top: 0;
    right: 0;
    width: 2px;
    height: 0%;
    background: linear-gradient(180deg, #00FF88, #00D4FF);
    z-index: 1000;
    transition: height 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

/* --- Section Labels --- */
.section-labels {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-label {
    color: #B8B4AC;
    transition: color 0.4s ease, text-shadow 0.4s ease;
    display: block;
}

.section-label.active {
    color: #00FF88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* --- Strata General --- */
.stratum {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* --- Connective Tissue --- */
.connective-tissue {
    position: relative;
    height: 200px;
    z-index: 1;
    overflow: hidden;
}

.circuit-trace {
    width: 100%;
    height: 100%;
}

.trace-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease;
}

.trace-path.animated {
    stroke-dashoffset: 0;
}

/* --- Stratum 1: Identity --- */
.stratum-identity {
    background: transparent;
}

.stratum-identity .stratum-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.identity-title {
    font-size: clamp(4rem, 12vw, 10rem);
    color: #2C2E33;
    text-shadow: 0 0 1px #00FF88, 0 0 2px rgba(0, 255, 136, 0.4);
    animation: titlePulse 3s ease-in-out infinite;
    line-height: 1.1;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow: 0 0 1px #00FF88, 0 0 2px rgba(0, 255, 136, 0.2);
    }
    50% {
        text-shadow: 0 0 2px #00FF88, 0 0 8px rgba(0, 255, 136, 0.5);
    }
}

.identity-subtitle {
    color: #00FF88;
    margin-top: 24px;
    display: block;
}

/* --- Stratum 2: Concept --- */
.stratum-concept {
    display: flex;
    align-items: stretch;
    padding: 0;
}

.concept-left {
    flex: 1;
    background:
        radial-gradient(ellipse at 30% 40%, #2C2E33 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, #1A1C20 0%, transparent 50%),
        #1A1C20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    min-height: 100vh;
}

.concept-circle {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rotating-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: slowRotate 720s linear infinite;
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.concept-circle-text {
    padding: 48px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.concept-circle-text p {
    margin-bottom: 12px;
}

.concept-right {
    flex: 1;
    background: #1A1C20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    min-height: 100vh;
}

.vertical-trace {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 2px;
    transform: translateX(-50%);
}

.trace-cyan-vertical {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 3s ease;
}

.trace-cyan-vertical.animated {
    stroke-dashoffset: 0;
}

.concept-metadata {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 2;
}

.metadata-label {
    color: #00D4FF;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.metadata-label.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Stratum 3: Capabilities --- */
.stratum-capabilities {
    padding: 96px 48px;
    background: transparent;
}

.capabilities-grid {
    display: flex;
    gap: 48px;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.capability-card {
    background:
        radial-gradient(ellipse at 30% 30%, #E8E6E1 0%, transparent 50%),
        #F7F5F0;
    padding: 48px 36px;
    flex: 1;
    min-width: 280px;
    max-width: 340px;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border 0.3s ease;
    border: 1px solid transparent;
    border-bottom: 1px solid #00FF88;
}

.capability-card.card-depth-2 {
    margin-top: 48px;
    border-bottom-color: #00D4FF;
}

.capability-card.card-depth-3 {
    margin-top: 96px;
    border-bottom-color: #FF00AA;
}

.capability-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.capability-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 4px 24px rgba(0, 255, 136, 0.12);
    border: 1px solid #00FF88;
}

.capability-card.card-depth-2:hover {
    box-shadow: 0 4px 24px rgba(0, 212, 255, 0.12);
    border-color: #00D4FF;
}

.capability-card.card-depth-3:hover {
    box-shadow: 0 4px 24px rgba(255, 0, 170, 0.12);
    border-color: #FF00AA;
}

.card-icon {
    margin-bottom: 24px;
}

.card-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    color: #2C2E33;
    margin-bottom: 12px;
}

.card-description {
    color: #2C2E33;
}

/* --- Stratum 4: Process --- */
.stratum-process {
    overflow: hidden;
    background:
        linear-gradient(180deg, #F7F5F0 0%, #E8E6E1 30%, #B8B4AC 60%, #2C2E33 80%, #1A1C20 100%);
    padding: 0;
}

.process-geological {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.timeline-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.timeline-track {
    display: flex;
    gap: 0;
    width: max-content;
    padding: 0 calc(50vw - 150px);
    position: relative;
    transition: transform 0.1s linear;
}

.timeline-line {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #00FF88, #00D4FF);
    z-index: 0;
}

.timeline-node {
    flex: 0 0 300px;
    text-align: center;
    position: relative;
    padding: 0 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.node-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #00FF88;
    margin: 0 auto 24px;
    position: relative;
    background: rgba(0, 255, 136, 0.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
}

.node-label {
    font-size: clamp(1.125rem, 1.8vw, 1.375rem);
    color: #E8E6E1;
    margin-bottom: 12px;
    display: block;
}

.node-description {
    color: #E8E6E1;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* --- Stratum 5: Signal --- */
.stratum-signal {
    background: transparent;
    position: relative;
    overflow: hidden;
}

.stratum-signal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(0, 255, 136, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 70%, rgba(0, 212, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(255, 0, 170, 0.03) 0%, transparent 50%);
    animation: signalPulse 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes signalPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    33% {
        opacity: 0.9;
        transform: scale(1.02);
    }
    66% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

.signal-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.signal-statement {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    color: #2C2E33;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
    margin-bottom: 48px;
    line-height: 1.2;
}

.signal-coordinate {
    color: #00FF88;
    animation: coordinateBlink 2s step-end infinite;
}

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

/* --- Decorative Circles --- */
.decorative-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    opacity: 0.06;
}

.deco-circle-1 {
    width: 320px;
    height: 320px;
    border-color: #00FF88;
    top: 15%;
    right: -60px;
}

.deco-circle-2 {
    width: 180px;
    height: 180px;
    border-color: #00D4FF;
    top: 45%;
    left: -40px;
}

.deco-circle-3 {
    width: 240px;
    height: 240px;
    border-color: #FF00AA;
    bottom: 10%;
    right: 15%;
}

/* --- Grid Dot Pattern --- */
.stratum-identity::after,
.stratum-capabilities::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #E8E6E1 1.5px, transparent 1.5px);
    background-size: 48px 48px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

/* --- Triangle Watermarks --- */
.stratum-capabilities::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    border-bottom: 346px solid #B8B4AC;
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .stratum-concept {
        flex-direction: column;
    }

    .concept-left,
    .concept-right {
        min-height: 50vh;
    }

    .capabilities-grid {
        flex-direction: column;
        align-items: center;
    }

    .capability-card.card-depth-2,
    .capability-card.card-depth-3 {
        margin-top: 0;
    }

    .section-labels {
        display: none;
    }

    .timeline-track {
        padding: 0 24px;
    }

    .timeline-node {
        flex: 0 0 240px;
    }
}

@media (max-width: 600px) {
    .identity-title {
        font-size: clamp(2.5rem, 14vw, 5rem);
    }

    .signal-statement {
        font-size: clamp(1.75rem, 8vw, 3rem);
    }

    .concept-circle {
        width: 240px;
        height: 240px;
    }

    .concept-circle-text {
        padding: 24px;
    }

    .capability-card {
        min-width: auto;
        width: 100%;
    }
}
