/* ========================================
   TRANSACTOLOGY.ORG - STYLES
   ======================================== */

/* Custom Properties */
:root {
    --void-navy: #070A14;
    --city-dusk: #0F1628;
    --cyan-discharge: #00F0FF;
    --heliotrope-pulse: #E040FB;
    --volt-chartreuse: #B8FF00;
    --projected-white: #EDFAFF;
    --dim-projection: rgba(237, 250, 255, 0.55);
    --transaction-amber: #FFB830;
    --easing-enter: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-navy);
    color: var(--projected-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
}

/* Dot-Matrix Grid Underlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--cyan-discharge) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.06;
    pointer-events: none;
    z-index: 1;
}

/* Scroll Indicator Line */
.scroll-indicator {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--cyan-discharge), var(--heliotrope-pulse), var(--cyan-discharge));
    background-size: 100% 300%;
    z-index: 100;
    animation: color-cycle 12s linear infinite;
    opacity: 0.8;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 0;
    background: rgba(224, 64, 251, 0.6);
    transition: height 0.1s ease-out;
}

/* Grid Underlay Pattern */
.grid-underlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 240, 255, 0.03) 2px, rgba(0, 240, 255, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--projected-white);
}

h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    margin-bottom: 1.5rem;
    color: var(--projected-white);
}

h3 {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    margin-bottom: 0.75rem;
}

.title-main {
    position: absolute;
    bottom: 20vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90%;
    animation: title-build 3.2s ease-out forwards;
    opacity: 0;
    mix-blend-mode: difference;
}

.title-main::before {
    content: attr(data-text);
}

.subtitle {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    animation: fade-in 0.8s ease-out 0.8s forwards;
    opacity: 0;
}

/* Sections */
.act {
    position: relative;
    min-height: 90vh;
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--void-navy);
    scroll-margin-top: 0;
    z-index: 2;
}

.act-1 {
    min-height: 100vh;
    background: linear-gradient(135deg, #070A14 0%, #0B0E1A 50%, #070A14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cityscape {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.city-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.95;
}

.skyline-layer-bg, .skyline-layer-mid, .skyline-layer-fg {
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.1));
}

.window-light {
    animation: pulse-window 3s ease-in-out infinite;
    filter: drop-shadow(0 0 6px currentColor);
}

.window-light.cyan {
    fill: var(--cyan-discharge);
}

.window-light.magenta {
    fill: var(--heliotrope-pulse);
}

.flow-line {
    stroke: var(--cyan-discharge);
    stroke-width: 1.5;
    fill: none;
    opacity: 0.7;
    animation: draw-line 1.5s ease-out forwards;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.flow-line:nth-child(1) { animation-delay: 0s; }
.flow-line:nth-child(2) { animation-delay: 0.2s; stroke: var(--heliotrope-pulse); }
.flow-line:nth-child(3) { animation-delay: 0.4s; }
.flow-line:nth-child(4) { animation-delay: 0.6s; stroke: var(--heliotrope-pulse); }

/* Content Column */
.content-column {
    max-width: 640px;
    margin-left: 15%;
    position: relative;
    z-index: 3;
}

.act-2, .act-3, .act-5 {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 100px;
}

.act-2 .content-column {
    position: relative;
}

.act-3 {
    grid-template-columns: 1fr;
}

.act-3 .content-column {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
}

/* Example Blocks */
.example-block {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
    animation: fade-in-up 0.6s ease-out forwards;
    opacity: 0;
}

.example-block:nth-child(2) { animation-delay: 0.2s; }
.example-block:nth-child(3) { animation-delay: 0.4s; }
.example-block:nth-child(4) { animation-delay: 0.6s; }

.example-content {
    flex: 1;
}

.example-content h3 {
    color: var(--cyan-discharge);
    margin-bottom: 0.5rem;
}

.example-content p {
    font-size: 0.95rem;
    color: var(--dim-projection);
    line-height: 1.6;
}

.inline-viz {
    width: 150px;
    height: 80px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.2));
}

/* Right Visualization */
.right-visualization {
    flex: 1;
    margin-left: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.floating-viz {
    width: 100%;
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(224, 64, 251, 0.15));
}

.transaction-node-network circle {
    animation: node-pulse 2s ease-in-out infinite;
}

.transaction-node-network path {
    animation: flow-pulse 2s ease-in-out infinite;
    opacity: 0.4;
}

/* Holographic Panels */
.holographic-panel {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05), rgba(224, 64, 251, 0.05));
    backdrop-filter: blur(2px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 240, 255, 0.03) 2px, rgba(0, 240, 255, 0.03) 4px);
    animation: panel-enter 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.holographic-panel:nth-child(2) { animation-delay: 0.2s; }
.holographic-panel:nth-child(3) { animation-delay: 0.4s; }
.holographic-panel:nth-child(4) { animation-delay: 0.6s; }

.panel-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan-discharge);
    opacity: 0.6;
    margin-bottom: 12px;
}

.panel-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-line {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--dim-projection);
    display: flex;
    gap: 10px;
}

.data-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cyan-discharge);
    opacity: 0.6;
    min-width: 120px;
}

/* City Map Large */
.city-map-large {
    width: 100%;
    height: 500px;
    max-width: 1200px;
    margin: 40px auto;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.1));
}

.large-skyline {
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.05));
}

.flowing-transactions {
    opacity: 0.8;
}

/* Generative Section */
.generative-section {
    width: 100%;
    margin-top: 40px;
    padding-bottom: 100px;
}

.generative-item {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.03), rgba(224, 64, 251, 0.03));
    border: 1px solid rgba(0, 240, 255, 0.08);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 2px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: rgba(237, 250, 255, 0.4);
    animation: fade-in-up 0.5s ease-out forwards;
}

/* Animations */
@keyframes color-cycle {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes title-build {
    0% {
        opacity: 0;
        text-shadow: 0 0 0 var(--cyan-discharge);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 30px rgba(0, 240, 255, 0.8);
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panel-enter {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes draw-line {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.7;
    }
}

@keyframes pulse-window {
    0%, 100% {
        opacity: 0.4;
        filter: drop-shadow(0 0 3px currentColor);
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 8px currentColor);
    }
}

@keyframes node-pulse {
    0%, 100% {
        r: 4;
        opacity: 0.6;
    }
    50% {
        r: 6;
        opacity: 1;
    }
}

@keyframes flow-pulse {
    0%, 100% {
        opacity: 0.3;
        stroke-width: 1.5;
    }
    50% {
        opacity: 0.7;
        stroke-width: 2;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-column {
        margin-left: 10%;
    }
    
    .right-visualization {
        display: none;
    }
}

@media (max-width: 768px) {
    .act {
        padding: 40px 20px;
        flex-direction: column;
    }
    
    .content-column {
        max-width: 100%;
        margin-left: 0;
        width: 100%;
    }
    
    .right-visualization {
        margin-left: 0;
        margin-top: 30px;
        display: flex;
    }
    
    .example-block {
        flex-direction: column;
    }
    
    .inline-viz {
        width: 100%;
        max-width: 200px;
    }
    
    .city-map-large {
        height: 300px;
    }
}

/* Scroll-triggered animations using IntersectionObserver */
.scroll-trigger {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-trigger.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent layout shift */
img, svg {
    display: block;
}

/* Ensure proper stacking */
.act {
    position: relative;
    z-index: 2;
}
