/* ==========================================================================
   MUUTTUJAT JA VÄRIT
   ========================================================================== */
:root {
    --bg-primary: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --bg-element: rgba(255, 255, 255, 0.05);
    --bg-element-hover: rgba(255, 255, 255, 0.1);

    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.8);
    --text-inverted: #1c1c1e;

    --color-accent: #f5f5f7;
    --color-border: rgba(255, 255, 255, 0.15);

    --shadow-dark: rgba(0, 0, 0, 0.5);
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-glow: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   YLEISASETUKSET JA RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Nämä kaksi riviä auttavat pitämään footerin pohjalla */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 10px;
    white-space: nowrap;
}

p {
    color: var(--text-secondary);
    max-width: 650px;
    hyphens: auto;
    word-wrap: break-word;
}

/* ==========================================================================
   YHTEISET OSIORAKENTEET
   ========================================================================== */
.hero-section,
.content-section {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    scroll-margin-top: 60px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.bg-alt::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background-color: var(--bg-secondary);
    z-index: -1;
}

/* ==========================================================================
   KOMPONENTIT
   ========================================================================== */

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    width: 100%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(10px, 3vw, 30px);
    padding: 20px;
    flex-wrap: nowrap;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.nav-links a {
    position: relative;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    opacity: 0.7;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-accent);
    width: 0;
    height: 2px;
    transition: all 0.3s ease;
}

.nav-links a:not(.active):hover::after {
    width: 100%;
}

.nav-links a.active {
    opacity: 1;
}

.nav-links a.active::after {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

/* SOCIAL LINKS IN NAVBAR */
.nav-social {
    display: none;
    align-items: center;
    gap: 16px;
    margin-right: 12px;
}

.nav-icon {
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

/* SOCIAL LINKS IN NAVBAR */
.nav-social {
    display: none;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.nav-icon {
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

/* KIELENVAIHTOPAINIKE */
.lang-switch {
    margin-left: 12px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.lang-switch:hover {
    background: var(--color-accent);
    color: var(--text-inverted);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* YLEINEN NAPPI-TYYLI (Käytetään sellaiseen ota yhteyttä-napissa ja GitHubissa) */
.contact-button {
    text-decoration: none !important;
    /* Estää alleviivauksen kaikissa napeissa */
    padding: 12px 24px;
    background: var(--color-accent);
    color: var(--text-inverted);
    border: 2px solid var(--color-accent);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    min-width: 120px;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.contact-button:hover {
    background: transparent;
    color: var(--color-accent);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 8px 25px var(--shadow-glow);
}

.contact-button:active {
    transform: translateY(0) scale(0.95);
    transition: all 0.1s ease;
}

/* Erityissäännöt pienille napeille (GitHub) */
.contact-button.small {
    padding: 8px 18px;
    font-size: 0.85rem;
    min-width: auto;
}

/* ==========================================================================
   HERO-OSIO
   ========================================================================== */
.hero-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding-top: 20px;
    padding-bottom: 160px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    flex: 1;
    z-index: 1;
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    z-index: 0;
    pointer-events: none;
}

.hero-image img {
    pointer-events: auto;
    max-width: 330px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0px 10px 25px var(--shadow-dark));
    border: 2px solid rgba(245, 245, 247, 0.05);
    box-shadow: inset 0 0 20px var(--shadow-dark), 0 0 20px var(--shadow-glow);
    transition: all 0.4s ease;
    animation: float 6s ease-in-out infinite alternate;
}

.hero-image img:hover {
    filter: drop-shadow(0px 15px 35px var(--shadow-dark));
    box-shadow: inset 0 0 30px var(--shadow-dark), 0 0 30px var(--shadow-glow);
    scale: 1.03;
}

@keyframes float {
    0% {
        translate: 0 0px;
    }

    100% {
        translate: 0 -8px;
    }
}

/* ==========================================================================
   ESITTELY-OSIO
   ========================================================================== */
.about-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.about-image {
    display: none;
}

.about-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.about-textbox {
    width: 100%;
    padding: 20px;
    background: var(--bg-element);
    border-radius: 8px;
    border-left: 3px solid var(--color-accent);
}

/* ==========================================================================
   PROJEKTIT-OSIO
   ========================================================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    width: 100%;
}

.project-card {
    background: var(--bg-element);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--shadow-dark), 0 0 15px var(--shadow-glow);
    background: var(--bg-element-hover);
}

.project-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* add gap below summary text inside project card */
.project-summary {
    margin-bottom: 16px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: rgba(245, 245, 247, 0.1);
    color: var(--color-accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
}

.project-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 3px solid var(--color-accent);
}

.detail-item {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.project-links {
    margin-top: auto;
}

/* ==========================================================================
   YHTEYSTIEDOT-OSIO
   ========================================================================== */
.contact-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--bg-element);
    border-radius: 8px;
    border-left: 3px solid var(--color-accent);
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--bg-element-hover);
    transform: translateX(5px);
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-link {
    position: relative;
    width: fit-content;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
}

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

.contact-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-primary);
    /* Pidetään sama tumma tausta */
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    /* Työntää footerin pohjalle */
}

.site-footer p {
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   RESPONSIIVISUUS
   ========================================================================== */

@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding-top: 60px;
    }

    .hero-image {
        display: flex !important;
        order: -1;
        justify-content: center;
        width: 100%;
    }

    .hero-image img {
        max-width: 220px;
    }

    .hero-content {
        align-items: center;
    }

    .nav-links {
        padding: 30px 20px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }
}

@media (min-width: 768px) {
    .nav-social {
        display: flex;
    }

    .about-grid {
        flex-direction: row;
        align-items: center;
        gap: 60px;
    }

    .about-image {
        display: block;
        flex: 1;
    }

    .about-image img {
        width: 100%;
        max-width: 280px;
        border-radius: 12px;
        box-shadow: -15px 15px 0px var(--shadow-glow);
        transition: all 0.3s ease;
    }

    .about-image img:hover {
        box-shadow: -20px 20px 0px var(--shadow-glow);
        scale: 1.05;
    }

    .about-text {
        flex: 1;
    }
}