/* ========================================
   LAYER-2.ID - Identity Verification Terminal
   Color Palette:
     Void:             #0A0E1A
     Deep Panel:       #0E1A40
     Electric Blue:    #2E86DE
     Ice White:        #E8F4FD
     Sky Muted:        #A8C8E8
     Alert Orange:     #FF6B35
     Verification Green:#27AE60
     Grid Faint:       #1A2A4E
   ======================================== */

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

::selection {
    background: #2E86DE;
    color: #0A0E1A;
}

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

body {
    background: #0A0E1A;
    color: #A8C8E8;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---- Isometric Grid Background ---- */
#grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0;
    animation: gridPulse 12s ease-in-out infinite;
}

#grid-background.active {
    animation: gridFadeIn 800ms ease-out forwards, gridPulse 12s ease-in-out 800ms infinite;
}

@keyframes gridFadeIn {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

#iso-grid {
    width: 100%;
    height: 100%;
}

.grid-line {
    stroke: #1A2A4E;
    stroke-width: 0.5;
    fill: none;
}

/* ---- Scan Line ---- */
#scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(46, 134, 222, 0.2) 20%, rgba(46, 134, 222, 0.35) 50%, rgba(46, 134, 222, 0.2) 80%, transparent);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    animation: scanDescend 8s linear infinite;
}

#scan-line.active {
    opacity: 1;
}

@keyframes scanDescend {
    0% { top: 0; }
    100% { top: 100vh; }
}

/* ---- HUD Frame ---- */
#hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 90;
    pointer-events: none;
}

.hud-line {
    stroke: rgba(46, 134, 222, 0.4);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.hud-line.animate {
    animation: drawHudLine 1.2s ease-out forwards;
}

.hud-line-top.animate { animation-delay: 0ms; }
.hud-line-right.animate { animation-delay: 150ms; }
.hud-line-bottom.animate { animation-delay: 300ms; }
.hud-line-left.animate { animation-delay: 450ms; }

@keyframes drawHudLine {
    to { stroke-dashoffset: 0; }
}

.hud-corner {
    stroke: #2E86DE;
    stroke-width: 2;
    fill: none;
    opacity: 0;
}

.hud-corner.animate {
    animation: cornerFadeIn 400ms ease-out forwards, cornerPulse 8s ease-in-out 2s infinite;
}

.hud-corner-tl.animate { animation-delay: 0ms, 2000ms; }
.hud-corner-tr.animate { animation-delay: 100ms, 2100ms; }
.hud-corner-br.animate { animation-delay: 200ms, 2200ms; }
.hud-corner-bl.animate { animation-delay: 300ms, 2300ms; }

@keyframes cornerFadeIn {
    from { opacity: 0; }
    to { opacity: 0.8; }
}

@keyframes cornerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ---- Boot Sequence Overlay ---- */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0A0E1A;
    transition: opacity 600ms ease-out;
}

#boot-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#boot-overlay.hidden {
    display: none;
}

#boot-content {
    text-align: center;
}

#boot-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: #E8F4FD;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    min-height: 1.2em;
    position: relative;
}

#boot-title::after {
    content: '|';
    animation: cursorBlink 600ms step-end infinite;
    color: #2E86DE;
    font-weight: 300;
    margin-left: 2px;
}

#boot-title.done::after {
    display: none;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#boot-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #A8C8E8;
    letter-spacing: 0.08em;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 600ms ease-out;
}

#boot-subtitle.visible {
    opacity: 1;
}

/* ---- Main Content ---- */
#main-content {
    position: relative;
    z-index: 10;
    padding: 0;
    opacity: 0;
    transition: opacity 800ms ease-out;
}

#main-content.visible {
    opacity: 1;
}

/* ---- HUD Sections ---- */
.hud-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 60px;
}

/* ---- Hash Watermarks ---- */
.hash-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    font-size: 8vw;
    color: #0E1A40;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    animation: watermarkRotate 720s linear infinite;
}

@keyframes watermarkRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---- Panels ---- */
.panel {
    position: relative;
    background: rgba(14, 26, 64, 0.45);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(46, 134, 222, 0.3);
    border-radius: 2px;
    box-shadow: 0 0 30px rgba(46, 134, 222, 0.08);
    padding: 40px;
    z-index: 1;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.panel:hover {
    border-color: rgba(46, 134, 222, 0.6);
    box-shadow: 0 0 50px rgba(46, 134, 222, 0.15);
}

/* ---- Panel Bracket Decorations ---- */
.panel-brackets {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.bracket {
    position: absolute;
    width: 10px;
    height: 10px;
}

.bracket::before,
.bracket::after {
    content: '';
    position: absolute;
    background: #2E86DE;
}

.bracket-tl { top: -1px; left: -1px; }
.bracket-tl::before { width: 10px; height: 1px; top: 0; left: 0; }
.bracket-tl::after { width: 1px; height: 10px; top: 0; left: 0; }

.bracket-tr { top: -1px; right: -1px; }
.bracket-tr::before { width: 10px; height: 1px; top: 0; right: 0; }
.bracket-tr::after { width: 1px; height: 10px; top: 0; right: 0; }

.bracket-bl { bottom: -1px; left: -1px; }
.bracket-bl::before { width: 10px; height: 1px; bottom: 0; left: 0; }
.bracket-bl::after { width: 1px; height: 10px; bottom: 0; left: 0; }

.bracket-br { bottom: -1px; right: -1px; }
.bracket-br::before { width: 10px; height: 1px; bottom: 0; right: 0; }
.bracket-br::after { width: 1px; height: 10px; bottom: 0; right: 0; }

/* ---- Pulse Rings ---- */
.pulse-ring-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.pulse-ring {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1px solid #2E86DE;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
}

.pulse-ring.animating {
    animation: pulseExpand 1.5s ease-out forwards;
}

.pulse-ring-2.animating {
    animation: pulseExpand 1.5s ease-out 0.3s forwards;
}

@keyframes pulseExpand {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* ---- Panel Reveal Animations ---- */
.reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed,
.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Hero Panel ---- */
.hero-panel {
    max-width: 800px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.hero-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    color: #E8F4FD;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #A8C8E8;
    letter-spacing: 0.06em;
    margin-bottom: 1.5rem;
}

.hero-divider {
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #2E86DE, transparent);
    margin: 0 auto 1.5rem;
}

.hero-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #A8C8E8;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Panel Header ---- */
.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(46, 134, 222, 0.15);
}

.panel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27AE60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.5);
    flex-shrink: 0;
}

.indicator-live {
    animation: indicatorPulse 1.5s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(39, 174, 96, 0.5); }
    50% { box-shadow: 0 0 14px rgba(39, 174, 96, 0.9); }
}

.section-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: #E8F4FD;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex: 1;
}

.panel-status {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.panel-status[data-status="active"] {
    color: #2E86DE;
    border: 1px solid rgba(46, 134, 222, 0.4);
}

.panel-status[data-status="verified"] {
    color: #27AE60;
    border: 1px solid rgba(39, 174, 96, 0.4);
}

.panel-status[data-status="processing"] {
    color: #FF6B35;
    border: 1px solid rgba(255, 107, 53, 0.4);
    animation: statusBlink 2s ease-in-out infinite;
}

.panel-status[data-status="live"] {
    color: #27AE60;
    border: 1px solid rgba(39, 174, 96, 0.4);
    background: rgba(39, 174, 96, 0.08);
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---- Panel Body ---- */
.panel-body p {
    margin-bottom: 1.2rem;
    color: #A8C8E8;
}

.panel-body p:last-child {
    margin-bottom: 0;
}

/* ---- Protocol Panel ---- */
.protocol-panel {
    max-width: 65%;
    width: 100%;
}

/* ---- Data Block ---- */
.data-block {
    background: rgba(10, 14, 26, 0.5);
    border: 1px solid rgba(46, 134, 222, 0.15);
    border-radius: 2px;
    padding: 16px 20px;
    margin: 20px 0;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 42, 78, 0.5);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: #A8C8E8;
    letter-spacing: 0.05em;
}

.data-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: #2E86DE;
    letter-spacing: 0.02em;
}

/* ---- Trust Panel ---- */
.trust-panel {
    max-width: 60%;
    width: 100%;
}

/* ---- Trust Diagram ---- */
.trust-diagram {
    margin: 24px 0;
    display: flex;
    justify-content: center;
}

.trust-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.node-connection {
    stroke: rgba(46, 134, 222, 0.15);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 2s ease-out;
}

.node-connection.animate {
    stroke-dashoffset: 0;
}

.trust-node {
    fill: #0E1A40;
    stroke-width: 1.5;
}

.node-primary {
    stroke: #FF6B35;
    filter: drop-shadow(0 0 4px rgba(255, 107, 53, 0.4));
}

.node-secondary {
    stroke: #2E86DE;
    filter: drop-shadow(0 0 4px rgba(46, 134, 222, 0.4));
}

.node-relay {
    stroke: #27AE60;
    filter: drop-shadow(0 0 4px rgba(39, 174, 96, 0.4));
}

.node-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    fill: #A8C8E8;
    text-anchor: middle;
    letter-spacing: 0.05em;
}

/* ---- Verification Panel ---- */
.verification-panel {
    max-width: 55%;
    width: 100%;
}

/* ---- Verification Timeline ---- */
.verification-timeline {
    margin: 20px 0;
}

.timeline-step {
    display: flex;
    gap: 20px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.timeline-step.revealed {
    opacity: 1;
    transform: translateY(0);
}

.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.step-number {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2E86DE;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(46, 134, 222, 0.4);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 26, 64, 0.6);
    flex-shrink: 0;
}

.step-line {
    width: 1px;
    flex: 1;
    background: linear-gradient(180deg, rgba(46, 134, 222, 0.3), transparent);
    min-height: 30px;
}

.timeline-step:last-child .step-line {
    display: none;
}

.step-content {
    padding-bottom: 24px;
}

.step-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: #E8F4FD;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.step-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: #A8C8E8;
    line-height: 1.7;
}

/* ---- Network Panel ---- */
.network-panel {
    max-width: 70%;
    width: 100%;
}

.network-panel.revealed {
    box-shadow: 0 0 50px rgba(46, 134, 222, 0.12);
}

/* ---- Network Metrics Grid ---- */
.network-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: rgba(10, 14, 26, 0.5);
    border: 1px solid rgba(46, 134, 222, 0.15);
    border-radius: 2px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.metric-card:hover {
    border-color: rgba(46, 134, 222, 0.4);
    box-shadow: 0 0 20px rgba(46, 134, 222, 0.1);
}

.metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.65rem;
    color: #A8C8E8;
    letter-spacing: 0.06em;
}

.metric-value {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    color: #2E86DE;
    letter-spacing: 0.02em;
}

/* ---- Network Log ---- */
.network-log {
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid rgba(46, 134, 222, 0.1);
    border-radius: 2px;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    line-height: 1.5;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(26, 42, 78, 0.3);
    align-items: baseline;
}

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

.log-time {
    color: rgba(168, 200, 232, 0.5);
    flex-shrink: 0;
}

.log-type {
    font-weight: 400;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 1px;
}

.log-type-verify {
    color: #27AE60;
    background: rgba(39, 174, 96, 0.08);
}

.log-type-anchor {
    color: #2E86DE;
    background: rgba(46, 134, 222, 0.08);
}

.log-type-alert {
    color: #FF6B35;
    background: rgba(255, 107, 53, 0.08);
}

.log-type-node {
    color: #A8C8E8;
    background: rgba(168, 200, 232, 0.08);
}

.log-msg {
    color: #A8C8E8;
    opacity: 0.7;
}

/* ---- Status Bar ---- */
#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(10, 14, 26, 0.9);
    border-top: 1px solid rgba(46, 134, 222, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 95;
    padding: 0 40px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 400ms ease-out;
}

#status-bar.active {
    opacity: 1;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    color: rgba(168, 200, 232, 0.5);
    letter-spacing: 0.04em;
}

.status-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #2E86DE;
    letter-spacing: 0.02em;
    transition: color 200ms ease;
}

.status-item:hover .status-value {
    color: #FF6B35;
}

.status-value-active {
    color: #27AE60;
}

.status-item:hover .status-value-active {
    color: #FF6B35;
}

.status-divider {
    width: 1px;
    height: 20px;
    background: rgba(46, 134, 222, 0.15);
}

/* ---- Connection Lines ---- */
#connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.connection-path {
    stroke: rgba(46, 134, 222, 0.15);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 8 4;
    animation: dashFlow 3s linear infinite;
}

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

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .protocol-panel,
    .trust-panel,
    .verification-panel,
    .network-panel {
        max-width: 80%;
    }

    .network-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hud-section {
        padding: 60px 24px;
    }

    .protocol-panel,
    .trust-panel,
    .verification-panel,
    .network-panel {
        max-width: 95%;
    }

    .panel {
        padding: 24px;
    }

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

    .data-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    #status-bar {
        gap: 12px;
        padding: 0 16px;
        overflow-x: auto;
    }

    .status-item {
        white-space: nowrap;
    }

    .log-entry {
        flex-wrap: wrap;
    }

    .log-msg {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .network-grid {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-wrap: wrap;
    }

    #boot-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }
}
