/* ===========================================
   gamelicense.info - Cyberpunk Data Terminal
   =========================================== */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0A0C1C;
    --bg-panel: #111428;
    --accent-cyan: #00E5FF;
    --accent-magenta: #FF006E;
    --accent-violet: #7B2FBE;
    --text-primary: #C8D6E5;
    --text-muted: #6C7A89;
    --accent-green: #00FF88;
    --accent-warning: #FFB800;
    --hud-inset: 16px;
    --panel-bg: rgba(10, 12, 28, 0.85);
    --panel-border: rgba(0, 229, 255, 0.15);
    --bracket-color: rgba(0, 229, 255, 0.4);
    --bracket-size: 12px;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    font-size: 16px;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Scan Line Overlay --- */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 229, 255, 0.03) 2px,
        rgba(0, 229, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#scanlines.visible {
    opacity: 1;
}

/* --- Grid Underlay --- */
#grid-underlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(0, 229, 255, 0.03) 0px,
            rgba(0, 229, 255, 0.03) 1px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 229, 255, 0.03) 0px,
            rgba(0, 229, 255, 0.03) 1px,
            transparent 1px,
            transparent 40px
        );
    pointer-events: none;
    z-index: 0;
}

/* --- HUD Frame --- */
#hud-frame {
    position: fixed;
    top: var(--hud-inset);
    left: var(--hud-inset);
    right: var(--hud-inset);
    bottom: var(--hud-inset);
    border: 1px solid rgba(0, 229, 255, 0.3);
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    animation: hudPulse 4s ease-in-out infinite;
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transition: opacity 0.3s ease;
}

#hud-frame.visible {
    animation: hudDraw 0.6s ease-out forwards, hudPulse 4s ease-in-out 0.6s infinite;
}

#hud-frame.intensify {
    border-color: rgba(0, 229, 255, 0.6);
}

@keyframes hudDraw {
    0% {
        clip-path: polygon(
            50% 0%, 50% 0%,
            50% 100%, 50% 100%
        );
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        clip-path: polygon(
            0% 0%, 100% 0%,
            100% 100%, 0% 100%
        );
        opacity: 1;
    }
}

@keyframes hudPulse {
    0%, 100% { border-color: rgba(0, 229, 255, 0.2); }
    50% { border-color: rgba(0, 229, 255, 0.4); }
}

/* --- Data Rain Canvas --- */
#data-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#data-rain.visible {
    opacity: 1;
}

#data-rain.fast {
    opacity: 1;
}

/* --- Main Wrapper --- */
#main-wrapper {
    position: relative;
    z-index: 2;
    perspective: 1200px;
}

/* --- Snap Sections --- */
.snap-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px calc(var(--hud-inset) + 40px);
    scroll-snap-align: start;
    position: relative;
}

/* --- Hero Section --- */
#hero {
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#hero-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    opacity: 0;
    position: relative;
}

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

#hero-title.glitch-active {
    animation: glitchText 0.3s steps(2) forwards;
}

@keyframes glitchText {
    0% {
        text-shadow:
            2px 0 var(--accent-magenta),
            -2px 0 var(--accent-cyan);
        clip-path: inset(20% 0 30% 0);
    }
    25% {
        text-shadow:
            -2px 0 var(--accent-magenta),
            2px 0 var(--accent-cyan);
        clip-path: inset(50% 0 10% 0);
    }
    50% {
        text-shadow:
            2px 0 var(--accent-magenta),
            -2px 0 var(--accent-cyan);
        clip-path: inset(10% 0 60% 0);
    }
    75% {
        text-shadow:
            -1px 0 var(--accent-magenta),
            1px 0 var(--accent-cyan);
        clip-path: inset(40% 0 20% 0);
    }
    100% {
        text-shadow:
            0 0 20px rgba(0, 229, 255, 0.5);
        clip-path: inset(0 0 0 0);
    }
}

#hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.08em;
    color: var(--accent-cyan);
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-cyan);
    width: 0;
}

#hero-subtitle.typing {
    opacity: 1;
    animation: typewriter 1.6s steps(40) forwards, blinkCursor 0.6s step-end infinite;
}

#hero-subtitle.typing-done {
    border-right-color: transparent;
    animation: blinkCursorFade 0.6s step-end 3;
}

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

@keyframes blinkCursor {
    50% { border-right-color: transparent; }
}

@keyframes blinkCursorFade {
    50% { border-right-color: transparent; }
}

#scroll-chevron {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: chevronBounce 2s ease-in-out infinite;
}

#scroll-chevron.visible {
    opacity: 1;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* --- Typography --- */
.section-heading {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 24px;
    position: relative;
}

.section-heading:hover {
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

.section-heading-large {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
}

.section-subheading {
    font-family: 'Orbitron', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.body-text {
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 16px;
    max-width: 680px;
}

.body-text-centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.mono-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.meta-text {
    color: var(--text-muted);
    margin-top: 12px;
}

.accent-magenta { color: var(--accent-magenta); }
.accent-green { color: var(--accent-green); }
.accent-cyan { color: var(--accent-cyan); }
.accent-warning { color: var(--accent-warning); }

/* --- Section Grid Layouts --- */
.section-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    width: 100%;
    max-width: 1200px;
    align-items: start;
}

.section-grid-wide {
    grid-template-columns: 1fr;
}

.section-grid-thirds {
    grid-template-columns: repeat(3, 1fr);
}

.section-grid-center {
    grid-template-columns: 1fr;
    justify-items: center;
}

/* --- Panels --- */
.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 229, 255, 0.06),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.panel:hover::before {
    opacity: 1;
}

.panel-main {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-main.animated {
    opacity: 1;
    transform: translateX(0);
}

.panel-side {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.panel-side.animated {
    opacity: 1;
}

.panel-wide {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.panel-wide.animated {
    opacity: 1;
}

.panel-full {
    opacity: 0;
    transition: opacity 0.8s ease;
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.panel-full.animated {
    opacity: 1;
}

.panel-final {
    opacity: 0;
    transition: opacity 0.8s ease;
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.panel-final.animated {
    opacity: 1;
}

/* --- Corner Brackets --- */
.corner-bracket {
    position: absolute;
    width: var(--bracket-size);
    height: var(--bracket-size);
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.corner-tl {
    top: 0;
    left: 0;
    border-top: 1px solid var(--bracket-color);
    border-left: 1px solid var(--bracket-color);
}

.corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid var(--bracket-color);
    border-right: 1px solid var(--bracket-color);
}

.panel:hover .corner-tl {
    transform: translate(-4px, -4px);
}

.panel:hover .corner-br {
    transform: translate(4px, 4px);
}

/* --- Terminal Gutter --- */
.terminal-gutter {
    width: 100%;
    max-width: 1200px;
    height: 2px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.terminal-gutter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s ease-out;
}

.terminal-gutter.animated::after {
    transform: scaleX(1);
}

/* --- License Card --- */
.license-card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--panel-border);
    padding: 24px;
    overflow: hidden;
}

.license-card-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(0, 229, 255, 0.08) 45%,
        rgba(123, 47, 190, 0.08) 55%,
        transparent 70%
    );
    background-size: 300% 300%;
    animation: shimmer 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { background-position: 100% 100%; }
    50% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.license-card-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    position: relative;
    z-index: 1;
}

.license-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.license-value {
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* --- Timeline --- */
.timeline {
    margin-top: 32px;
    position: relative;
}

.timeline-line {
    width: 100%;
    height: 4px;
    margin-bottom: 24px;
    position: relative;
}

.timeline-svg {
    width: 100%;
    height: 4px;
}

.timeline-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s ease-out;
}

.timeline-line.animated .timeline-path {
    stroke-dashoffset: 0;
}

.timeline-events {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.timeline-event {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-event.animated {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 16px rgba(0, 255, 136, 0.6); }
}

.timeline-year {
    color: var(--accent-green);
    font-size: 0.85rem;
    font-weight: 600;
}

.timeline-desc {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- License Type Panels --- */
.panel-type {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-type.animated {
    opacity: 1;
    transform: translateY(0);
}

.panel-type-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

.accent-border-cyan {
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.accent-border-magenta {
    background: var(--accent-magenta);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.3);
}

.accent-border-violet {
    background: var(--accent-violet);
    box-shadow: 0 0 10px rgba(123, 47, 190, 0.3);
}

.type-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.1);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-cyan { background: var(--accent-cyan); }
.dot-magenta { background: var(--accent-magenta); }
.dot-violet { background: var(--accent-violet); }

/* --- Compliance Section --- */
#section-compliance {
    transition: background-color 0.8s ease;
}

#section-compliance.bg-shift {
    background-color: var(--bg-panel);
}

.compliance-icon-wrapper {
    margin-bottom: 32px;
}

.shield-svg {
    width: 120px;
    height: 140px;
}

.shield-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 2s ease-out;
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.3));
}

.shield-check {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    transition: stroke-dashoffset 0.8s ease-out 1.5s;
}

.shield-svg.animated .shield-path {
    stroke-dashoffset: 0;
}

.shield-svg.animated .shield-check {
    stroke-dashoffset: 0;
}

.compliance-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* --- System Status --- */
.system-status {
    margin-top: 32px;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

/* --- Glitch trigger animation --- */
.glitch-trigger {
    position: relative;
}

.glitch-trigger.glitch-active {
    animation: glitchHeading 0.3s steps(2) forwards;
}

@keyframes glitchHeading {
    0% {
        text-shadow: 2px 0 var(--accent-magenta), -2px 0 var(--accent-cyan);
        clip-path: inset(30% 0 20% 0);
    }
    33% {
        text-shadow: -2px 0 var(--accent-magenta), 2px 0 var(--accent-cyan);
        clip-path: inset(10% 0 50% 0);
    }
    66% {
        text-shadow: 1px 0 var(--accent-magenta), -1px 0 var(--accent-cyan);
        clip-path: inset(60% 0 5% 0);
    }
    100% {
        text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
        clip-path: inset(0 0 0 0);
    }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    :root {
        --hud-inset: 8px;
    }

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

    .section-grid-thirds {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .snap-section {
        padding: 40px calc(var(--hud-inset) + 24px);
    }

    .timeline-events {
        flex-wrap: wrap;
        justify-content: center;
    }

    .timeline-event {
        min-width: 120px;
    }

    .compliance-stats {
        gap: 24px;
    }
}

@media (max-width: 640px) {
    :root {
        --hud-inset: 4px;
        --bracket-size: 8px;
    }

    .snap-section {
        padding: 30px calc(var(--hud-inset) + 16px);
        min-height: auto;
    }

    #hero {
        min-height: 100vh;
    }

    .panel {
        padding: 20px;
    }

    .section-grid-thirds {
        gap: 16px;
    }

    .timeline-events {
        flex-direction: column;
        align-items: center;
    }

    .compliance-stats {
        flex-direction: column;
        gap: 16px;
    }

    #hero-subtitle {
        white-space: normal;
        font-size: 0.75rem;
    }
}
