/* ========================================
   transactology.dev - Retro-Futuristic Terminal
   Colors: #0A0A1A, #D4A040, #40D0E0, #40D070, #A0A0B0, #F0D8B0
   Fonts: Space Grotesk, JetBrains Mono
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0A1A;
    color: #A0A0B0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #F0D8B0;
}

.section-heading {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #D4A040;
    margin-bottom: 1.5rem;
}

/* ========================================
   HUD FRAME - Targeting Brackets
   ======================================== */

.hud-frame {
    position: relative;
    padding: 2rem;
}

.hud-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.hud-tl {
    top: 0;
    left: 0;
    border-left: 2px solid #D4A040;
    border-top: 2px solid #D4A040;
}

.hud-tr {
    top: 0;
    right: 0;
    border-right: 2px solid #D4A040;
    border-top: 2px solid #D4A040;
}

.hud-bl {
    bottom: 0;
    left: 0;
    border-left: 2px solid #D4A040;
    border-bottom: 2px solid #D4A040;
}

.hud-br {
    bottom: 0;
    right: 0;
    border-right: 2px solid #D4A040;
    border-bottom: 2px solid #D4A040;
}

/* ========================================
   HEX OVERLAY
   ======================================== */

.hex-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    background-image:
        linear-gradient(30deg, #D4A040 12%, transparent 12.5%, transparent 87%, #D4A040 87.5%, #D4A040),
        linear-gradient(150deg, #D4A040 12%, transparent 12.5%, transparent 87%, #D4A040 87.5%, #D4A040),
        linear-gradient(30deg, #D4A040 12%, transparent 12.5%, transparent 87%, #D4A040 87.5%, #D4A040),
        linear-gradient(150deg, #D4A040 12%, transparent 12.5%, transparent 87%, #D4A040 87.5%, #D4A040),
        linear-gradient(60deg, #40D0E044 25%, transparent 25.5%, transparent 75%, #40D0E044 75%, #40D0E044),
        linear-gradient(60deg, #40D0E044 25%, transparent 25.5%, transparent 75%, #40D0E044 75%, #40D0E044);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
}

/* ========================================
   HERO SECTION
   ======================================== */

#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3vh 2rem;
    overflow: hidden;
}

.hero-content {
    max-width: 780px;
    width: 100%;
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    color: #D4A040;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    position: relative;
}

.hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #40D0E0;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 0.5rem;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch::before {
    color: #40D0E0;
    z-index: -1;
}

.glitch::after {
    color: #40D070;
    z-index: -2;
}

.glitch.glitching::before {
    animation: glitch-1 0.3s linear;
    opacity: 0.8;
}

.glitch.glitching::after {
    animation: glitch-2 0.3s linear;
    opacity: 0.8;
}

@keyframes glitch-1 {
    0% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, -1px); }
    20% { clip-path: inset(92% 0 1% 0); transform: translate(1px, 2px); }
    40% { clip-path: inset(43% 0 1% 0); transform: translate(-1px, 3px); }
    60% { clip-path: inset(25% 0 58% 0); transform: translate(3px, -1px); }
    80% { clip-path: inset(54% 0 7% 0); transform: translate(-3px, 2px); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(0); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(65% 0 13% 0); transform: translate(2px, 1px); }
    20% { clip-path: inset(14% 0 72% 0); transform: translate(-1px, -3px); }
    40% { clip-path: inset(76% 0 1% 0); transform: translate(1px, -2px); }
    60% { clip-path: inset(2% 0 88% 0); transform: translate(-2px, 1px); }
    80% { clip-path: inset(31% 0 55% 0); transform: translate(3px, -2px); }
    100% { clip-path: inset(19% 0 71% 0); transform: translate(0); }
}

/* Hero Status Bar */
.hero-status-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.status-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #A0A0B0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #A0A0B0;
    display: inline-block;
}

.status-dot.active {
    background: #40D070;
    box-shadow: 0 0 6px #40D070;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Hero SVG Transaction Flow */
.tx-flow-hero {
    width: 100%;
    max-width: 780px;
    height: auto;
    margin-top: 3rem;
}

.tx-node {
    fill: none;
    stroke: #D4A040;
    stroke-width: 2;
}

.tx-line {
    stroke: #40D0E0;
    stroke-width: 1.5;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.5s ease;
}

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

.tx-label {
    fill: #A0A0B0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-anchor: middle;
    letter-spacing: 0.1em;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-arrow {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid #D4A040;
    border-bottom: 2px solid #D4A040;
    transform: rotate(45deg);
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 1; }
    50% { transform: rotate(45deg) translateY(8px); opacity: 0.4; }
}

/* ========================================
   HUD STATUS DIVIDER
   ======================================== */

.hud-status-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 780px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.hud-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #D4A040, transparent);
}

.hud-status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #D4A040;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    white-space: nowrap;
}

/* ========================================
   DOCS SECTION (F-Pattern)
   ======================================== */

#docs {
    padding: 6rem 2rem;
    position: relative;
}

.docs-container {
    max-width: 780px;
    margin: 0 auto;
}

.docs-body {
    color: #A0A0B0;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Code Blocks */
.code-block {
    background: #0D0D24;
    border: 1px solid #1a1a3a;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #111130;
    border-bottom: 1px solid #1a1a3a;
}

.code-lang {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #D4A040;
    letter-spacing: 0.05em;
}

.code-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #40D070;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.1em;
}

.code-block pre {
    padding: 1.2rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #F0D8B0;
    line-height: 1.6;
}

.code-block-sm code {
    font-size: 0.8rem;
}

/* Docs Circuit SVG */
.tx-flow-circuit {
    width: 100%;
    max-width: 780px;
    height: auto;
    margin: 3rem 0;
}

.tx-node-sm {
    fill: none;
    stroke: #D4A040;
    stroke-width: 1.5;
}

.tx-line-sm {
    stroke: #40D0E0;
    stroke-width: 1;
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    transition: stroke-dashoffset 1.2s ease;
}

.tx-line-sm.drawn {
    stroke-dashoffset: 0;
}

.tx-label-sm {
    fill: #A0A0B0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    text-anchor: middle;
    letter-spacing: 0.1em;
}

/* Docs Columns */
.docs-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.doc-card {
    position: relative;
}

.card-heading {
    font-size: 1.2rem;
    color: #40D0E0;
    margin-bottom: 0.8rem;
}

.card-body {
    color: #A0A0B0;
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ========================================
   WALKTHROUGH SECTION
   ======================================== */

#walkthrough {
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.walkthrough-container {
    max-width: 780px;
    margin: 0 auto;
}

.walkthrough-panel {
    margin-bottom: 3rem;
}

.walkthrough-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #D4A040;
    min-width: 60px;
    text-align: center;
    line-height: 1;
    padding-top: 0.2rem;
    opacity: 0.6;
}

.step-content {
    flex: 1;
    border-left: 1px solid #1a1a3a;
    padding-left: 1.5rem;
}

.step-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    color: #40D0E0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.step-desc {
    color: #A0A0B0;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* Glitch Panel */
.glitch-panel {
    position: relative;
    background: #0D0D24;
    border: 1px solid #1a1a3a;
    padding: 2rem;
    overflow: hidden;
}

.glitch-content {
    text-align: center;
}

.glitch-line {
    height: 2px;
    margin: 0.6rem 0;
    background: linear-gradient(90deg, transparent, #D4A040 20%, #40D0E0 50%, #D4A040 80%, transparent);
    opacity: 0.3;
}

.glitch-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    color: #40D070;
    position: relative;
    display: inline-block;
    letter-spacing: 0.1em;
    margin: 1rem 0;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text::before {
    color: #D4A040;
    z-index: -1;
}

.glitch-text::after {
    color: #40D0E0;
    z-index: -2;
}

.glitch-text.glitching::before {
    animation: glitch-1 0.4s linear;
    opacity: 0.7;
}

.glitch-text.glitching::after {
    animation: glitch-2 0.4s linear;
    opacity: 0.7;
}

/* ========================================
   CLOSING SECTION
   ======================================== */

#closing {
    padding: 6rem 2rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-container {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.closing-frame {
    margin-bottom: 3rem;
}

.closing-title {
    font-size: 2rem;
    color: #D4A040;
    margin-bottom: 0.5rem;
}

.closing-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #40D0E0;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.closing-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #F0D8B0;
    line-height: 1;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #A0A0B0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.4rem;
}

/* Closing SVG */
.tx-flow-closing {
    width: 100%;
    max-width: 780px;
    height: auto;
}

.tx-line-final {
    stroke: #D4A040;
    stroke-width: 1;
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 2s ease;
}

.tx-line-final.drawn {
    stroke-dashoffset: 0;
}

/* ========================================
   SECTION REVEAL ANIMATION
   ======================================== */

.section-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   SCANLINE EFFECT (Subtle)
   ======================================== */

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(10, 10, 26, 0.03) 2px,
        rgba(10, 10, 26, 0.03) 4px
    );
    z-index: 9999;
}

/* ========================================
   RESPONSIVE
   ======================================== */

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

    .hero-status-bar {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .closing-stats {
        gap: 1.5rem;
    }

    .step {
        flex-direction: column;
        gap: 0.5rem;
    }

    .step-number {
        text-align: left;
    }

    .step-content {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #1a1a3a;
        padding-top: 0.8rem;
    }

    .hud-status-divider {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .section-heading {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .hud-frame {
        padding: 1.2rem;
    }
}
