/* Created by Olli with Antigravity */

/* ==========================================================================
   Project Variables & Typography
   ========================================================================== */
@font-face {
    font-family: 'Berserker';
    src: url('../fonts/Berserker-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&family=Ubuntu+Mono:wght@400;700&display=swap');

:root {
    /* Color Palette */
    --clr-bg-main: #02111E;
    /* Deep ocean blue */
    --clr-bg-alt: #041E32;
    /* Lighter ocean blue */
    --clr-accent: #00B4D8;
    /* Bright teal/cyan */
    --clr-accent-dark: #0077B6;
    /* Darker teal */
    --clr-text-main: #E0F2FE;
    /* Light readable text */
    --clr-text-muted: #8ECAE6;
    /* Muted teal text */

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #02111E 0%, #0077B6 100%);
    --grad-secondary: linear-gradient(135deg, #041E32 0%, #023E8A 100%);
    --grad-text: linear-gradient(to right, #00B4D8, #90E0EF);

    /* Layout */
    --nav-height: 80px;
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Glassmorphism Unified */
    --glass-bg: rgba(2, 17, 30, 0.7); /* Slightly more opaque */
    --glass-blur: blur(30px); /* Slightly more blur */
    --glass-border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Global Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Berserker', sans-serif;
    color: var(--clr-text-main);
    background-color: var(--clr-bg-main);
}

body {
    overflow-x: hidden;
    line-height: 1.6;
}

h1,
h2,
h3,
.logo {
    font-family: 'Berserker', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
}

h2 {
    font-size: clamp(1.8rem, 6vw, 4rem);
    margin-bottom: 2rem;
    text-align: center;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0, 180, 216, 0.2);
}

a {
    text-decoration: none;
    color: var(--clr-text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-section {
    padding: 100px 0;
    position: relative;
    z-index: 2;
}

/* Gradients */
.gradient-bg-1 {
    background: var(--grad-primary);
}

.gradient-bg-2 {
    background: var(--grad-secondary);
}

/* ==========================================================================
   Background Particles (Animated Light Points)
   ========================================================================== */
.bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Behind content */
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 242, 254, 0.8) 0%, rgba(0, 180, 216, 0.4) 40%, rgba(0, 0, 0, 0) 70%);
    filter: blur(4px);
    animation: float 15s infinite ease-in-out alternate;
    opacity: 0.5;
}
.p1 {
    width: 150px;
    height: 150px;
    top: 10%;
    left: 15%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.p2 {
    width: 250px;
    height: 250px;
    top: 60%;
    left: 80%;
    animation-duration: 25s;
    animation-delay: -5s;
    opacity: 0.3;
}

.p3 {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-duration: 18s;
    animation-delay: -10s;
}

.p4 {
    width: 300px;
    height: 300px;
    top: 30%;
    left: 60%;
    animation-duration: 22s;
    animation-delay: -2s;
    opacity: 0.2;
}

.p5 {
    width: 80px;
    height: 80px;
    top: 45%;
    left: 5%;
    animation-duration: 15s;
    animation-delay: -7s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(40px, 40px) scale(1.05);
    }
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--clr-accent);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.4);
}

.up-arrow {
    font-size: 1.5rem;
    color: var(--clr-accent);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Ubuntu Mono', monospace;
    font-weight: 700;
}

/* Näytä nuoli, kun navbari on rullaus-tilassa */
.navbar.scrolled .up-arrow {
    opacity: 1;
    transform: translateY(0);
}

.nav-links {
    position: fixed;
    top: 0;
    right: 5%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    list-style: none;
    z-index: 1001; /* Toimiikseen irrallaan navbarista */
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--clr-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--clr-text-main);
    margin: 5px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Welcome / Hero Section
   ========================================================================== */
.parallax-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    /* Extra height for parallax */
    background-size: cover;
    background-position: center;
    z-index: 0;
    will-change: transform;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(2, 17, 30, 0.3) 0%, rgba(2, 17, 30, 1) 100%);
    z-index: 1;
}

.parallax-section .content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    margin-bottom: 35vh; /* Adjust vertical alignment to reveal background */
}

.parallax-section h1 {
    font-size: clamp(2.2rem, 8vw, 5.5rem); /* Smaller text */
    margin-bottom: 1rem;
    line-height: 1;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.parallax-section p {
    font-size: clamp(0.85rem, 4vw, 2rem);
    color: var(--clr-text-muted);
}

#hacker-text {
    min-height: 1.5em; /* Prevents container height jumping */
    white-space: nowrap;
}

/* ==========================================================================
   Gallery / Carousel Section
   ========================================================================== */
.carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.carousel-container {
    perspective: 1000px;
    width: 100%;
    max-width: 900px;
    height: 500px;
    /* Increased base height */
    position: relative;
    display: flex;
    justify-content: center;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
}

.carousel-item {
    position: absolute;
    height: 100%;
    aspect-ratio: 9 / 16;
    /* Force 9:16 ratio */
    transition: transform var(--transition), opacity var(--transition), filter var(--transition);
    opacity: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

/* Center active item */
.carousel-item.active {
    opacity: 1;
    transform: translateX(0) scale(1) translateZ(0);
    z-index: 3;
    filter: brightness(100%);
}

/* Left items */
.carousel-item.prev {
    opacity: 0.7;
    transform: translateX(-40%) scale(0.8) translateZ(-100px);
    z-index: 2;
    filter: brightness(50%);
    cursor: pointer;
}

/* Right items */
.carousel-item.next {
    opacity: 0.7;
    transform: translateX(40%) scale(0.8) translateZ(-100px);
    z-index: 2;
    filter: brightness(50%);
    cursor: pointer;
}

/* Items strictly behind */
.carousel-item.hidden-left {
    opacity: 0;
    transform: translateX(-80%) scale(0.6) translateZ(-200px);
    z-index: 1;
}

.carousel-item.hidden-right {
    opacity: 0;
    transform: translateX(80%) scale(0.6) translateZ(-200px);
    z-index: 1;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--clr-accent);
    transform: scale(1.1);
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background 0.3s ease;
}

.indicator.active {
    background: var(--clr-accent);
}

/* ==========================================================================
   Socials & Software Grids
   ========================================================================== */
#socials {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

#socials .container {
    width: 100%;
}

.social-grid,
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1.5rem;
    justify-items: center;
    margin-top: 2rem;
}

.social-card,
.software-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 100px; /* Smaller size */
    aspect-ratio: 1;
    backdrop-filter: blur(10px);
}

.social-card:hover,
.software-item:hover {
    transform: translateY(-8px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 15px rgba(0, 180, 216, 0.2);
    border-color: var(--clr-accent);
}

.social-card img,
.software-item img {
    width: 40px; /* Slightly smaller icon */
    height: 40px;
    object-fit: contain;
    margin-bottom: 0.8rem;
    transition: transform 0.3s ease;
}

.social-card:hover img,
.software-item:hover img {
    transform: scale(1.1);
}

.software-item span {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
}

/* ==========================================================================
   Contact & Footer
   ========================================================================== */
#contact {
    text-align: center;
}

.contact-info {
    margin: 3rem 0;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 40px;
    background: var(--grad-text);
    color: var(--clr-bg-main);
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-btn .btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.contact-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 180, 216, 0.4);
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Outfit', sans-serif;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-content p {
    color: var(--clr-text-muted);
}

.footer-content .small-text {
    font-size: 0.8rem;
    opacity: 0.7;
}

.footer-link {
    color: #4ADE80;
    /* Bright mint green to stand out */
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--clr-accent);
    text-decoration: underline;
}

/* ==========================================================================
   Animations & Transitions (Reveal on Scroll)
   ========================================================================== */
.reveal {
    opacity: 0;
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
}

.fade-up {
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.fade-up.active {
    transform: translateY(0);
}

.fade-left {
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.fade-left.active {
    transform: translateX(0);
}

.zoom-in {
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.zoom-in.active {
    transform: scale(1);
}

/* ==========================================================================
   Profile Hubs (Gaming & Coding)
   ========================================================================== */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap; /* Keeps mobile layout healthy */
}

/* Hub Stack for Social Grid */
.hub-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100px;
    justify-content: center;
}

.hub-container {
    position: relative;
    width: 100%;
}

.hub-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    height: 45px; /* Exactly half of 100px total including 10px gap */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100px;
}

.hub-toggle:hover {
    transform: translateY(-4px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 15px rgba(0, 180, 216, 0.2);
    border-color: var(--clr-accent);
}

.hub-toggle img {
    width: 24px; /* Smaller icon */
    height: 24px;
    object-fit: contain;
}

.hub-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 170px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(40px); /* Much stronger blur for menus */
    -webkit-backdrop-filter: blur(40px);
    background: rgba(2, 17, 30, 0.85); /* Much more opaque */
    z-index: 50;
}

.hub-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.hub-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--clr-text-main);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease, padding-left 0.3s ease;
}

.hub-link:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
    color: var(--clr-accent);
}

.hub-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.hub-link span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */
@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: var(--nav-height);
        flex-direction: column;
        background: var(--glass-bg);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        border-top: var(--glass-border);
        width: 100%;
        height: calc(100vh - var(--nav-height));
        text-align: center;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        padding-top: 2rem;
        z-index: 999; /* Jää yläpalkin alle piiloon */
    }

    .nav-links.nav-active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .hamburger {
        display: block;
    }

    /* Hamburger Animation */
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .toggle .line2 {
        opacity: 0;
    }

    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .carousel-container {
        width: 100%;
        height: 300px;
    }

    .carousel-item.prev,
    .carousel-item.next {
        opacity: 0;
        /* Simplify for mobile to a standard slider if preferred, or keep small */
        pointer-events: none;
    }
}