/* ============================================
   transactology.com — Design System
   Dark-mode HUD Observatory
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --void-black: #080b12;
    --surface-navy: #0d1428;
    --surface-midnight: #111e3d;
    --sapphire: #3a6fd8;
    --amber: #d87c3a;
    --teal: #3ad8b4;
    --text-primary: #e8eef8;
    --text-secondary: #7a9abf;
    --glass-border: rgba(255, 255, 255, 0.2);
    --glow-blue: rgba(58, 111, 216, 0.25);
    --elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --panel-bg: rgba(13, 20, 40, 0.7);
    --panel-bg-opaque: rgba(13, 20, 40, 0.85);
}

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

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

body {
    background: var(--void-black);
    color: var(--text-primary);
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Canvas Background (Layer 0) ---------- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ---------- Navigation (Layer 3) ---------- */
#mainNav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 30;
    transition: backdrop-filter 0.3s ease, background 0.3s ease;
    background: transparent;
}

#mainNav.scrolled {
    background: rgba(8, 11, 18, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.nav-wordmark {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-wordmark .dot {
    color: var(--sapphire);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-link {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    transition: color 0.3s var(--elastic), transform 0.3s var(--elastic);
}

.nav-link:hover {
    color: var(--text-primary);
    transform: scale(1.02);
}

.nav-divider {
    width: 1px;
    height: 16px;
    background: var(--glass-border);
}

/* ---------- Sections ---------- */
.section {
    min-height: 100vh;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 32px;
}

.section-hero {
    padding-top: 48px;
}

.section-methodology,
.section-networks,
.section-archive {
    gap: 32px;
    flex-wrap: wrap;
}

/* ---------- Panels ---------- */
.panel {
    position: relative;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s var(--elastic);
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-hero {
    background: var(--panel-bg-opaque);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 800px;
    width: 100%;
    padding: 0;
}

.panel-content {
    background: var(--panel-bg-opaque);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex: 1 1 400px;
    max-width: 700px;
}

.panel-viz {
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex: 1 1 350px;
    max-width: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

/* Panels inner content */
.panel > .panel-content {
    padding: 48px;
    position: relative;
    z-index: 2;
}

/* ---------- Corner Brackets ---------- */
.corner-bracket {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 3;
}

.corner-bracket::before,
.corner-bracket::after {
    content: '';
    position: absolute;
    background: var(--sapphire);
}

.top-left { top: 8px; left: 8px; }
.top-left::before { width: 20px; height: 1px; top: 0; left: 0; }
.top-left::after { width: 1px; height: 20px; top: 0; left: 0; }

.top-right { top: 8px; right: 8px; }
.top-right::before { width: 20px; height: 1px; top: 0; right: 0; }
.top-right::after { width: 1px; height: 20px; top: 0; right: 0; }

.bottom-left { bottom: 8px; left: 8px; }
.bottom-left::before { width: 20px; height: 1px; bottom: 0; left: 0; }
.bottom-left::after { width: 1px; height: 20px; bottom: 0; left: 0; }

.bottom-right { bottom: 8px; right: 8px; }
.bottom-right::before { width: 20px; height: 1px; bottom: 0; right: 0; }
.bottom-right::after { width: 1px; height: 20px; bottom: 0; right: 0; }

/* ---------- Scan Lines ---------- */
.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 4px,
        rgba(255, 255, 255, 0.03) 4px,
        rgba(255, 255, 255, 0.03) 6px
    );
    pointer-events: none;
    z-index: 1;
}

/* ---------- Typography ---------- */
h1 {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 20px;
}

h2 {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.label-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--sapphire);
    margin-bottom: 16px;
    line-height: 1.4;
}

.hero-subtitle {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 560px;
    margin-bottom: 40px;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ---------- HUD Readout ---------- */
.hud-readout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

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

.readout-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.readout-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 32px;
    font-weight: 400;
    color: var(--teal);
    letter-spacing: 0.05em;
}

/* ---------- Method List ---------- */
.method-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.method-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.diamond-marker {
    width: 10px;
    height: 10px;
    min-width: 10px;
    background: var(--amber);
    transform: rotate(45deg);
    margin-top: 6px;
}

.method-title {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.method-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ---------- SVG Flow Diagram ---------- */
.viz-content {
    width: 100%;
    padding: 24px;
}

.flow-diagram, .network-diagram, .data-structure {
    width: 100%;
    height: auto;
}

.flow-node {
    fill: none;
    stroke-width: 1.5px;
}

.node-1, .node-4 {
    stroke: var(--sapphire);
}

.node-2 {
    stroke: var(--teal);
}

.node-3 {
    stroke: var(--amber);
}

.flow-line {
    fill: none;
    stroke: var(--sapphire);
    stroke-width: 1.5px;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s ease;
}

.panel.visible .flow-line {
    stroke-dashoffset: 0;
}

.flow-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    fill: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ---------- Network Diagram ---------- */
.net-line {
    stroke: var(--sapphire);
    stroke-width: 1px;
    opacity: 0.4;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}

.net-cross {
    stroke: var(--amber);
    opacity: 0.3;
    stroke-dasharray: 1 4;
}

.panel.visible .net-line {
    stroke-dashoffset: 0;
}

.net-node {
    fill: none;
    stroke-width: 1.5px;
}

.net-root {
    stroke: var(--sapphire);
    fill: rgba(58, 111, 216, 0.15);
}

.net-mid {
    stroke: var(--teal);
    fill: rgba(58, 216, 180, 0.1);
}

.net-leaf {
    stroke: var(--amber);
    fill: rgba(216, 124, 58, 0.1);
}

.net-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    fill: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ---------- Network Stats / Progress Rings ---------- */
.network-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-ring {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-ring {
    width: 64px;
    height: 64px;
}

.ring-bg {
    fill: none;
    stroke: var(--surface-midnight);
    stroke-width: 4;
    stroke-dasharray: 4 4;
}

.ring-fill {
    fill: none;
    stroke: var(--sapphire);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1.5s var(--elastic);
}

.stat-ring:nth-child(2) .ring-fill {
    stroke: var(--teal);
}

.stat-ring:nth-child(3) .ring-fill {
    stroke: var(--amber);
}

.stat-ring-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    color: var(--text-primary);
    display: block;
}

.stat-ring-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

/* ---------- Archive Entries ---------- */
.archive-entries {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-entry {
    display: grid;
    grid-template-columns: 100px 120px 1fr auto;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    align-items: center;
}

.archive-entry:last-child {
    border-bottom: none;
}

.entry-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--sapphire);
    letter-spacing: 0.05em;
}

.entry-type {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.entry-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.entry-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 2px;
}

.status-complete {
    color: var(--teal);
    background: rgba(58, 216, 180, 0.1);
    border: 1px solid rgba(58, 216, 180, 0.2);
}

.status-pending {
    color: var(--amber);
    background: rgba(216, 124, 58, 0.1);
    border: 1px solid rgba(216, 124, 58, 0.2);
}

.status-active {
    color: var(--sapphire);
    background: rgba(58, 111, 216, 0.1);
    border: 1px solid rgba(58, 111, 216, 0.2);
}

/* ---------- Data Structure SVG ---------- */
.struct-layer {
    fill: none;
    stroke-width: 1.5px;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease;
}

.layer-1 { stroke: var(--sapphire); }
.layer-2 { stroke: var(--teal); }
.layer-3 { stroke: var(--amber); }
.layer-4 { stroke: var(--sapphire); }

.panel.visible .struct-layer {
    stroke-dashoffset: 0;
}

.struct-connector {
    stroke: var(--glass-border);
    stroke-width: 1px;
    stroke-dasharray: 4 4;
}

.struct-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    fill: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ---------- Hex Grid ---------- */
.hex-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15z' fill='none' stroke='%233a6fd8' stroke-width='0.5'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ---------- Footer ---------- */
#footer {
    position: relative;
    z-index: 20;
    border-top: 1px solid var(--glass-border);
    background: rgba(8, 11, 18, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-wordmark {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-wordmark .dot {
    color: var(--sapphire);
}

.footer-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--teal);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .section-methodology,
    .section-networks,
    .section-archive {
        flex-direction: column;
        align-items: center;
    }

    .panel-content,
    .panel-viz {
        max-width: 100%;
        flex: 1 1 auto;
    }

    .archive-entry {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .entry-timestamp {
        grid-column: 1 / -1;
    }

    .hud-readout {
        gap: 24px;
    }

    .network-stats {
        flex-direction: column;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 60px 16px;
    }

    .panel > .panel-content {
        padding: 32px 24px;
    }

    .hud-readout {
        flex-direction: column;
        gap: 16px;
    }

    .readout-value {
        font-size: 24px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
