/* ============================================================
   transactology.net — Glassmorphism + Translucent-Frost
   Palette: #0F2027 / #203A43 / #2C5364 / #4AEADC / #FFFFFF
   Type: DM Sans + DM Mono
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "DM Sans", "Inter", system-ui, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    background-color: #0F2027;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ----- Animated Gradient Mesh Background ------------------ */

.gradient-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
}

.mesh-layer {
    position: absolute;
    inset: -25%;
    width: 150%;
    height: 150%;
    pointer-events: none;
    will-change: transform, background-position;
}

.mesh-layer-1 {
    background: radial-gradient(circle at 20% 30%, rgba(74, 234, 220, 0.22) 0%, rgba(74, 234, 220, 0) 45%);
    animation: drift1 60s ease-in-out infinite alternate;
}

.mesh-layer-2 {
    background: radial-gradient(circle at 80% 20%, rgba(44, 83, 100, 0.55) 0%, rgba(44, 83, 100, 0) 50%);
    animation: drift2 72s ease-in-out infinite alternate;
}

.mesh-layer-3 {
    background: radial-gradient(circle at 70% 75%, rgba(32, 58, 67, 0.7) 0%, rgba(32, 58, 67, 0) 55%);
    animation: drift3 84s ease-in-out infinite alternate;
}

.mesh-layer-4 {
    background: radial-gradient(circle at 30% 80%, rgba(74, 234, 220, 0.18) 0%, rgba(74, 234, 220, 0) 40%);
    animation: drift4 96s ease-in-out infinite alternate;
}

@keyframes drift1 {
    0%   { transform: translate3d(-6%, -4%, 0) scale(1.05); }
    100% { transform: translate3d(8%, 6%, 0) scale(1.18); }
}
@keyframes drift2 {
    0%   { transform: translate3d(5%, -6%, 0) scale(1); }
    100% { transform: translate3d(-7%, 8%, 0) scale(1.14); }
}
@keyframes drift3 {
    0%   { transform: translate3d(6%, 5%, 0) scale(1.1); }
    100% { transform: translate3d(-5%, -7%, 0) scale(1); }
}
@keyframes drift4 {
    0%   { transform: translate3d(-7%, 6%, 0) scale(1); }
    100% { transform: translate3d(7%, -5%, 0) scale(1.16); }
}

/* Subtle vignette to deepen frame edges */
.gradient-mesh::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(15, 32, 39, 0) 40%, rgba(15, 32, 39, 0.65) 100%);
    pointer-events: none;
}

/* ----- SVG Connection Lines Layer -------------------------- */

.connection-svg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.connection-svg line {
    stroke: rgba(74, 234, 220, 0.3);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: var(--len, 1000);
    stroke-dashoffset: var(--len, 1000);
    transition: stroke-dashoffset 800ms cubic-bezier(0.2, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px rgba(74, 234, 220, 0.35));
}

.connection-svg line.drawn {
    stroke-dashoffset: 0;
}

/* ----- Section Dot Navigation ------------------------------ */

.dot-nav {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    gap: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 8px 14px;
}

.nav-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    text-decoration: none;
    transition: border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.nav-dot:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.85);
}

.nav-dot.active {
    border-color: rgba(74, 234, 220, 0.85);
    color: #4AEADC;
    background: rgba(74, 234, 220, 0.08);
    box-shadow: 0 0 18px rgba(74, 234, 220, 0.45);
}

.dot-num {
    line-height: 1;
}

/* ----- Layout / Sections ---------------------------------- */

main {
    position: relative;
    z-index: 2;
}

.section {
    position: relative;
    padding: 96px 6vw;
    box-sizing: border-box;
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 64px;
    text-align: center;
}

.section-heading .data-label {
    display: inline-block;
    margin-bottom: 18px;
}

.section-title {
    font-family: "DM Sans", "Inter", system-ui, sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 18px;
}

.section-sub {
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

/* ----- Glass Card Base ------------------------------------ */

.glass-card {
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 32px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease, background 0.4s ease;
    opacity: 0;
    transform: scale(0.92);
    will-change: opacity, transform, backdrop-filter;
}

@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .glass-card {
        background: rgba(15, 32, 39, 0.85);
    }
}

.glass-card.entered {
    opacity: 1;
    transform: scale(1);
    transition: opacity 600ms cubic-bezier(0.2, 0, 0.2, 1),
                transform 600ms cubic-bezier(0.2, 0, 0.2, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease,
                background 0.4s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(74, 234, 220, 0.12);
    background: rgba(255, 255, 255, 0.10);
}

/* Node dots on card corners */
.node-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4AEADC;
    opacity: 0.4;
    animation: pulse 3s ease-in-out infinite;
}

.node-dot.dot-tl { top: -4px;  left: -4px; }
.node-dot.dot-tr { top: -4px;  right: -4px; animation-delay: 0.6s; }
.node-dot.dot-bl { bottom: -4px; left: -4px; animation-delay: 1.2s; }
.node-dot.dot-br { bottom: -4px; right: -4px; animation-delay: 1.8s; }

/* Standalone single dot (no class modifier) → default top-left */
.glass-card > .node-dot:not(.dot-tl):not(.dot-tr):not(.dot-bl):not(.dot-br) {
    top: -4px;
    left: -4px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.5); }
}

/* ----- Typography helpers --------------------------------- */

.data-label {
    font-family: "DM Mono", "DM Sans", monospace;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* ============================================================
   1. HUB NODE
   ============================================================ */

.section-hub {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
}

.hub-card {
    position: relative;
    width: min(70vw, 980px);
    min-height: 60vh;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 5;
    box-shadow: 0 0 50px rgba(74, 234, 220, 0.10),
                inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hub-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hub-title {
    font-family: "DM Sans", "Inter", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 5.4vw, 68px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.95);
    margin: 36px 0 20px;
}

.hub-sub {
    font-size: 18px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.75);
    max-width: 620px;
}

.hub-trace {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 36px;
}

.trace-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(74, 234, 220, 0) 0%,
        rgba(74, 234, 220, 0.6) 35%,
        rgba(74, 234, 220, 0.2) 100%);
    position: relative;
}

.trace-line::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 35%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4AEADC;
    box-shadow: 0 0 8px #4AEADC;
    transform: translateY(-50%);
    animation: traceMove 3.6s linear infinite;
}

@keyframes traceMove {
    0%   { left: -2%; opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* Corner satellite cards */
.corner-card {
    position: absolute;
    width: 200px;
    height: 200px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 3;
}

.corner-card .corner-icon {
    width: 30px;
    height: 30px;
    color: #4AEADC;
    opacity: 0.85;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-num {
    font-family: "DM Mono", "DM Sans", monospace;
    font-weight: 500;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.01em;
}

.metric-label {
    font-family: "DM Mono", "DM Sans", monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.corner-tl { top: 14vh;  left: 4vw; }
.corner-tr { top: 14vh;  right: 4vw; }
.corner-bl { bottom: 8vh; left: 4vw; }
.corner-br { bottom: 8vh; right: 4vw; }

/* ============================================================
   2. MESH LAYER (3x2 grid)
   ============================================================ */

.section-mesh {
    padding-top: 120px;
    padding-bottom: 120px;
}

.mesh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.mesh-card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-icon {
    width: 28px;
    height: 28px;
    color: #4AEADC;
    opacity: 0.9;
}

.card-title {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.3;
    color: #FFFFFF;
}

.card-body {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    flex-grow: 1;
}

.card-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* ============================================================
   3. PROTOCOL STACK (vertical pyramid)
   ============================================================ */

.section-stack {
    padding-top: 120px;
    padding-bottom: 120px;
}

.stack-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.stack-card {
    width: 100%;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.stack-card-1 { max-width: 56%; }
.stack-card-2 { max-width: 70%; }
.stack-card-3 { max-width: 84%; }
.stack-card-4 { max-width: 100%; }

.layer-tag {
    color: #4AEADC;
    opacity: 0.9;
}

.stack-title {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    font-size: 22px;
    line-height: 1.3;
    color: #FFFFFF;
    margin-top: 4px;
}

.stack-body {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

/* ============================================================
   4. ENDPOINT (dissolution)
   ============================================================ */

.section-endpoint {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding-top: 120px;
    padding-bottom: 80px;
}

.dissolve-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: min(80vw, 720px);
}

.dissolve-card {
    width: 100%;
    padding: 24px 28px;
    text-align: center;
    will-change: backdrop-filter, opacity;
}

.endpoint-text {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    font-size: clamp(22px, 3.4vw, 36px);
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
    max-width: 760px;
    letter-spacing: -0.01em;
    transition: opacity 0.6s ease, transform 0.6s ease;
    opacity: 0;
    transform: translateY(20px);
}

.endpoint-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.page-foot {
    margin-top: 80px;
    width: min(80vw, 720px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    gap: 20px;
    flex-wrap: wrap;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 960px) {
    .mesh-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .corner-card {
        width: 150px;
        height: 150px;
        padding: 16px;
    }

    .corner-tl, .corner-tr { top: 11vh; }
    .corner-bl, .corner-br { bottom: 6vh; }

    .hub-card {
        width: 86vw;
        padding: 40px 32px;
    }

    .stack-card-1 { max-width: 70%; }
    .stack-card-2 { max-width: 80%; }
    .stack-card-3 { max-width: 90%; }
    .stack-card-4 { max-width: 100%; }
}

@media (max-width: 640px) {
    .section { padding: 64px 5vw; }

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

    .corner-card {
        width: 110px;
        height: 110px;
        padding: 12px;
    }

    .corner-card .corner-icon {
        width: 22px;
        height: 22px;
    }

    .metric-num { font-size: 16px; }
    .metric-label { font-size: 9px; }

    .hub-card {
        width: 92vw;
        padding: 32px 22px;
        min-height: 70vh;
    }

    .section-title { font-size: 32px; }

    .stack-card-1, .stack-card-2, .stack-card-3, .stack-card-4 {
        max-width: 100%;
    }

    .dot-nav { top: 14px; gap: 10px; padding: 6px 10px; }
    .nav-dot { width: 24px; height: 24px; }
}
