/* ==========================================================================
   reasoner.dev -- Cyberpunk Reasoning Engine
   Palette: Void Dark #0A0A14, Sapphire #2563EB, Emerald #10B981,
            Amethyst #8B5CF6, Ruby #EF4444, Silver #C8D0D8, Obsidian #1A1A28
   Fonts: Outfit (headlines), Inter (body), JetBrains Mono (code)
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #0A0A14;
    color: #C8D0D8;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.4vw, 17px);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   HERO -- Inference Engine Opening
   ========================================================================== */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0A0A14;
    overflow: hidden;
}

.circuit-paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.circuit-path {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    opacity: 0;
}

.circuit-path.sapphire {
    stroke: #2563EB;
}

.circuit-path.emerald {
    stroke: #10B981;
}

.circuit-path.amethyst {
    stroke: #8B5CF6;
}

.circuit-path.animate {
    opacity: 0.7;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
    stroke-dashoffset: 0;
}

.circuit-node {
    opacity: 0;
    transition: opacity 0.8s ease 2s;
}

.circuit-node.visible {
    opacity: 1;
}

.sapphire-fill {
    fill: #2563EB;
}

.emerald-fill {
    fill: #10B981;
}

.amethyst-fill {
    fill: #8B5CF6;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.wordmark {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(36px, 6vw, 80px);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: #C8D0D8;
    transition: font-weight 0.8s ease;
}

.wordmark.weight-shift {
    font-variation-settings: 'wght' 600;
}

.wordmark-dot {
    color: #10B981;
}

.hero-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 400;
    color: #8B5CF6;
    letter-spacing: 0.08em;
    margin-top: 16px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.8s ease 1.5s;
}

.hero-tagline.visible {
    opacity: 0.8;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s ease 2.5s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-indicator-line {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #2563EB);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(0.6);
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* ==========================================================================
   LOGIC CHAIN STREAM
   ========================================================================== */

.logic-chain {
    position: relative;
    padding: 120px 24px;
    background-color: #0A0A14;
}

.logic-chain-inner {
    max-width: 680px;
    margin: 0 auto;
}

.logic-step {
    position: relative;
    padding-left: 32px;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.logic-step.in-view {
    opacity: 1;
    transform: translateY(0);
}

.step-border {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.logic-step.in-view .step-border {
    transform: scaleY(1);
}

.logic-step[data-color="sapphire"] .step-border {
    background-color: #2563EB;
}

.logic-step[data-color="emerald"] .step-border {
    background-color: #10B981;
}

.logic-step[data-color="amethyst"] .step-border {
    background-color: #8B5CF6;
}

.step-content {
    padding-left: 0;
}

.step-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.logic-step[data-color="sapphire"] .step-label {
    color: #2563EB;
}

.logic-step[data-color="emerald"] .step-label {
    color: #10B981;
}

.logic-step[data-color="amethyst"] .step-label {
    color: #8B5CF6;
}

.step-heading {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(24px, 3.5vw, 48px);
    font-weight: 300;
    letter-spacing: -0.01em;
    color: #C8D0D8;
    margin-bottom: 16px;
    transition: font-variation-settings 0.6s ease;
}

.logic-step.in-view .step-heading {
    font-variation-settings: 'wght' 600;
}

.step-body {
    color: #C8D0D8;
    opacity: 0.85;
    margin-bottom: 20px;
    max-width: 600px;
}

.step-code {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #10B981;
    background-color: #1A1A28;
    padding: 10px 16px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   ARCHITECTURE DIAGRAM
   ========================================================================== */

.architecture {
    position: relative;
    padding: 100px 24px;
    background-color: #0A0A14;
}

.architecture-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.architecture-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8B5CF6;
    text-align: center;
    margin-bottom: 60px;
}

.diagram-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.architecture-svg {
    width: 100%;
    height: auto;
}

.node-circle {
    fill: #0A0A14;
    stroke-width: 2;
    opacity: 0;
    transform-origin: center;
    transform: scale(0);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.architecture.in-view .node-circle {
    opacity: 1;
    transform: scale(1);
}

.sapphire-stroke {
    stroke: #2563EB;
}

.emerald-stroke {
    stroke: #10B981;
}

.amethyst-stroke {
    stroke: #8B5CF6;
}

.node-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    fill: #C8D0D8;
    text-anchor: middle;
    dominant-baseline: middle;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.5s ease 0.6s;
}

.architecture.in-view .node-text {
    opacity: 1;
}

.diagram-edge {
    stroke: #1A1A28;
    stroke-width: 1.5;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
}

.architecture.in-view .diagram-edge {
    stroke-dashoffset: 0;
    stroke: rgba(200, 208, 216, 0.15);
}

/* Vintage labels */
.leader-line {
    stroke: rgba(200, 208, 216, 0.2);
    stroke-width: 1;
    stroke-dasharray: 3 2;
}

.label-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 400;
    fill: rgba(200, 208, 216, 0.4);
    text-anchor: middle;
    letter-spacing: 0.12em;
}

.vintage-label {
    opacity: 0;
    transition: opacity 0.6s ease 1.2s;
}

.architecture.in-view .vintage-label {
    opacity: 1;
}

/* ==========================================================================
   TERMINAL FOOTER
   ========================================================================== */

.footer {
    position: relative;
    padding: 80px 24px 60px;
    background-color: #0A0A14;
}

.terminal-frame {
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1A1A28;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.terminal-frame.in-view {
    opacity: 1;
    transform: translateY(0);
}

.terminal-frame.border-animate {
    border-color: #2563EB;
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.08);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: rgba(10, 10, 20, 0.6);
    border-bottom: 1px solid rgba(200, 208, 216, 0.06);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red {
    background-color: #EF4444;
}

.terminal-dot.yellow {
    background-color: #F59E0B;
}

.terminal-dot.green {
    background-color: #10B981;
}

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(200, 208, 216, 0.4);
    margin-left: 8px;
    letter-spacing: 0.05em;
}

.terminal-body {
    padding: 20px 24px;
}

.terminal-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #C8D0D8;
    margin-bottom: 4px;
    line-height: 1.8;
}

.terminal-prompt {
    color: #10B981;
    margin-right: 8px;
}

.terminal-cmd {
    color: #C8D0D8;
}

.terminal-output {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: rgba(200, 208, 216, 0.5);
    margin-bottom: 12px;
    padding-left: 20px;
    line-height: 1.8;
}

.terminal-cursor {
    color: #2563EB;
    animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .logic-chain {
        padding: 80px 20px;
    }

    .logic-step {
        padding-left: 24px;
        margin-bottom: 60px;
    }

    .architecture {
        padding: 60px 16px;
    }

    .terminal-body {
        padding: 16px 16px;
    }

    .terminal-line,
    .terminal-output {
        font-size: 11px;
    }

    .hero-tagline {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .wordmark {
        font-size: clamp(28px, 8vw, 48px);
    }

    .step-heading {
        font-size: clamp(20px, 5vw, 32px);
    }

    .step-code {
        font-size: 12px;
        padding: 8px 12px;
    }
}
