* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #000000 0%, #232323 100%);;
    color: #fff;
    overflow-x: hidden;
}

#loading {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #00ffff;
}

/* Main */
#main-content {
    opacity: 0;
    transition: opacity 1s ease;
}

#main-content.visible {
    opacity: 1;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: clamp(1rem, 3vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: start;
    z-index: 100;
}

.logo {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: bold;
    line-height: 1.2;
}

nav {
    text-align: right;
}

nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

nav a:hover {
    color: #00ffff;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 3vw, 2rem);
    position: relative;
}

.hero-text {
    margin-left: clamp(20px, 5vw, 100px);
    flex: 1;
    z-index: 10;
}

.hero-text h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-text .title1 {
    font-size: clamp(24px, 4vw, 40px);
    font-style: italic;
    font-weight: 300;
}

.hero-text .title2 {
    font-size: clamp(40px, 6vw, 60px);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* katt på gud */
.cat-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    position: relative;
    min-height: 500px;
}

#canvas-container {
    width: min(500px, 90vw);
    height: min(500px, 90vw);
    position: relative;
}

#cat-canvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* About */
.about {
    padding: clamp(2rem, 5vw, 4rem) 2rem;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 2rem;
}

.about-text {
    margin-left: clamp(20px, 10vw, 200px);
    flex: 1;
    max-width: 600px;
}

.about-image {
    flex: 1;
}

.about-image img {
    cursor: pointer;
    margin-left: clamp(20px, 16vw, 250px);
    max-width: 80%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.about-text h2 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #00ffff;
    margin-bottom: 2rem;
}

.about-text p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-text strong {
    color: #00ffff;
}

/* Projects */
.projects {
    margin-left: clamp(20px, 10vw, 200px);
    padding: clamp(2rem, 5vw, 4rem) 2rem;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-list {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    flex-wrap: wrap;
}

.project-item {
    flex: 1;
    background: #222;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.project-item h3 {
    margin-top: 0;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin-bottom: 0.5rem;
}

.project-item p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-item a {
    color: #00ffff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.project-item a:hover {
    color: #fff;
}

/* Övningar */

.exercises {
    margin-left: clamp(20px, 10vw, 200px);
    padding: clamp(2rem, 5vw, 4rem) 2rem;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.exercise-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem;
}

.exercise-item {
    flex: 1;
    background: #222;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.exercise-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.exercise-item h3 {
    margin-top: 0;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin-bottom: 0.5rem;
}

.exercise-item p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.exercise-item a {
    color: #00ffff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.exercise-item a:hover {
    color: #fff;
}


/* Footer */
footer {
    padding: clamp(1.5rem, 3vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: end;
    border-top: 1px solid #333;
    margin-top: clamp(2rem, 5vw, 4rem);
}

footer a {
    color: #00ffff;
}

.time {
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}

.social-links {
    display: flex;
    gap: clamp(15px, 3vw, 25px);
}

.social-links a {
    display: block;
    color: #fff;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
}

.social-links a:hover {
    color: #00ffff;
}

.copyright {
    text-align: right;
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    nav a {
        font-size: 0.9rem;
    }

    .hero {
        min-height: auto;
        margin-top: 200px;
        margin-bottom: 0;
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }

    .hero-text {
        flex: 0;
        margin-left: 0;
        margin-bottom: 2rem;
    }

    .cat-container {
        flex: 0;
        margin-bottom: 50px;
    }

    #canvas-container {
        width: min(350px, 85vw);
        height: min(350px, 85vw);
    }

    .about {
        flex-direction: column;
        padding: 2rem 1rem;
    }

    .about-text {
        margin-left: 0;
        max-width: 100%;
    }

    .about-image {
        width: 100%;
    }

    .about-image img {
        margin-left: 0;
        max-width: 100%;
    }

    footer {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .copyright {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .hero-text .title1 {
        top: 800px;
        font-size: 20px;
    }

    .hero-text .title2 {
        font-size: 36px;
    }

    #canvas-container {
        width: min(280px, 85vw);
        height: min(280px, 55vw);
    }

    .social-links {
        flex-direction: column;
        gap: 10px;
    }
}