/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #1e1e28;
    color: #c8c4d0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    overflow-x: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* === TYPOGRAPHY === */
.fira {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: #8a8a9e;
    font-feature-settings: "liga" 1;
}

h1, h2 {
    font-family: 'Instrument Serif', serif;
    color: #d4a0a8;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 3rem);
}

/* === WATERMARK === */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Instrument Serif', serif;
    font-size: 2rem;
    color: #c8c4d0;
    opacity: 0.06;
    pointer-events: none;
    z-index: 1000;
    letter-spacing: 0.1em;
}

/* === SECTIONS === */
.section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* === SPLIT GRID === */
.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
}

.split-60-40 {
    grid-template-columns: 3fr 2fr;
}

.split-40-60 {
    grid-template-columns: 2fr 3fr;
}

/* === PANELS === */
.panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 3rem);
    overflow: hidden;
}

.panel-left {
    background: #1e1e28;
}

.panel-right {
    background: #2a2435;
}

/* === SEAM === */
.seam {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        #8a8a9e 0,
        #8a8a9e 8px,
        transparent 8px,
        transparent 16px
    );
    opacity: 0.5;
    z-index: 10;
    transform: translateX(-50%);
}

.split-60-40 .seam {
    left: 60%;
}

.split-40-60 .seam {
    left: 40%;
}

/* === SHAKE ANIMATION === */
@keyframes consensusShake {
    0% { transform: translateX(-50%) translateX(0); }
    10% { transform: translateX(-50%) translateX(-3px); }
    20% { transform: translateX(-50%) translateX(3px); }
    30% { transform: translateX(-50%) translateX(-2px); }
    40% { transform: translateX(-50%) translateX(2px); }
    50% { transform: translateX(-50%) translateX(-1px); }
    60% { transform: translateX(-50%) translateX(1px); }
    100% { transform: translateX(-50%) translateX(0); }
}

.seam-shake {
    animation: consensusShake 1.5s ease-out forwards;
}

/* === WATERCOLOR WASHES === */
.wash {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 0;
}

.wash-hero-left {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(212, 160, 168, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(155, 138, 184, 0.15) 0%, transparent 50%);
    filter: url(#watercolor1);
}

.wash-hero-right {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(201, 168, 124, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 80%, rgba(212, 160, 168, 0.15) 0%, transparent 50%);
    filter: url(#watercolor2);
}

.wash-consensus-left {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(155, 138, 184, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(212, 160, 168, 0.12) 0%, transparent 50%);
    filter: url(#watercolor3);
}

.wash-consensus-right {
    background:
        radial-gradient(ellipse at 50% 60%, rgba(201, 168, 124, 0.15) 0%, transparent 55%);
    filter: url(#watercolor1);
}

.wash-fault-left {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(184, 92, 92, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 70%, rgba(155, 138, 184, 0.15) 0%, transparent 55%);
    filter: url(#watercolor4);
}

.wash-fault-right {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(212, 160, 168, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 20%, rgba(201, 168, 124, 0.12) 0%, transparent 50%);
    filter: url(#watercolor2);
}

.wash-mesh {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(155, 138, 184, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(212, 160, 168, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(201, 168, 124, 0.1) 0%, transparent 60%);
    filter: url(#watercolor3);
}

.wash-fork-1 {
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 160, 168, 0.2) 0%, transparent 60%);
    filter: url(#watercolor1);
}

.wash-fork-2 {
    background: radial-gradient(ellipse at 50% 50%, rgba(155, 138, 184, 0.2) 0%, transparent 60%);
    filter: url(#watercolor2);
}

.wash-fork-3 {
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 124, 0.18) 0%, transparent 60%);
    filter: url(#watercolor4);
}

/* === HERO === */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    max-width: 90%;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 1.1;
    margin-bottom: 0.5em;
    font-variation-settings: 'wght' 400;
    transition: font-variation-settings 0.3s ease;
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #c8c4d0;
    margin-bottom: 1em;
    opacity: 0.85;
}

.hero-protocol {
    display: inline-block;
    margin-top: 0.5em;
    padding: 0.3em 0.8em;
    border: 1px dashed #8a8a9e;
    border-radius: 2px;
}

/* === PROTOCOL SECTIONS === */
.panel-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.section-label {
    display: block;
    margin-bottom: 1.5em;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.section-heading {
    margin-bottom: 0.8em;
}

.section-body {
    margin-bottom: 1.2em;
    color: #c8c4d0;
    opacity: 0.9;
}

.concept-visual {
    position: relative;
    z-index: 2;
    width: 80%;
    max-width: 400px;
}

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

.concept-line {
    animation: dashFlow 3s linear infinite;
}

.failed-node {
    stroke: #b85c5c;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -20; }
}

/* === MESH SECTION === */
.section-mesh {
    background: #1e1e28;
}

.mesh-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 3rem);
}

.mesh-label {
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1em;
}

.mesh-heading {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 1.5em;
}

.mesh-svg {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1000px;
    height: auto;
}

.mesh-edge {
    stroke: #9b8ab8;
    stroke-width: 1;
    stroke-dasharray: 6 4;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 3s ease;
}

.mesh-edge.animate {
    stroke-dashoffset: 0;
}

.mesh-node {
    stroke: #8a8a9e;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 4px rgba(201, 168, 124, 0.3));
    transition: transform 0.4s ease;
    transform-origin: center;
}

/* === FORK SECTION === */
.section-fork {
    position: relative;
}

.fork-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 100vh;
}

.fork-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fork-panel-1 { background: #1e1e28; }
.fork-panel-2 { background: #2a2435; }
.fork-panel-3 { background: #1e1e28; }

.fork-word {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2rem, 5vw, 5rem);
    color: #d4a0a8;
    position: relative;
    z-index: 2;
    cursor: default;
    transition: font-variation-settings 0.4s ease;
}

.fork-word:hover {
    font-variation-settings: 'wght' 900 !important;
    color: #c9a87c;
}

.fork-seam {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        #8a8a9e 0,
        #8a8a9e 8px,
        transparent 8px,
        transparent 16px
    );
    opacity: 0.4;
    z-index: 10;
}

.fork-seam-1 { left: 33.333%; }
.fork-seam-2 { left: 66.666%; }

/* === SPARKLE DOTS === */
.sparkle-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #c9a87c;
    opacity: 0.12;
    animation: sparkle 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sparkle {
    0%, 90%, 100% { opacity: 0.12; }
    95% { opacity: 0.6; }
}

/* === METALLIC HOVER === */
.metallic-hover {
    background: linear-gradient(135deg, #c9a87c, #8a8a9e, #c9a87c);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: metallicShift 3s ease infinite;
}

@keyframes metallicShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === SEAM PULSE === */
@keyframes seamPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.section-protocol .seam {
    animation: seamPulse 3s ease-in-out infinite;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .split-grid,
    .split-60-40,
    .split-40-60 {
        grid-template-columns: 1fr;
    }

    .seam {
        left: 0 !important;
        top: auto;
        bottom: 0;
        width: 100% !important;
        height: 2px !important;
        background: repeating-linear-gradient(
            to right,
            #8a8a9e 0,
            #8a8a9e 8px,
            transparent 8px,
            transparent 16px
        );
    }

    .panel {
        min-height: 50vh;
    }

    .fork-grid {
        grid-template-columns: 1fr;
    }

    .fork-panel {
        min-height: 33.33vh;
    }

    .fork-seam {
        display: none;
    }

    .concept-visual {
        width: 60%;
    }
}
