/* ncbd.dev - Not Centralized, But Distributed */
/* Palette: Sunset Ember #E8734A, Aged Parchment #F5E6D0, Blueprint Dusk #5B4A3F,
   Faded Vermilion #C94B2E, Warm Linen #FDF8F0, Carbon Ink #2B2420, Amber Glow #F4A926 */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #FDF8F0;
    color: #5B4A3F;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* Grid paper background */
.grid-paper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, #E8D5C0 1px, transparent 1px),
        linear-gradient(to bottom, #E8D5C0 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.08;
}

/* Hero Section - The Broken Center */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.corner-letter {
    position: absolute;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 96px;
    color: #E8734A;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.corner-letter.top-left {
    top: 8vh;
    left: 8vw;
}

.corner-letter.top-right {
    top: 8vh;
    right: 8vw;
}

.corner-letter.bottom-left {
    bottom: 8vh;
    left: 8vw;
}

.corner-letter.bottom-right {
    bottom: 8vh;
    right: 8vw;
}

.dev-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #5B4A3F;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.star-topology {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: -1;
}

.star-topology.visible {
    opacity: 0.3;
}

.strike-line {
    stroke-dasharray: 85;
    stroke-dashoffset: 85;
    transition: stroke-dashoffset 0.8s ease;
}

.strike-line.drawn {
    stroke-dashoffset: 0;
}

/* Timeline Spine */
.timeline-spine {
    position: absolute;
    top: 100vh;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    z-index: 1;
    pointer-events: none;
}

.spine-svg {
    width: 2px;
    height: 100%;
    overflow: visible;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 20px 120px;
    z-index: 2;
}

/* Timeline Nodes */
.timeline-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-node.right {
    flex-direction: row-reverse;
    transform: translateX(40px);
}

.timeline-node.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Node Indicator */
.node-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: transparent;
    border: 2px solid #E8734A;
    z-index: 3;
    transition: background-color 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.node-indicator.active {
    background-color: #E8734A;
}

/* Connector Line */
.connector-line {
    position: absolute;
    top: 6px;
    width: calc(50% - 60px - 8px);
    height: 4px;
}

.timeline-node.left .connector-line {
    left: calc(50% + 8px);
}

.timeline-node.right .connector-line {
    right: calc(50% + 8px);
}

.connector-line svg {
    width: 100%;
    height: 4px;
}

/* Node Cards */
.node-card {
    width: calc(50% - 60px);
    padding: 28px 24px;
    background-color: #F5E6D0;
    border: 2px solid #E8734A;
    position: relative;
}

.timeline-node.right .node-card {
    border-color: #5B4A3F;
}

.card-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 3.5rem);
    color: #2B2420;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    line-height: 1.1;
}

.card-body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    color: #5B4A3F;
    margin-bottom: 16px;
}

.node-id {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #5B4A3F;
    opacity: 0.5;
}

/* Stamp Overlay */
.stamp-overlay {
    position: absolute;
    top: -10px;
    right: 12px;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #C94B2E;
    border: 2px solid #C94B2E;
    padding: 2px 10px;
    opacity: 0.15;
    transform: rotate(-3deg);
}

/* Network Diagrams */
.network-diagram {
    display: flex;
    justify-content: center;
    margin: 40px auto 60px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.network-diagram.revealed {
    opacity: 1;
}

.diagram-svg {
    width: 240px;
    height: 180px;
}

.draw-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}

.network-diagram.revealed .draw-path {
    stroke-dashoffset: 0;
}

/* Mesh Vision Section */
.mesh-vision {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    z-index: 2;
}

.mesh-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.mesh-svg.visible {
    opacity: 1;
}

.mesh-node {
    opacity: 0;
    transition: opacity 0.4s ease, fill 0.3s ease;
}

.mesh-node.active {
    opacity: 1;
    fill: #F4A926;
}

.mesh-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 0.5s ease;
}

.mesh-line.drawn {
    stroke-dashoffset: 0;
}

/* Final Stamp */
.final-stamp {
    margin-top: 60px;
    opacity: 0;
    transform: rotate(3deg);
    transition: opacity 0.8s ease;
}

.final-stamp.visible {
    opacity: 1;
}

.stamp-border {
    border: 3px solid #C94B2E;
    padding: 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stamp-text-top,
.stamp-text-bottom {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #C94B2E;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-shadow: 0.5px 0px 0 #C94B2E;
}

/* Cross-reference threads */
.cross-threads {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .corner-letter {
        font-size: 56px;
    }

    .timeline-container {
        padding: 40px 16px 80px;
    }

    .timeline-node {
        flex-direction: column;
        align-items: flex-start;
        transform: translateX(-20px);
        margin-bottom: 60px;
    }

    .timeline-node.right {
        flex-direction: column;
        align-items: flex-end;
        transform: translateX(20px);
    }

    .timeline-node.revealed {
        transform: translateX(0);
    }

    .node-indicator {
        left: 16px;
        transform: none;
    }

    .connector-line {
        display: none;
    }

    .node-card {
        width: calc(100% - 40px);
        margin-left: 40px;
    }

    .timeline-node.right .node-card {
        margin-left: 0;
        margin-right: 40px;
    }

    .timeline-spine {
        left: 24px;
        transform: none;
    }

    .mesh-svg {
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .corner-letter {
        font-size: 40px;
    }

    .node-card {
        padding: 20px 16px;
        width: calc(100% - 32px);
        margin-left: 32px;
    }

    .timeline-node.right .node-card {
        margin-right: 0;
        margin-left: 32px;
    }

    .card-title {
        font-size: 1.5rem;
    }
}
