/* ======================================== */
/* gamelicens.ing - Styles                  */
/* Sci-Fi Bureaucratic HUD Overlay          */
/* ======================================== */

/* --- Color Reference (DESIGN.md) ---
   #0A0F1A - Deep Background (Midnight Void)
   #111827 - Panel Background (Dark Slate)
   #1B3A4F - Grid Lines / Borders (Arctic Steel)
   #E0F2FE - Primary Text (Ice White)
   #94A3B8 - Secondary Text (Slate Gray)
   #2DD4BF - Primary Accent (Teal Glow)
   #F59E0B - Warning / Alert (Amber Signal)
   #10B981 - Active License (Emerald Pulse)
   #EF4444 - Expired / Revoked (Crimson Fade)
   #22D3EE - Territory Highlight (Cyan Beam)
*/

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

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

body {
    background: #0A0F1A;
    color: #E0F2FE;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    position: relative;
}

/* --- Scanline Effect --- */
#scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(45, 212, 191, 0.03) 20%, rgba(45, 212, 191, 0.06) 50%, rgba(45, 212, 191, 0.03) 80%, transparent 100%);
    z-index: 100;
    pointer-events: none;
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

/* --- Background Grid --- */
#bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-image:
        repeating-linear-gradient(90deg, rgba(27, 58, 79, 0.12) 0px, rgba(27, 58, 79, 0.12) 1px, transparent 1px, transparent),
        repeating-linear-gradient(0deg, rgba(27, 58, 79, 0.12) 0px, rgba(27, 58, 79, 0.12) 1px, transparent 1px, transparent);
    background-size: 6.25% 80px;
}

#bg-grid.visible {
    opacity: 0.05;
}

/* --- Data Stream Lines --- */
#data-streams {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.stream {
    position: absolute;
    top: -100%;
    width: 1px;
    height: 200%;
    background: linear-gradient(180deg, transparent 0%, rgba(27, 58, 79, 0.3) 30%, rgba(45, 212, 191, 0.08) 50%, rgba(27, 58, 79, 0.3) 70%, transparent 100%);
    animation: streamFlow linear infinite;
}

@keyframes streamFlow {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(50%); }
}

/* --- HUD Overlay: Top Right --- */
#hud-top-right {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #94A3B8;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

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

.hud-section-indicator {
    letter-spacing: 0.1em;
}

.hud-scroll-depth {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: #94A3B8;
    opacity: 0.7;
}

.hud-scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2DD4BF;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hud-scroll-dot.active {
    opacity: 1;
    animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* --- HUD Overlay: Bottom Left --- */
#hud-bottom-left {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 20;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

#hud-bottom-left.visible {
    opacity: 1;
}

.hud-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: #94A3B8;
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* --- HUD Overlay: Clearance --- */
#hud-clearance {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 20;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    color: #2DD4BF;
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

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

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

/* --- Panel Architecture --- */
.panel {
    position: relative;
    background: #111827;
    border: 1px solid rgba(45, 212, 191, 0.4);
    clip-path: polygon(
        12px 0%, calc(100% - 12px) 0%,
        100% 12px, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 12px 100%,
        0% calc(100% - 12px), 0% 12px
    );
    box-shadow: inset 0 0 30px rgba(45, 212, 191, 0.05);
    padding: 40px 48px;
    max-width: 900px;
    width: 100%;
}

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

.bracket {
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.bracket-tl {
    top: -2px;
    left: -2px;
    border-top: 2px solid rgba(45, 212, 191, 0.5);
    border-left: 2px solid rgba(45, 212, 191, 0.5);
    transform: translate(-10px, -10px);
}

.bracket-tr {
    top: -2px;
    right: -2px;
    border-top: 2px solid rgba(45, 212, 191, 0.5);
    border-right: 2px solid rgba(45, 212, 191, 0.5);
    transform: translate(10px, -10px);
}

.bracket-bl {
    bottom: -2px;
    left: -2px;
    border-bottom: 2px solid rgba(45, 212, 191, 0.5);
    border-left: 2px solid rgba(45, 212, 191, 0.5);
    transform: translate(-10px, 10px);
}

.bracket-br {
    bottom: -2px;
    right: -2px;
    border-bottom: 2px solid rgba(45, 212, 191, 0.5);
    border-right: 2px solid rgba(45, 212, 191, 0.5);
    transform: translate(10px, 10px);
}

.panel.revealed .bracket {
    opacity: 1;
    transform: translate(0, 0);
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E0F2FE;
    margin-bottom: 24px;
    line-height: 1.1;
}

/* --- Body Text --- */
.body-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: #94A3B8;
    margin-bottom: 20px;
    max-width: 700px;
}

/* --- Status Indicators --- */
.status-pip {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pipPulse 2s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.status-pip.active {
    background: #10B981;
}

.status-pip.pending {
    background: #F59E0B;
}

.status-pip.expired {
    background: #EF4444;
}

@keyframes pipPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.status-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.status-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #94A3B8;
    letter-spacing: 0.08em;
    margin-right: 16px;
}

/* ============================================ */
/* SECTION 1: Hero                              */
/* ============================================ */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding-bottom: 40px;
}

.hero-panel {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
    clip-path: none;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E0F2FE;
    line-height: 1.1;
    margin-bottom: 20px;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #2DD4BF;
    width: 0;
    animation: none;
}

.hero-title.typing {
    animation: heroTypeBlink 0.7s step-end infinite;
}

.hero-title.done {
    border-right-color: transparent;
    animation: none;
}

@keyframes heroTypeBlink {
    0%, 100% { border-right-color: #2DD4BF; }
    50% { border-right-color: transparent; }
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    letter-spacing: 0.2em;
    color: #94A3B8;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-progress-bar {
    width: 300px;
    max-width: 80vw;
    height: 2px;
    background: rgba(27, 58, 79, 0.4);
    margin-top: 40px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-progress-bar.visible {
    opacity: 1;
}

.hero-progress-fill {
    width: 0;
    height: 100%;
    background: #2DD4BF;
    transition: width 2s ease-in-out;
}

.hero-progress-fill.animating {
    width: 100%;
}

.intro-panel {
    margin-top: 20px;
}

/* --- Reveal Animations --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal-child] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].revealed [data-reveal-child] {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal].revealed [data-reveal-child]:nth-child(1) { transition-delay: 0ms; }
[data-reveal].revealed [data-reveal-child]:nth-child(2) { transition-delay: 200ms; }
[data-reveal].revealed [data-reveal-child]:nth-child(3) { transition-delay: 400ms; }
[data-reveal].revealed [data-reveal-child]:nth-child(4) { transition-delay: 600ms; }
[data-reveal].revealed [data-reveal-child]:nth-child(5) { transition-delay: 800ms; }

/* ============================================ */
/* SECTION 2: Territory Map                     */
/* ============================================ */
.territory-section {
    padding-top: 120px;
    padding-bottom: 120px;
    gap: 60px;
}

.territory-header {
    text-align: center;
}

.hex-map-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
}

#hex-svg {
    width: 100%;
    height: auto;
}

#hex-svg .hex-cell {
    fill: none;
    stroke: #1B3A4F;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.4s ease, stroke 0.4s ease;
}

#hex-svg .hex-cell.activated {
    fill: url(#hexGradient);
    stroke: rgba(45, 212, 191, 0.5);
}

#hex-svg .hex-cell:hover {
    fill: rgba(45, 212, 191, 0.25);
    stroke: #22D3EE;
}

/* Hex Tooltips */
.hex-tooltip {
    position: absolute;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    color: #2DD4BF;
    background: rgba(10, 15, 26, 0.95);
    border: 1px solid rgba(45, 212, 191, 0.3);
    padding: 4px 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 30;
    white-space: nowrap;
}

.hex-tooltip.visible {
    opacity: 1;
}

/* ============================================ */
/* SECTION 3: License Lifecycle                 */
/* ============================================ */
.lifecycle-section {
    padding-top: 120px;
    padding-bottom: 120px;
    gap: 60px;
}

.lifecycle-header {
    text-align: center;
}

.timeline-container {
    display: flex;
    max-width: 800px;
    width: 100%;
    position: relative;
    padding-left: 60px;
}

.timeline-line {
    position: absolute;
    left: 29px;
    top: 0;
    width: 60px;
    height: 100%;
}

#timeline-svg {
    width: 60px;
    height: 100%;
}

#timeline-path {
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.timeline-nodes {
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding: 20px 0;
    width: 100%;
}

.timeline-node {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-reveal].revealed .timeline-node {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal].revealed .timeline-node:nth-child(1) { transition-delay: 200ms; }
[data-reveal].revealed .timeline-node:nth-child(2) { transition-delay: 400ms; }
[data-reveal].revealed .timeline-node:nth-child(3) { transition-delay: 600ms; }
[data-reveal].revealed .timeline-node:nth-child(4) { transition-delay: 800ms; }
[data-reveal].revealed .timeline-node:nth-child(5) { transition-delay: 1000ms; }

.node-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 2px solid #2DD4BF;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 26, 0.9);
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-reveal].revealed .timeline-node .node-circle {
    transform: scale(1);
}

[data-reveal].revealed .timeline-node:nth-child(1) .node-circle { transition-delay: 300ms; }
[data-reveal].revealed .timeline-node:nth-child(2) .node-circle { transition-delay: 500ms; }
[data-reveal].revealed .timeline-node:nth-child(3) .node-circle { transition-delay: 700ms; }
[data-reveal].revealed .timeline-node:nth-child(4) .node-circle { transition-delay: 900ms; }
[data-reveal].revealed .timeline-node:nth-child(5) .node-circle { transition-delay: 1100ms; }

.node-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.node-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E0F2FE;
}

.node-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 0.95vw, 0.95rem);
    line-height: 1.75;
    color: #94A3B8;
}

/* ============================================ */
/* SECTION 4: Dashboard                         */
/* ============================================ */
.dashboard-section {
    padding-top: 120px;
    padding-bottom: 120px;
    gap: 60px;
}

.dashboard-header {
    text-align: center;
}

.counters-row {
    display: flex;
    gap: 32px;
    max-width: 1000px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.counter-panel {
    flex: 1;
    min-width: 240px;
    text-align: center;
    padding: 40px 32px;
}

.counter-value {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #2DD4BF;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.counter-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    color: #94A3B8;
    letter-spacing: 0.05em;
}

/* ============================================ */
/* SECTION 5: Access / Contact                  */
/* ============================================ */
.access-section {
    padding-top: 120px;
    padding-bottom: 80px;
    gap: 60px;
}

.access-panel {
    text-align: left;
}

.access-details {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.access-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(27, 58, 79, 0.3);
}

.access-key {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    color: #2DD4BF;
    letter-spacing: 0.1em;
    min-width: 120px;
}

.access-val {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.8rem, 0.95vw, 0.95rem);
    color: #94A3B8;
    display: flex;
    align-items: center;
}

/* --- Footer --- */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 60px 0 20px;
    position: relative;
}

.footer-hex-pattern {
    margin-bottom: 24px;
    opacity: 0.3;
}

#footer-hex-svg {
    width: 100%;
    max-width: 600px;
    height: 100px;
}

#footer-hex-svg .hex-cell {
    fill: none;
    stroke: #1B3A4F;
    stroke-width: 1;
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: #94A3B8;
    opacity: 0.4;
    letter-spacing: 0.15em;
}

/* ============================================ */
/* Responsive                                   */
/* ============================================ */
@media (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }

    .panel {
        padding: 28px 24px;
    }

    .counters-row {
        flex-direction: column;
        align-items: center;
    }

    .counter-panel {
        min-width: 200px;
        max-width: 320px;
    }

    .timeline-container {
        padding-left: 50px;
    }

    .timeline-line {
        left: 19px;
    }

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

    .access-key {
        min-width: auto;
    }

    #hud-top-right {
        top: 12px;
        right: 12px;
    }

    #hud-bottom-left {
        bottom: 12px;
        left: 12px;
    }

    #hud-clearance {
        top: 12px;
        left: 12px;
        font-size: 0.6rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 3.5rem);
    }

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

    .status-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
