/* gamelicen.se - Light-academia + punk defiance */

:root {
    --bg-main: #FAFAF5;
    --bg-sidebar: #F5F0E8;
    --bg-card: #EEEAE0;
    --text-heading: #2A2640;
    --text-body: #3D3A4A;
    --text-muted: #6B6580;
    --accent-circuit: #8B8BA0;
    --accent-rebel: #C44B3F;
    --accent-link: #A8A0B8;
    --skeleton-base: #E8E3DA;
    --skeleton-bright: #F0ECE4;
    --mesh-cool: #D4D0E8;
    --mesh-warm: #E8DFD0;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--text-body);
    background: var(--bg-main);
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */

#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 100;
    clip-path: polygon(
        0% 0%, 
        92% 0%, 
        93% 2%, 
        91% 4%, 
        94% 6%, 
        92% 9%, 
        95% 12%, 
        91% 15%, 
        93% 18%, 
        92% 22%, 
        94% 25%, 
        91% 28%, 
        93% 32%, 
        95% 35%, 
        92% 38%, 
        94% 42%, 
        91% 45%, 
        93% 48%, 
        92% 52%, 
        94% 55%, 
        91% 58%, 
        95% 62%, 
        92% 65%, 
        93% 68%, 
        91% 72%, 
        94% 75%, 
        92% 78%, 
        93% 82%, 
        91% 85%, 
        94% 88%, 
        92% 92%, 
        93% 95%, 
        91% 98%, 
        93% 100%, 
        0% 100%
    );
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    padding: 48px 24px 24px 32px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-heading);
    transform: rotate(-1.5deg);
    margin-bottom: 48px;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-link {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 18px;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    transform: rotate(var(--rotate-n, -1deg));
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative;
    padding-right: 12px;
}

.sidebar-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    height: 0;
    border-top: 1px dashed var(--accent-link);
    width: 0;
    transition: width 0.4s ease-out;
    transform: translateY(-50%);
}

.sidebar-link:hover::after {
    width: 60px;
}

.sidebar-link:hover {
    color: var(--text-heading);
}

.sidebar-link.active {
    color: var(--accent-rebel);
    font-weight: 700;
    transform: rotate(calc(var(--rotate-n, -1deg) + 1deg));
}

/* ===== MOBILE BANNER ===== */

#mobile-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-sidebar);
    z-index: 100;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(42, 38, 64, 0.08);
}

.mobile-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-heading);
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-nav-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
}

.mobile-nav-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-link {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 16px;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 8px;
    transition: color 0.3s ease;
}

.mobile-link.active {
    color: var(--accent-rebel);
    font-weight: 700;
}

/* ===== MAIN CONTENT ===== */

#main-content {
    margin-left: 280px;
    min-height: 100vh;
    box-shadow: inset 8px 0 16px -8px rgba(42, 38, 64, 0.06);
}

/* ===== SCENES ===== */

.scene {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scene--cool {
    background:
        radial-gradient(ellipse at 20% 30%, var(--mesh-cool) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, var(--mesh-warm) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 10%, rgba(168, 160, 184, 0.15) 0%, transparent 40%),
        var(--bg-main);
}

.scene--neutral {
    background:
        radial-gradient(ellipse at 60% 20%, rgba(212, 208, 232, 0.3) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 80%, rgba(232, 223, 208, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 50%, rgba(168, 160, 184, 0.12) 0%, transparent 35%),
        var(--bg-main);
}

.scene--warm {
    background:
        radial-gradient(ellipse at 40% 40%, var(--mesh-warm) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 20%, rgba(212, 208, 232, 0.25) 0%, transparent 45%),
        radial-gradient(ellipse at 20% 80%, rgba(232, 223, 208, 0.35) 0%, transparent 50%),
        var(--bg-main);
}

.scene--warm-strong {
    background:
        radial-gradient(ellipse at 30% 25%, var(--mesh-warm) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 75%, rgba(232, 223, 208, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 15%, rgba(212, 208, 232, 0.2) 0%, transparent 40%),
        var(--bg-main);
}

.scene--cool-deep {
    background:
        radial-gradient(ellipse at 15% 60%, var(--mesh-cool) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 30%, rgba(212, 208, 232, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(168, 160, 184, 0.18) 0%, transparent 40%),
        var(--bg-main);
}

.scene-content {
    padding: 80px 80px 60px 80px;
    max-width: 800px;
    position: relative;
}

/* ===== TYPOGRAPHY ===== */

.scene-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    color: var(--text-heading);
    letter-spacing: 0.01em;
    line-height: 1.15;
    transform: rotate(-1deg);
    margin-bottom: 36px;
}

.scene-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    color: var(--text-body);
    line-height: 1.72;
    letter-spacing: 0.005em;
    margin-bottom: 24px;
}

.scene-body:last-of-type {
    margin-bottom: 0;
}

.code-term {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    background: var(--skeleton-base);
    padding: 2px 6px;
    border-radius: 3px;
    color: #5A5670;
}

/* ===== ANNOTATIONS ===== */

.annotation {
    position: absolute;
    top: var(--ann-top, 20%);
    right: var(--ann-right, 0%);
    transform: rotate(var(--ann-rotate, -2deg));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.scene.revealed .annotation {
    opacity: 1;
}

.scene.revealed .annotation:nth-child(1) {
    transition-delay: 0.8s;
}

.scene.revealed .annotation:nth-child(2) {
    transition-delay: 0.9s;
}

.annotation-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--accent-link);
    padding-bottom: 2px;
}

/* ===== SKELETON LOADING ===== */

.skeleton-layer {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: absolute;
    top: 80px;
    left: 80px;
    right: 80px;
    max-width: 640px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.scene.revealed .skeleton-layer {
    opacity: 0;
    pointer-events: none;
}

.skeleton-block {
    border-radius: 8px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-bright) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-block--title {
    width: 55%;
    height: 48px;
    transform: rotate(-1deg);
}

.skeleton-block--text {
    width: 100%;
    height: 18px;
}

.skeleton-block--text-short {
    width: 65%;
    height: 18px;
}

.skeleton-block--text-med {
    width: 82%;
    height: 18px;
}

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

.real-content {
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
    position: relative;
}

.scene.revealed .real-content {
    opacity: 1;
}

/* ===== CIRCUIT DIVIDERS ===== */

.circuit-divider {
    padding: 0 80px;
    margin-top: auto;
    margin-bottom: 0;
}

.circuit-svg {
    width: 100%;
    height: 30px;
    overflow: visible;
}

.circuit-path {
    fill: none;
    stroke: var(--accent-circuit);
    stroke-width: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.circuit-divider.animated .circuit-path {
    stroke-dashoffset: 0;
}

.circuit-node {
    fill: var(--accent-circuit);
    opacity: 0;
    transition: opacity 0.4s ease 0.8s, fill 0.4s ease 0.8s;
}

.circuit-divider.animated .circuit-node {
    opacity: 1;
}

.circuit-node--broken {
    fill: var(--accent-rebel);
}

.circuit-divider.animated .circuit-node--broken {
    fill: var(--accent-rebel);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    #sidebar {
        display: none;
    }

    #mobile-banner {
        display: flex;
    }

    #main-content {
        margin-left: 0;
        padding-top: 60px;
    }

    .scene-content {
        padding: 48px 24px 40px 24px;
    }

    .skeleton-layer {
        top: 48px;
        left: 24px;
        right: 24px;
    }

    .circuit-divider {
        padding: 0 24px;
    }

    .annotation {
        display: none;
    }

    .scene-heading {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .scene-content {
        padding: 60px 48px 40px 48px;
    }

    .skeleton-layer {
        left: 48px;
        right: 48px;
    }

    .circuit-divider {
        padding: 0 48px;
    }
}
