/* =============================================
   gamelicensor.pro - Translucent Frost Theme
   Bioluminescent Forest / Glitch-Art Design
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0B1A14;
    --bg-mid: #132B23;
    --bg-twilight: #1A1035;
    --bg-clearing: #1A3A2A;
    --frost-surface: rgba(255, 255, 255, 0.06);
    --frost-border: rgba(255, 255, 255, 0.12);
    --text-primary: #D4E8DC;
    --text-secondary: #8BA89B;
    --accent-green: #4AFFA0;
    --accent-violet: #B86AFF;
    --accent-amber: #FFB347;
    --accent-red: #FF4A6A;
    --accent-cyan: #00F5FF;
    --scroll-progress: 0;
}

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    background: var(--bg-deep);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #132B23, #1A3A2A);
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 255, 160, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 255, 160, 0.5);
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.05;
    font-weight: 700;
}

h1 {
    font-size: 56px;
}

h2 {
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 20px;
}

h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

p {
    margin-bottom: 16px;
}

p:last-child {
    margin-bottom: 0;
}

/* --- Zone Label (Metadata Typography) --- */
.zone-label {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-green);
    display: block;
    margin-bottom: 32px;
    opacity: 0.7;
}

/* --- Main Content --- */
#main-content {
    position: relative;
    background: linear-gradient(180deg, #0B1A14 0%, #132B23 40%, #1A1035 70%, #0B1A14 100%);
    background-size: 100% 520vh;
    transition: none;
}

/* --- Zones --- */
.zone {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.zone-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 48px;
    width: 100%;
}

/* --- ZONE 1: The Canopy --- */
.zone-1 {
    min-height: 100vh;
    background: var(--bg-deep);
}

.zone-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.canopy-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tree-group {
    transform-origin: center bottom;
}

.tree-1 { animation: treeSway 8s ease-in-out infinite; }
.tree-2 { animation: treeSway 9s ease-in-out infinite 1s; }
.tree-3 { animation: treeSway 7s ease-in-out infinite 2s; }
.tree-4 { animation: treeSway 10s ease-in-out infinite 0.5s; }
.tree-5 { animation: treeSway 8.5s ease-in-out infinite 1.5s; }
.tree-6 { animation: treeSway 9.5s ease-in-out infinite 3s; }

@keyframes treeSway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1.5deg); }
    75% { transform: rotate(-1.5deg); }
}

.biolum-dot {
    animation: biolumPulse 4s ease-in-out infinite;
}

.biolum-dot:nth-child(odd) {
    animation-delay: -2s;
}

@keyframes biolumPulse {
    0%, 100% { opacity: 0.2; r: 2; }
    50% { opacity: 0.6; r: 4; }
}

.frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(11, 26, 20, 0.4);
}

/* Hero Title */
.hero-title {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    opacity: 0;
    position: relative;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-title .char.revealed {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-size: 18px;
    line-height: 1.65;
    color: var(--text-primary);
    max-width: 600px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}

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

/* --- ZONE 2: The Understory --- */
.zone-2 {
    min-height: 120vh;
    background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-twilight) 100%);
}

/* --- ZONE 3: The Mycelium Network --- */
.zone-3 {
    min-height: 140vh;
    background: linear-gradient(180deg, var(--bg-twilight) 0%, var(--bg-mid) 100%);
}

.mycelium-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.mycelium-svg {
    width: 100%;
    height: 100%;
}

.mycelium-line {
    stroke-dasharray: 1440;
    stroke-dashoffset: 1440;
    will-change: stroke-dashoffset;
    transition: stroke-dashoffset 3.5s ease-out;
}

.mycelium-branch {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    will-change: stroke-dashoffset;
    transition: stroke-dashoffset 2s ease-out 1s;
}

.mycelium-node {
    opacity: 0;
    transition: opacity 1s ease-out 2s;
}

.zone-3.zone-active .mycelium-line {
    stroke-dashoffset: 0;
}

.zone-3.zone-active .mycelium-branch {
    stroke-dashoffset: 0;
}

.zone-3.zone-active .mycelium-node {
    opacity: 1;
}

/* --- ZONE 4: The Clearing --- */
.zone-4 {
    min-height: 80vh;
    background: linear-gradient(180deg, var(--bg-mid) 0%, rgba(26, 58, 42, 0.6) 50%, var(--bg-mid) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clearing-badge-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.glitch-badge {
    width: 320px;
    height: 320px;
    position: relative;
}

.badge-svg {
    width: 100%;
    height: 100%;
}

.glitch-badge .controller-base {
    filter: url(#chromatic-shift);
}

.glitch-slice {
    animation: glitchSlice 4s ease-in-out infinite;
}

.slice-1 { animation-delay: 0s; }
.slice-2 { animation-delay: 1.3s; }
.slice-3 { animation-delay: 2.7s; }

@keyframes glitchSlice {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(4px); }
    94% { transform: translateX(-3px); }
    96% { transform: translateX(2px); }
    98% { transform: translateX(-1px); }
}

.scan-lines line {
    animation: scanPulse 3s ease-in-out infinite;
}

.scan-lines line:nth-child(2) { animation-delay: 0.8s; }
.scan-lines line:nth-child(3) { animation-delay: 1.6s; }
.scan-lines line:nth-child(4) { animation-delay: 2.4s; }

@keyframes scanPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

.clearing-quote {
    text-align: center;
    border-left: none;
    padding-left: 0;
    margin-top: 40px;
}

/* --- ZONE 5: The Canopy Floor --- */
.zone-5 {
    min-height: 80vh;
    background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
    position: relative;
}

.zone-5 .zone-content {
    padding-bottom: 60px;
}

.zone-5 p {
    font-size: 16px;
    color: var(--text-secondary);
}

.zone-5 h3 {
    font-size: 24px;
}

.frost-rising {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* --- Frost Panel --- */
.frost-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
}

/* Moss noise in frost panel margins */
.frost-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    filter: url(#moss-texture);
    pointer-events: none;
    opacity: 0.5;
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 32px;
    line-height: 1.2;
    color: var(--accent-green);
    text-align: right;
    border-left: 2px solid var(--text-primary);
    padding-left: 24px;
    margin: 40px 0;
}

/* --- Fade-in Animation --- */
.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Glitch Burst --- */
.glitch-burst {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
}

.glitch-burst.active {
    animation: glitchBurst 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes glitchBurst {
    0% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
    10% {
        clip-path: inset(10% 0 80% 0);
        transform: translateX(4px);
        background: linear-gradient(90deg, rgba(74, 255, 160, 0.3) 0%, transparent 50%, rgba(0, 245, 255, 0.3) 100%);
    }
    25% {
        clip-path: inset(30% 0 40% 0);
        transform: translateX(-6px);
        background: linear-gradient(90deg, rgba(184, 106, 255, 0.3) 0%, transparent 50%, rgba(74, 255, 160, 0.3) 100%);
    }
    40% {
        clip-path: inset(60% 0 20% 0);
        transform: translateX(3px);
        background: linear-gradient(90deg, rgba(0, 245, 255, 0.3) 0%, transparent 50%, rgba(184, 106, 255, 0.3) 100%);
    }
    55% {
        clip-path: inset(20% 0 50% 0);
        transform: translateX(-2px);
        background: linear-gradient(90deg, rgba(74, 255, 160, 0.2) 0%, transparent 100%);
    }
    70% {
        clip-path: inset(50% 0 30% 0);
        transform: translateX(1px);
        background: linear-gradient(90deg, rgba(184, 106, 255, 0.15) 0%, transparent 100%);
    }
    100% {
        opacity: 0;
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
}

/* Glitch burst persistent scan line */
.glitch-burst::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    top: 50%;
    background: var(--accent-cyan);
    opacity: 0;
    transition: opacity 2s ease-out;
}

.glitch-burst.active::after {
    opacity: 0.3;
    animation: scanLineFade 2s ease-out 0.4s forwards;
}

@keyframes scanLineFade {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* --- Spore Particles --- */
#spore-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.spore {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

.spore-green {
    background: var(--accent-green);
}

.spore-violet {
    background: var(--accent-violet);
}

@keyframes sporeFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: var(--spore-opacity);
    }
    25% {
        transform: translateY(-25vh) translateX(15px);
    }
    50% {
        transform: translateY(-50vh) translateX(-15px);
        opacity: var(--spore-opacity);
    }
    75% {
        transform: translateY(-75vh) translateX(20px);
    }
    100% {
        transform: translateY(-100vh) translateX(-10px);
        opacity: 0;
    }
}

/* --- Leaf Drift --- */
#leaf-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.drifting-leaf {
    position: absolute;
    pointer-events: none;
}

@keyframes leafDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translate(var(--leaf-dx), 100vh) rotate(var(--leaf-rot));
        opacity: 0;
    }
}

/* --- Footer --- */
.site-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-mark {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--text-secondary);
}

.footer-meta {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.5;
}

.footer-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.4;
}

/* --- Links --- */
a {
    color: var(--accent-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-violet);
}

a:visited {
    color: var(--accent-violet);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 {
        font-size: 40px;
    }

    h2 {
        font-size: 32px;
    }

    h3 {
        font-size: 24px;
    }

    body {
        font-size: 16px;
    }

    .zone-content {
        padding: 60px 24px;
    }

    .pull-quote {
        font-size: 24px;
    }

    .frost-panel {
        padding: 24px;
    }

    .glitch-badge {
        width: 240px;
        height: 240px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 28px;
    }

    .zone-content {
        padding: 40px 16px;
    }

    .pull-quote {
        font-size: 20px;
        padding-left: 16px;
    }
}
