/* Lisää nämä importit tiedoston alkuun */
@import "variables-dark.css";
@import "variables-light.css";

/* Käytä muuttujia läpi tiedoston */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.hero-overlay { background: var(--hero-overlay); }
.process-overlay { background: var(--process-overlay); }

.service-card, .contact-card { background: var(--card-bg); }
.step-card { background: var(--step-card-bg); backdrop-filter: blur(12px); }

/* Varmista että painikkeet ja muut elementit käyttävät muuttujia */
.hero-container, .process-section, .hero-container h1, .process-section h2 {
    color: var(--hero-text-color);
}


/* =========================================
   1. MUUTTUJAT & PERUSASETUKSET
   ========================================= */
:root {
    /* Fontit */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --font-code: 'Courier New', monospace;

    /* Teemavärit (Punainen jaaltonen.dev / SivutKuntoon tyyli) */
    --primary-color: #e63946; 
    --primary-hover: #c1121f; 
    
    /* Tumma teema (Oletus) */
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --nav-bg: rgba(30, 41, 59, 0.95);
    --border-color: rgba(255, 255, 255, 0.1);
    --overlay-color: rgba(15, 23, 42, 0.8);
}

.light-theme {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --overlay-color: rgba(255, 255, 255, 0.85);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; 
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* =========================================
   2. NAVIGAATIO
   ========================================= */
header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex; justify-content: space-between; align-items: center;
    height: 80px; max-width: 1200px; margin: 0 auto; padding: 0 2rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 800;
    text-decoration: none; color: var(--text-color);
}

.logo span { color: var(--primary-color); }

.nav-links { display: flex; list-style: none; align-items: center; gap: 2rem; }

.nav-links a { 
    text-decoration: none; color: var(--text-color); 
    font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--primary-color); }

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1); border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

.light-theme .icon-sun, .dark-theme .icon-moon { display: none; }

/* =========================================
   3. PAINIKKEET (Kattaa btn-primary ja btn-secondary)
   ========================================= */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff !important;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-color) !important;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #ffffff !important;
}

/* =========================================
   4. HERO-OSIO & PARALLAX
   ========================================= */
.hero {
    height: 100vh;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    text-align: center;
}

.hero-bg-image {
    position: absolute; top: -10%; left: 0; width: 100%; height: 120%;
    background-image: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?q=80&w=2070');
    background-size: cover; background-position: center;
    z-index: 1; will-change: transform;
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay-color);
    z-index: 2;
}

.hero-content { position: relative; z-index: 10; }

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.hero-btns { 
    display: flex; 
    margin-top: 2em;
    gap: 1rem; 
    justify-content: center; 
}

/* =========================================
   5. GRIDIT JA KORTIT (Palvelut, Prosessi, Yhteys)
   ========================================= */
section { padding: 100px 0; border-bottom: 1px solid var(--border-color); }

.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-header h2::after {
    content: ''; display: block; width: 60px; height: 4px;
    background: var(--primary-color); margin: 10px auto;
}

/* Yleinen korttien asettelu */


/* Palvelukorttien sisällön keskittäminen */
.service-card {
    display: flex;
    flex-direction: column;
    align-items: center; /* Keskittää sisällön vaakasuunnassa */
    text-align: center;  /* Keskittää tekstin */
    background: var(--nav-bg);
    padding: 50px 40px;  /* Lisätään hieman pystysuuntaista tilaa */
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Kuvakkeiden suurennus ja korostus */
.service-icon {
    font-size: 4rem;      /* Suurempi koko (aiemmin n. 3rem) */
    margin-bottom: 25px;  /* Enemmän väliä otsikkoon */
    display: block;
    line-height: 1;
    /* Lisätään hienovaraista hehkua tai varjoa, jotta emoji "pomppaa" */
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}
.services-grid, .process-steps, .portfolio-grid, .contact-grid {
    display: grid;
    /* Pienennä 300px -> 250px, jolloin 3 mahtuu paremmin rinnakkain */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px; /* Hieman pienempi rako auttaa myös tilanahtaudessa */
    width: 100%;
}

.services-grid, .process-steps {
    display: grid;
    /* Pienennetään kynnystä (300px -> 250px), jotta 3 mahtuu varmasti rinnakkain */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    width: 100%;
}

/* Palvelu- ja Prosessikorttien keskitys */
.service-card, .step-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

/* Palvelut-osion emojit */
.service-icon {
    font-size: 4rem; 
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
}

/* Prosessi-osion numerot isommiksi */
.step-number {
    width: 70px;  /* Suurennettu 45px -> 70px */
    height: 70px; /* Suurennettu 45px -> 70px */
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem; /* Numero isommaksi */
    font-weight: 800;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

/* Pieni animointi molempiin */
.service-card:hover .service-icon,
.step-card:hover .step-number {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--nav-bg);
    padding: 30px 20px; /* Pienennetään sivujen paddingia, pidetään pystyväli */
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.service-icon {
    font-size: 3.5rem; /* Hieman pienempi kuin 4rem, jos tila on todella tiukilla */
    margin-bottom: 20px;
}

/* Tehdään kuvakkeesta hieman elävämmän tuntuinen hoverissa */
.service-card:hover .service-icon {
    transform: scale(1.1); /* Kuvake kasvaa hieman kun kortin päälle viedään hiiri */
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.6rem;
    font-family: var(--font-heading);
}

.service-card p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.8;
}

.service-card, .step-card, .contact-card {
    background: var(--nav-bg);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}



.step-number {
    width: 45px; height: 45px; background: var(--primary-color);
    color: white; border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    font-weight: bold; margin-bottom: 20px;
}

/* =========================================
   6. PORTFOLIO
   ========================================= */
.portfolio-section {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.portfolio-card {
    background: var(--card-bg); /* Varmista että tämä on määritelty teemoissa */
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--card-color); /* Käyttää HTML:ssä määriteltyä väriä pohjana */
    opacity: 0.8;
    transition: 0.3s;
}

.portfolio-card:hover .card-image {
    opacity: 1;
}

.card-content {
    padding: 25px;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, var(--card-color) 100%);
    flex-grow: 1;
}

.card-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #fff;
}

.card-content p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
}

.card-link {
    color: var(--primary-color) !important; /* Käytetään brändin punaista */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto;
    transition: opacity 0.3s ease;
}

.card-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* --- VAALEAN TEEMAN KORJAUS --- */
.light-theme .portfolio-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.light-theme .card-content {
    /* Poistetaan liuku ja käytetään kiinteää väriä tai hyvin vaaleaa sävyä */
    background: #f9f9f9; 
}

.light-theme .card-content h3 {
    color: #1a1a1a !important; /* Tumma teksti */
}

.light-theme .card-content p {
    color: #444444 !important; /* Tummanharmaa teksti */
}

.light-theme .card-link {
    color: var(--primary-color); /* Käytetään brändin punaista linkissä */
}

.light-theme .card-image {
    opacity: 1; /* Kuvat näkyvät kirkkaana */
}

.light-theme .portfolio-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* =========================================
   7. PROSESSI-OSION PARALLAX
   ========================================= */
.process-section {
    position: relative;
    padding: 100px 0;
    /* Vaihda 'taustakuva.jpg' omaan polkuusi */
    background-image: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?q=80&w=2070'); 
    background-attachment: fixed; /* Tämä luo parallax-efektin */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: color 0.3s ease;
}

/* Tumma kerros kuvan päällä (Oletus) */
.process-section::before {
    content: "";
    position: absolute;
    /* Venytetään 1px yli raitojen välttämiseksi */
    top: -1px; 
    left: 0;
    width: 100%;
    height: calc(100% + 2px); 
    background: rgba(10, 10, 10, 0.85);
    z-index: 1;
}

/* Varmistetaan että sisältö on kerroksen päällä */
.process-section .container {
    position: relative;
    z-index: 2;
}

/* background-image: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?q=80&w=2070'); */

/* --- VAALEA TEEMA KORJAUS --- */

/* Muista päivittää myös vaalean teeman overlay */
.light-theme .process-section::before {
    background: rgba(255, 255, 255, 0.9);
}
/* Kun bodylla on .light-theme, muutetaan prosessiosion tekstit tummiksi */
.light-theme .process-section {
    background-color: #ffffff; /* Tai sivustosi vaalea taustaväri */
}

.light-theme .process-section h2,
.light-theme .process-section .section-header h2,
.light-theme .process-section h3 {
    color: #ffffff !important; /* Pakotetaan tumma väri */
}

/* Jos prosessikorteissa on omat taustat vaaleassa teemassa */
.light-theme .process-step {
    background-color: #f9f9f9;
    border: px solid #eeeeee;
}

/* =========================================
   7. YHTEYSTIEDOT - Päivitetty
   ========================================= */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 50px 30px; /* Lisää pystysuuntaista tilaa */
    border-radius: 16px;
    text-align: center; /* Keskittää tekstin */
    display: flex;
    flex-direction: column;
    align-items: center; /* Keskittää ikonit ja sisällön vaakasuunnassa */
    justify-content: center;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

/* Yhteystietoikonit isompana */
.contact-icon {
    font-size: 4.5rem; /* Suurennettu 2.5rem -> 4.5rem */
    margin-bottom: 25px;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.contact-card h3 {
    margin-bottom: 15px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.contact-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    word-break: break-word;
    transition: opacity 0.3s;
}

.contact-card a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* =========================================
   8. FOOTER & MOBIILI
   ========================================= */
.main-footer { padding: 50px 0; text-align: center; background: var(--nav-bg); }

/* style.css - Footer-päivitys */
.main-footer {
    padding: 40px 0;
    background: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-content p {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-color);
    opacity: 0.8;
}


/* --- HAMPURILAINEN ICON-VERSIONA --- */
.hamburger {
    display: none; /* Piilossa desktopilla */
    cursor: pointer;
    z-index: 9999;
    padding: 5px;
    user-select: none;
}

.hamburger-icon {
    font-size: 2.5rem; /* Säädä kokoa tästä */
    line-height: 1;
    color: var(--text-color); /* Ottaa värin suoraan teemasta */
    transition: transform 0.3s ease;
}

/* Kun valikko on auki, muutetaan ikoni ristiksi tai käännetään sitä */
.hamburger.active .hamburger-icon {
    transform: rotate(90deg);
    color: var(--primary-color); /* Erottuu punaisena auki ollessaan */
}




/* Teemanvaihtaja - Sijoittelu navbarissa */
.theme-switch-wrapper {
    margin-left: auto; /* Työntää napin oikealle */
    margin-right: 20px;
    z-index: 1001;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1); /* Hieman vaaleampi tausta tummassa */
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.3s;
}

/* Vaalean teeman säädöt napille */
.light-theme .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Oletus (Tumma teema): Näytetään aurinko, jotta voi vaihtaa valoon */
.icon-sun { 
    display: block !important; 
    filter: drop-shadow(0 0 5px orange); /* Lisää hehkua, jotta näkyy varmasti */
}
.icon-moon { 
    display: none !important; 
}

/* Vaalea teema: Näytetään kuu, jotta voi vaihtaa pimeään */
.light-theme .icon-sun { 
    display: none !important; 
}
.light-theme .icon-moon { 
    display: block !important; 
    filter: none;
}




/* --- MOBIILISÄÄDÖT --- */
@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
    }
    
    /* Varmistetaan että navbar ei ole overflow: hidden */
    .navbar {
        overflow: visible !important;
    }

    /* Varmistetaan että navbar ei piilota sitä */
    .navbar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative;
        z-index: 1000;
    }

    .nav-links {
        display: none; /* Piilotetaan lista oletuksena mobiilissa */
    }

    .nav-links.active {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--nav-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 9000;
    }
}

@media (max-width: 768px) {
    .theme-switch-wrapper {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 20px;
    }
}


.hamburger { display: none; cursor: pointer; }
.hamburger span { display: block; width: 25px; height: 3px; background: var(--text-color); margin: 5px; transition: 0.3s; }

@media (max-width: 768px) {
    .nav-links { display: none; } /* Piilotetaan toistaiseksi, vaatii JS:n toimiakseen */
    .hero-btns { flex-direction: column; align-items: center; }
    .standard-grid { grid-template-columns: 1fr; }
}