/* ============================================
   blockchain.day - Decommissioned Orbital Command Center
   ============================================ */

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

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

body {
    background: #08080c;
    color: #8b8fa3;
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    width: 100vw;
    min-height: 100vh;
}

/* ---------- TYPOGRAPHY ---------- */
.heading-display {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #00f0ff;
    line-height: 1.0;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 60px rgba(0, 240, 255, 0.1);
}

.heading-sub {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ff003c;
    margin-bottom: 0.5rem;
}

.heading-sub-alert {
    color: #ff003c;
    text-shadow: 0 0 15px rgba(255, 0, 60, 0.4);
}

.body-text {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: #8b8fa3;
    max-width: 52ch;
    margin-top: 1.2rem;
}

.body-text-emphasis {
    color: #e0e2eb;
}

/* ---------- VOID LAYER ---------- */
#void-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0;
    transition: opacity 800ms ease;
}

#void-layer.visible {
    opacity: 0.06;
}

#hash-pattern-svg {
    width: 100%;
    height: 100%;
}

/* ---------- GRID SCAFFOLD ---------- */
#grid-scaffold {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    opacity: 0;
    transition: opacity 600ms ease;
    pointer-events: none;
}

#grid-scaffold.visible {
    opacity: 1;
}

#grid-scaffold.intensified {
    opacity: 1;
    filter: brightness(1.8);
}

/* ---------- HUD CHROME ---------- */
#hud-chrome {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 400ms ease;
}

#hud-chrome.visible {
    opacity: 1;
}

/* Top-left bracket cluster */
#hud-top-left {
    position: absolute;
    top: 30px;
    left: 30px;
}

#hud-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #00f0ff;
    width: 0;
}

#hud-title.typed {
    animation: typewriter 1.2s steps(20) forwards, blink-caret 0.6s step-end 3;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}

#hud-title.typed-done {
    width: 100%;
    border-right: none;
}

#hud-title-underline {
    height: 1px;
    background: linear-gradient(to right, #00f0ff, transparent);
    width: 0;
    margin-top: 4px;
    transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

#hud-title-underline.extended {
    width: 200px;
}

#block-counter {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #5a3fbf;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 300ms ease;
}

#block-counter.visible {
    opacity: 1;
}

/* Top-right reticle */
#hud-top-right {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 400ms ease;
}

#hud-top-right.visible {
    opacity: 1;
}

#reticle-svg {
    animation: rotate-reticle 120s linear infinite;
}

@keyframes rotate-reticle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.reticle-sweep {
    stroke-dasharray: 176;
    stroke-dashoffset: 176;
    animation: sweep-anim 4s linear infinite;
    opacity: 0.6;
}

@keyframes sweep-anim {
    0% { stroke-dashoffset: 176; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -176; }
}

#live-indicator {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: #ff003c;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff003c;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

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

/* Bottom-left status indicators */
#hud-bottom-left {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    height: 12px;
}

.status-bar {
    width: 4px;
    height: 12px;
    background: #1a1a2e;
    transition: background 300ms ease, box-shadow 300ms ease;
}

.status-indicator.active .status-bar {
    background: #00f0ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    animation: status-pulse 2s ease-in-out infinite;
}

.status-indicator.alert .status-bar {
    background: #ff003c;
}

@keyframes status-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }
    50% { box-shadow: 0 0 16px rgba(0, 240, 255, 0.8); }
}

.status-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #5a3fbf;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 200ms ease, max-width 200ms ease;
}

.status-indicator:hover .status-label,
.status-indicator.active .status-label {
    opacity: 1;
    max-width: 150px;
}

.status-indicator.active .status-label {
    color: #00f0ff;
}

/* Bottom-right scroll chevron */
#hud-bottom-right {
    position: absolute;
    bottom: 30px;
    right: 30px;
}

#scroll-track {
    height: calc(100vh - 140px);
    position: fixed;
    right: 30px;
    top: 70px;
    width: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#scroll-chevron {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    transition: transform 100ms ease;
    position: absolute;
    top: 0;
}

/* ---------- CONTENT PANELS ---------- */
#scroll-container {
    position: relative;
    z-index: 5;
    width: 100vw;
}

.panel-section {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.content-panel {
    position: relative;
    border: 1px solid #2d1b69;
    box-shadow: inset 0 0 40px rgba(0, 240, 255, 0.03);
    padding: 3rem 2.5rem;
    transition: border-color 600ms ease, opacity 600ms cubic-bezier(0.7, 0, 0.3, 1), transform 600ms cubic-bezier(0.7, 0, 0.3, 1);
    opacity: 0;
    transform: translateY(30px);
    max-width: 55%;
}

.content-panel.visible {
    opacity: 1;
    transform: translateY(0);
    border-color: #00f0ff;
}

/* Panel shapes */
.panel-parallelogram {
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    margin-left: 8%;
    padding: 3rem 4rem;
}

.panel-trapezoid {
    clip-path: polygon(5% 0%, 95% 0%, 100% 100%, 0% 100%);
    margin-left: 35%;
    padding: 3rem 3rem;
}

.panel-narrow-trapezoid {
    clip-path: polygon(8% 0%, 100% 0%, 92% 100%, 0% 100%);
    margin-left: 10%;
    max-width: 38%;
    padding: 3rem 3.5rem;
}

.panel-chevron {
    clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%, 8% 50%);
    margin-left: 30%;
    padding: 3rem 5rem;
    max-width: 50%;
}

/* Corner brackets */
.corner-bracket {
    position: absolute;
    width: 30px;
    height: 30px;
    transition: width 300ms ease, height 300ms ease, border-color 300ms ease;
}

.corner-bracket.corner-tl {
    top: 0;
    left: 0;
    border-top: 1px solid #2d1b69;
    border-left: 1px solid #2d1b69;
}

.corner-bracket.corner-tr {
    top: 0;
    right: 0;
    border-top: 1px solid #2d1b69;
    border-right: 1px solid #2d1b69;
}

.corner-bracket.corner-bl {
    bottom: 0;
    left: 0;
    border-bottom: 1px solid #2d1b69;
    border-left: 1px solid #2d1b69;
}

.corner-bracket.corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid #2d1b69;
    border-right: 1px solid #2d1b69;
}

.content-panel.visible .corner-bracket {
    width: 45px;
    height: 45px;
    border-color: #00f0ff;
}

/* ---------- HERO SECTION ---------- */
#section-hero {
    justify-content: flex-start;
}

#hero-block {
    position: absolute;
    right: 15%;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    height: 280px;
    perspective: 800px;
    opacity: 0;
    transition: opacity 800ms ease;
}

#hero-block.visible {
    opacity: 1;
}

.cube-wireframe {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate-cube 30s linear infinite;
}

@keyframes rotate-cube {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    100% { transform: rotateY(360deg) rotateX(514deg); }
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid #00f0ff;
    background: rgba(45, 27, 105, 0.05);
    left: 50%;
    top: 50%;
    margin-left: -100px;
    margin-top: -100px;
    box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.05);
}

.cube-front  { transform: translateZ(100px); }
.cube-back   { transform: translateZ(-100px) rotateY(180deg); }
.cube-left   { transform: translateX(-100px) rotateY(-90deg); }
.cube-right  { transform: translateX(100px) rotateY(90deg); }
.cube-top    { transform: translateY(-100px) rotateX(90deg); }
.cube-bottom { transform: translateY(100px) rotateX(-90deg); }

/* Hash visualization */
#hash-viz {
    position: absolute;
    right: 5%;
    bottom: 10%;
    width: 250px;
    height: 250px;
    opacity: 0;
    transition: opacity 1s ease;
}

#hash-viz.visible {
    opacity: 0.4;
}

.hash-hex {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    opacity: 0.6;
}

.hash-hex.drawn {
    animation: draw-hex 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hash-ray {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    opacity: 0.3;
}

.hash-ray.drawn {
    animation: draw-ray 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes draw-hex {
    to { stroke-dashoffset: 0; }
}

@keyframes draw-ray {
    to { stroke-dashoffset: 0; }
}

/* ---------- CHAIN SECTION ---------- */
#section-chain {
    justify-content: flex-end;
}

#chain-viz {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0;
    opacity: 0;
    transition: opacity 600ms ease;
}

#chain-viz.visible {
    opacity: 1;
}

.chain-cube {
    width: 50px;
    height: 50px;
    perspective: 300px;
}

.mini-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate-mini-cube 20s linear infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes rotate-mini-cube {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    100% { transform: rotateY(360deg) rotateX(360deg); }
}

.mini-cube .cube-face {
    width: 36px;
    height: 36px;
    margin-left: -18px;
    margin-top: -18px;
    border-width: 0.5px;
    background: rgba(45, 27, 105, 0.03);
}

.mini-cube .cube-front  { transform: translateZ(18px); }
.mini-cube .cube-back   { transform: translateZ(-18px) rotateY(180deg); }
.mini-cube .cube-left   { transform: translateX(-18px) rotateY(-90deg); }
.mini-cube .cube-right  { transform: translateX(18px) rotateY(90deg); }
.mini-cube .cube-top    { transform: translateY(-18px) rotateX(90deg); }
.mini-cube .cube-bottom { transform: translateY(18px) rotateX(-90deg); }

.chain-link {
    width: 30px;
    height: 1px;
    background: #00f0ff;
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.tx-flow-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
}

.tx-flow-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tx-flow-path.drawn {
    stroke-dashoffset: 0;
}

/* ---------- SHARD SECTION ---------- */
#section-shard {
    justify-content: flex-start;
}

.shard-field {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.shard-tetra {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 80px;
    height: 80px;
    opacity: 0.15;
    transform: rotate(var(--rot));
    animation: drift-shard var(--dur) ease-in-out infinite alternate;
}

@keyframes drift-shard {
    0% { transform: rotate(var(--rot)) translate(0, 0); }
    100% { transform: rotate(var(--rot)) translate(20px, -15px); }
}

.shard-field .shard-tetra:nth-child(odd) {
    animation-direction: alternate-reverse;
}

/* Active shard section: bring to foreground */
#section-shard.active .shard-tetra {
    opacity: 0.5;
    transition: opacity 600ms ease;
}

/* ---------- SIGNAL SECTION ---------- */
#section-signal {
    justify-content: flex-start;
}

#signal-reticle {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%);
    width: 50vh;
    height: 50vh;
    opacity: 0;
    transition: opacity 800ms ease, width 800ms ease, height 800ms ease;
}

#section-signal.active #signal-reticle {
    opacity: 0.6;
}

.signal-sweep {
    stroke-dasharray: 1130;
    stroke-dashoffset: 1130;
    animation: signal-sweep-anim 4s linear infinite;
}

@keyframes signal-sweep-anim {
    0% { stroke-dashoffset: 1130; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1130; }
}

/* ---------- DAY ZERO SECTION ---------- */
#section-dayzero {
    justify-content: center;
    align-items: center;
}

#panel-dayzero {
    text-align: center;
    opacity: 0;
    transition: opacity 1200ms ease;
}

#section-dayzero.active #panel-dayzero {
    opacity: 1;
}

.heading-centered {
    text-align: center;
}

/* Ghost white for emphasized data */
.data-emphasis {
    color: #e0e2eb;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ---------- ATMOSPHERIC SHARDS ---------- */
#atmosphere-shards {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
}

.atmo-shard {
    position: absolute;
    left: var(--ax);
    top: var(--ay);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid rgba(45, 27, 105, 0.15);
    animation: atmo-drift var(--adur) ease-in-out infinite alternate;
}

@keyframes atmo-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -10px) rotate(5deg); }
    50% { transform: translate(-10px, 5px) rotate(-3deg); }
    75% { transform: translate(8px, 12px) rotate(4deg); }
    100% { transform: translate(-5px, -8px) rotate(-2deg); }
}

/* ---------- FRAGMENT ANIMATION ---------- */
.panel-fragment {
    position: absolute;
    overflow: hidden;
    transition: transform 600ms cubic-bezier(0.7, 0, 0.3, 1), opacity 600ms cubic-bezier(0.7, 0, 0.3, 1);
    pointer-events: none;
    z-index: 6;
}

.panel-fragment.shatter-out {
    opacity: 0;
}

.panel-fragment.assemble-in {
    opacity: 1;
    transform: translate(0, 0) !important;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
    width: 0;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .content-panel {
        opacity: 1;
        transform: none;
    }

    #void-layer, #grid-scaffold, #hud-chrome, #hero-block, #hash-viz,
    #chain-viz, #signal-reticle, #panel-dayzero {
        opacity: 1;
    }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .content-panel {
        max-width: 90%;
        clip-path: none !important;
        padding: 2rem 1.5rem;
    }

    .panel-parallelogram,
    .panel-trapezoid,
    .panel-narrow-trapezoid,
    .panel-chevron {
        margin-left: 5%;
        max-width: 90%;
    }

    #hero-block {
        width: 150px;
        height: 150px;
        right: 5%;
        opacity: 0.5;
    }

    .cube-face {
        width: 100px;
        height: 100px;
        margin-left: -50px;
        margin-top: -50px;
    }
    .cube-front  { transform: translateZ(50px); }
    .cube-back   { transform: translateZ(-50px) rotateY(180deg); }
    .cube-left   { transform: translateX(-50px) rotateY(-90deg); }
    .cube-right  { transform: translateX(50px) rotateY(90deg); }
    .cube-top    { transform: translateY(-50px) rotateX(90deg); }
    .cube-bottom { transform: translateY(50px) rotateX(-90deg); }

    .heading-display {
        font-size: clamp(2.5rem, 8vw, 5rem);
    }

    #chain-viz {
        display: none;
    }

    #signal-reticle {
        width: 30vh;
        height: 30vh;
    }

    #hash-viz {
        width: 120px;
        height: 120px;
    }
}
