/* ================================================
   gamelicens.ing - Interstellar Game Licensing Bureau
   ================================================ */

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

html {
    scroll-behavior: auto;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.7;
    color: #A0B8C8;
    background: radial-gradient(ellipse at 50% 30%, #0C1824 0%, #060B11 70%);
    background-color: #060B11;
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ================================================
   HUD Frame
   ================================================ */
#hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(0, 240, 255, 0.4);
    pointer-events: none;
    z-index: 1000;
    will-change: opacity;
}

.hud-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.hud-corner-tl { top: -1px; left: -1px; }
.hud-corner-tr { top: -1px; right: -1px; }
.hud-corner-bl { bottom: -1px; left: -1px; }
.hud-corner-br { bottom: -1px; right: -1px; }

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

.hud-corner {
    animation: cornerPulse 3s ease-in-out infinite;
}

/* HUD Frame Draw-In Animation */
@keyframes hudDrawIn {
    0% {
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

#hud-frame {
    animation: hudDrawIn 1.2s ease-out 0.6s both;
}

/* ================================================
   Scan Line (persistent CRT effect)
   ================================================ */
#scan-line {
    position: fixed;
    top: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: #00F0FF;
    opacity: 0.04;
    z-index: 999;
    will-change: transform;
    animation: scanLineMove 12s linear infinite;
    pointer-events: none;
}

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

/* ================================================
   Scan Transition Effect
   ================================================ */
#scan-transition {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #00F0FF;
    opacity: 0;
    z-index: 998;
    pointer-events: none;
    will-change: transform, opacity;
}

#scan-transition.active {
    animation: scanTransition 0.4s ease-out;
}

@keyframes scanTransition {
    0% { opacity: 0.8; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(100vh); }
}

/* ================================================
   Bureau Access Button
   ================================================ */
#bureau-access-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: none;
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00F0FF;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    padding: 6px 12px;
    cursor: pointer;
    z-index: 1001;
    transition: border-color 0.3s, background-color 0.3s;
}

#bureau-access-btn:hover {
    border-color: rgba(0, 240, 255, 0.7);
    background: rgba(0, 240, 255, 0.05);
}

/* ================================================
   Navigation Panel
   ================================================ */
#nav-panel {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: rgba(12, 24, 36, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(0, 240, 255, 0.15);
    z-index: 1002;
    transition: left 0.4s ease;
    overflow: hidden;
}

#nav-panel.open {
    left: 0;
}

#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 11, 17, 0.5);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

#nav-panel-inner {
    padding: 80px 30px 30px;
}

.nav-panel-header {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #E0F4FF;
    letter-spacing: 0.12em;
    margin-bottom: 30px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1A2A3A;
}

.nav-link {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #A0B8C8;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid rgba(26, 42, 58, 0.5);
    transition: color 0.3s, padding-left 0.3s;
}

.nav-link:hover {
    color: #00F0FF;
    padding-left: 8px;
}

.nav-link.active {
    color: #00F0FF;
}

/* ================================================
   Progress Indicator
   ================================================ */
#progress-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1000;
}

.progress-diamond {
    width: 10px;
    height: 10px;
    border: 1px solid #1A2A3A;
    transform: rotate(45deg);
    transition: background-color 0.4s, border-color 0.4s;
}

.progress-diamond.active {
    background-color: #00F0FF;
    border-color: #00F0FF;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* ================================================
   Scroll Container
   ================================================ */
#scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* ================================================
   Clearance Levels (Sections)
   ================================================ */
.clearance-level {
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.level-content {
    width: 100%;
    max-width: 1100px;
    padding: 40px 60px;
    position: relative;
}

/* ================================================
   Level 0 - Authentication
   ================================================ */
.level-0-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#bureau-seal {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    margin-bottom: 30px;
}

#bureau-seal.visible {
    opacity: 1;
    transform: scale(1);
}

#bureau-seal svg {
    animation: sealRotate 60s linear infinite;
}

@keyframes sealRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#domain-typewriter {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #00F0FF;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    letter-spacing: 0.12em;
    min-height: 1.5em;
    margin-bottom: 20px;
}

#bureau-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 32px;
    color: #E0F4FF;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#bureau-title.visible {
    opacity: 1;
}

#blinking-cursor {
    width: 8px;
    height: 16px;
    background: #00F0FF;
    margin-top: 30px;
    opacity: 0;
    animation: cursorBlink 1s step-end infinite;
}

#blinking-cursor.visible {
    opacity: 1;
}

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

/* ================================================
   Level 1 - Mission Statement
   ================================================ */
.level-1-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.classification-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #FFB800;
    border: 1px solid #FFB800;
    padding: 4px 10px;
    letter-spacing: 0.08em;
}

.document-block {
    border-left: 2px solid #1A2A3A;
    padding-left: 30px;
}

.section-header {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 32px;
    color: #E0F4FF;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.body-text {
    color: #A0B8C8;
    font-weight: 300;
    margin-bottom: 20px;
    line-height: 1.7;
}

.text-highlight {
    color: #00F0FF;
}

/* ================================================
   Level 2 - Permit Classification Matrix
   ================================================ */
.level-2-content {
    text-align: center;
}

.level-2-content .section-header {
    margin-bottom: 40px;
}

.permit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.permit-card {
    background: rgba(12, 24, 36, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 30px 24px;
    position: relative;
    text-align: left;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 800px;
    transition: border-color 0.3s, box-shadow 0.3s;
    /* Card flip initial state */
    opacity: 0;
    transform: rotateY(180deg);
}

.permit-card.flipped {
    opacity: 1;
    transform: rotateY(0deg);
    transition: transform 0.6s ease-out, opacity 0.3s ease-out, border-color 0.3s, box-shadow 0.3s;
}

.permit-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.08);
}

.permit-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 200px;
    font-weight: 700;
    color: rgba(0, 240, 255, 0.04);
    pointer-events: none;
    line-height: 1;
}

.permit-card-content {
    position: relative;
    z-index: 1;
}

.permit-class {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #00F0FF;
    letter-spacing: 0.15em;
    margin-bottom: 6px;
}

.permit-name {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #E0F4FF;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.permit-desc {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #A0B8C8;
    line-height: 1.6;
    margin-bottom: 16px;
}

.permit-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 4px 8px;
    display: inline-block;
}

.status-active {
    color: #00F0FF;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.status-restricted {
    color: #FFB800;
    border: 1px solid rgba(255, 184, 0, 0.3);
}

.status-revoked {
    color: #FF2D55;
    border: 1px solid rgba(255, 45, 85, 0.3);
}

/* Card corner brackets */
.card-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0.3;
}

.card-corner-tl { top: 4px; left: 4px; }
.card-corner-tr { top: 4px; right: 4px; }
.card-corner-bl { bottom: 4px; left: 4px; }
.card-corner-br { bottom: 4px; right: 4px; }

/* ================================================
   Level 3 - Compliance Timeline
   ================================================ */
.level-3-content {
    text-align: center;
    width: 100%;
    max-width: 1100px;
}

.level-3-content .section-header {
    margin-bottom: 60px;
}

.timeline-container {
    position: relative;
    padding: 0 80px;
    width: 100%;
}

#timeline-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.timeline-trace {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 2s ease-in-out;
}

.timeline-trace.drawn {
    stroke-dashoffset: 0;
}

.timeline-branch {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset 0.5s ease-in-out;
}

.timeline-branch.drawn {
    stroke-dashoffset: 0;
}

.timeline-node {
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.timeline-node.lit {
    fill: #00F0FF;
    stroke: #00F0FF;
}

.timeline-ripple {
    opacity: 0;
}

.timeline-ripple.rippling {
    animation: nodeRipple 0.8s ease-out forwards;
}

@keyframes nodeRipple {
    0% { r: 4; opacity: 0.8; }
    100% { r: 16; opacity: 0; }
}

.timeline-labels {
    position: relative;
    height: 80px;
    margin-top: -20px;
}

.timeline-event {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.timeline-event.visible {
    opacity: 1;
}

.event-description {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 13px;
    color: #A0B8C8;
    margin-bottom: 4px;
    white-space: nowrap;
}

.event-date {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #00F0FF;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ================================================
   Level 4 - Transmission Log
   ================================================ */
#level-4 {
    background: #060B11;
}

.level-4-content {
    max-width: 800px;
    margin: 0 auto;
}

.terminal-header {
    color: #00F0FF;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
    margin-bottom: 40px;
}

.terminal-block {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #00F0FF;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    line-height: 1.8;
}

.terminal-line {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.terminal-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-line.spacer {
    height: 14px;
    opacity: 1;
    transform: none;
}

.terminal-line.indent {
    padding-left: 40px;
    color: #A0B8C8;
    text-shadow: none;
}

.terminal-timestamp {
    color: #1A2A3A;
    margin-right: 8px;
}

.terminal-line.visible .terminal-timestamp {
    color: #A0B8C8;
}

#terminal-cursor {
    width: 10px;
    height: 18px;
    background: #00F0FF;
    margin-top: 20px;
    opacity: 0;
}

#terminal-cursor.visible {
    animation: cursorBlink 1s step-end infinite;
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 768px) {
    .level-content {
        padding: 30px 24px;
    }

    .permit-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        max-height: 70vh;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .permit-grid::-webkit-scrollbar {
        display: none;
    }

    .section-header {
        font-size: 24px;
    }

    #bureau-title {
        font-size: 22px;
    }

    .timeline-container {
        padding: 0 20px;
    }

    .event-description {
        font-size: 10px;
    }

    .event-date {
        font-size: 10px;
    }

    .classification-badge {
        position: relative;
        margin-bottom: 20px;
        display: inline-block;
    }

    #bureau-access-btn {
        top: 12px;
        left: 12px;
        font-size: 10px;
        padding: 4px 8px;
    }

    #progress-indicator {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .permit-watermark {
        font-size: 120px;
    }

    .level-3-content {
        overflow-x: auto;
    }
}
