/* ========================================
   GLOBAALIT TYYLIT & VÄRIT
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Marginaalit sisällytetään leveyteen */
}

:root {
    /* Päävärit - muuta näistä kaikki muuttuu */
    --primary-color: #DC143C; /* Punainen (painikkeet, korostukset) */
    --dark-color: #1a1a1a;    /* Musta (nav, dark sections) */
    --light-color: #f5f5f5;   /* Vaalea harmaa (light backgrounds) */
    --text-color: #333;       /* Mustan teksti */
    --border-radius: 8px;     /* Nurkkaavien pyöristys */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;         /* Rivin korkeus tekstille */
    color: var(--text-color);
    background-color: #fff;
    overflow-x: hidden;       /* Estää mobiilissa oikealle syntyvän valkoisen kaistaleen */
}

.container {
    max-width: 1200px;        /* Maksimileveysrajoitus (big screens) */
    margin: 0 auto;           /* Keskitä sivulla */
    padding: 0 20px;          /* Sivujen välit */
}

/* ========================================
   NAVIGAATIO BAR (Yläpalkki)
   ======================================== */

.navbar {
    background-color: var(--dark-color);     /* Musta tausta */
    color: white;
    padding: 1rem 0;
    position: sticky;                        /* Pysyy ylhäällä scrollatessa */
    top: 0;
    z-index: 100;                            /* Näkyy kaiken päällä */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Varjo */
}

.navbar .container {
    display: flex;
    justify-content: space-between;          /* Logo vasemmalla, linkit oikealla */
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);             /* Punainen logo */
    letter-spacing: 2px;                     /* Välit kirjainten välissä */
}

.nav-links {
    display: flex;
    list-style: none;                        /* Poista listatyylejä */
    gap: 2rem;                               /* Väli linkkien välissä */
}

.nav-links a {
    color: white;
    text-decoration: none;                   /* Poista alusviiva */
    transition: color 0.3s ease;              /* Sileä värinmuutos */
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);             /* Muutu punaiseksi kun hover */
}

/* ========================================
   HERO OSIO (Suuret tekstit, taustakuva)
   ======================================== */

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 36%, rgba(220, 20, 60, 0.22), transparent 28%),
        linear-gradient(135deg, #111 0%, #1c1c1c 58%, #090909 100%);
    color: rgb(255, 255, 255);
    padding: 110px 20px;
    text-align: left;
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
    align-items: center;
    gap: 48px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.35;
}

.hero-content,
.hero-showcase {
    position: relative;
    z-index: 1;
}

.hero-content {
    width: min(720px, 100%);
    justify-self: end;
}

.hero-kicker {
    color: var(--primary-color);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 4.8rem);
    line-height: 0.95;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: 0;
    max-width: 720px;
}

.hero-content .tagline {
    font-size: 1.18rem;
    margin-bottom: 2rem;
    color: #d2d2d2;
    max-width: 610px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.hero-showcase {
    justify-self: start;
    width: min(420px, 100%);
    min-height: 390px;
}

.showcase-card {
    position: absolute;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: var(--border-radius);
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.showcase-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(0.9) contrast(1.05);
}

.showcase-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(0,0,0,0.82));
}

.showcase-card span,
.showcase-note {
    position: absolute;
    z-index: 2;
}

.showcase-card span {
    left: 22px;
    bottom: 20px;
    font-weight: 900;
    color: white;
}

.showcase-card-main {
    width: 330px;
    height: 240px;
    left: 0;
    top: 30px;
}

.showcase-card-main::before {
    background-image: url('https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=900&h=700&fit=crop');
}

.showcase-card-side {
    width: 250px;
    height: 190px;
    right: 0;
    bottom: 38px;
}

.showcase-card-side::before {
    background-image: url('https://images.unsplash.com/photo-1607860108855-64acf2078ed9?w=900&h=700&fit=crop');
}

.showcase-note {
    right: 20px;
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.7rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(220,20,60,0.28);
}

/* ========================================
   PAINIKKEET (Kaikki btn-elementit)
   ======================================== */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;              /* Silevä animaatio hover:issa */
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Punainen pääpainike */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;         /* Läpinäkyvä tausta */
    transform: translateY(-2px);            /* Nosta nappia ylös */
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.4); /* Punainen varjo */
}

/* Valkoinen secondary-painike */
.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-color);            /* Teksti punaiseksi */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* ========================================
   PALVELUT OSIO (4 korttia)
   ======================================== */

.services {
    padding: 80px 20px;
    background-color: var(--light-color);   /* Vaalea harmaa tausta */
}

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 1rem;
}

.services h2::after {
    /* Punainen viiva otsikon alle */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 4 kolumnia, responsive */
    gap: 2rem;
}

.service-card {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: left;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color); /* Punainen vasemmalla oleva viiva */
}

.service-card:hover {
    transform: translateY(-5px);            /* Nosta korttia ylös */
    box-shadow: 0 8px 20px rgba(220, 20, 60, 0.2); /* Isompi punainen varjo */
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #111;
    color: white;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0;
}

.service-card:hover .service-icon {
    background: var(--primary-color);
}

.service-card h3 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.service-card p {
    color: #666;
    font-size: 0.95rem;
}

/* ========================================
   ABOUT OSIO (Tietoa meistä)
   ======================================== */

.about {
    padding: 80px 20px;
    background-color: white;
}

.about .container {
    max-width: 800px;                       /* Kapeampi sisältöalue */
}

.about h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.about h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

.about p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ========================================
   PORTFOLIO OSIO (Karuselli kuvailla)
   ======================================== */

.portfolio {
    padding: 80px 20px;
    background-color: var(--light-color);
}

.portfolio h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.portfolio h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

.portfolio-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Karusellin pääsäiliö */
.portfolio-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.carousel-container {
    position: relative;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;                       /* Piiloita reunojen ylimenevä sisältö */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Yksittäinen dia */
.carousel-slide {
    display: none;                          /* Näytä vain .active dia */
    animation: fadeIn 0.5s ease-in-out;     /* Fade-efekti */
}

.carousel-slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-slide img {
    width: 100%;
    height: 350px;
    object-fit: cover;                      /* Kuva täyttää alueen */
}

.demo-preview {
    --preview-scale: 0.56;                  /* Esikatselusivun pienennys karusellissa */
    position: relative;
    width: 100%;
    height: 360px;
    display: block;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid #ddd;
    background: #111;
    cursor: pointer;
}

.demo-preview iframe {
    position: absolute;
    top: 0;
    left: 50%;                              /* Keskita demo myos mobiilissa */
    width: 1440px;
    height: 920px;
    border: 0;
    transform: translateX(-50%) scale(var(--preview-scale));
    transform-origin: top center;
    pointer-events: none;
    background: white;
}

.demo-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 58%, rgba(0,0,0,0.55) 100%);
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.demo-preview:hover::after {
    opacity: 1;
}

.preview-label {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    color: white;
    background: rgba(220, 20, 60, 0.94);
    padding: 0.55rem 0.85rem;
    border-radius: var(--border-radius);
    font-weight: 800;
    font-size: 0.9rem;
}

.carousel-info {
    padding: 2rem;
    background: white;
}

.carousel-info h3 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.carousel-info p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;                   /* Pyöreä tagi */
    font-size: 0.85rem;
    font-weight: bold;
}

/* Nuolet navigointiin */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(220, 20, 60, 0.8);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;                    /* Pyöreät nuoli-painikkeet */
    transition: all 0.3s ease;
    z-index: 10;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1); /* Suurenna hover:ssa */
}

.carousel-btn.prev {
    left: -60px;                            /* Vasemmalla puolella */
}

.carousel-btn.next {
    right: -60px;                           /* Oikealla puolella */
}

/* Pisteet (dots) alhaalla */
.carousel-dots {
    text-align: center;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--primary-color); /* Aktiivinen piste punainen */
    width: 30px;
    border-radius: 5px;                    /* Pienempi pyöristys */
}

.dot:hover {
    background-color: #999;
}

/* ========================================
   YHTEYSTIEDOT OSIO (Lomake + tiedot)
   ======================================== */

.contact {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--dark-color) 0%, #2a2a2a 100%);
    color: white;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.contact h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Yhteystietojen ruudukko (puhelin, email, jne) */
.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);            /* Punainen otsikot */
}

.contact-info a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--primary-color);
}

.calendly-box {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--border-radius);
    text-align: center;
    background: rgba(255,255,255,0.06);
}

.calendly-box p {
    margin-bottom: 1rem;
    color: #ddd;
}

/* Yhteydenotto-lomake */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    background-color: #f0f0f0;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.2); /* Punainen focus-efekti */
}

/* ========================================
   FOOTER (Alin osa sivusta)
   ======================================== */

.footer {
    background-color: #0f0f0f;              /* Hyvän tumma musta */
    color: #999;
    text-align: center;
    padding: 2rem;
}

.footer p {
    margin: 0.5rem 0;
}

.footer p:first-child {
    color: white;
    font-weight: bold;
}

/* ========================================
   RESPONSIVE DESIGN (Tabletin näyttö)
   NÄYTTÖ: Alle 768px leveydessä
   ======================================== */

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;                  /* Pienemmät otsikot */
    }

    .hero-content .tagline {
        font-size: 1.1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        font-size: 0.9rem;                  /* Pienemmät navigaatio-linkit */
    }

    .navbar .container {
        flex-direction: column;
        gap: 0.8rem;
    }

    .services h2,
    .about h2,
    .contact h2,
    .portfolio h2 {
        font-size: 2rem;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 90px 20px 70px;
        min-height: auto;
        text-align: left;
        gap: 34px;
    }

    .hero-content {
        justify-self: stretch;
    }

    .hero-showcase {
        justify-self: stretch;
        min-height: 300px;
    }

    .showcase-card-main {
        width: 72%;
        height: 210px;
    }

    .showcase-card-side {
        width: 58%;
        height: 165px;
    }

    .carousel-btn.prev,
    .carousel-btn.next {
        top: 140px;                         /* Keskelle 280px demo-esikatselua */
        width: 45px;
        height: 45px;                       /* Pienemmät nuoli-painikkeet */
    }

    .carousel-btn.prev {
        left: 10px;                         /* Lähemmäs kuvan reunaa */
    }

    .carousel-btn.next {
        right: 10px;
    }

    .carousel-slide img {
        height: 250px;                      /* Lyhyempi kaaruselli */
    }

    .demo-preview {
        --preview-scale: 0.42;
        height: 280px;
    }
}

/* ========================================
   RESPONSIVE DESIGN (Pieni mobiili)
   NÄYTTÖ: Alle 480px leveydessä
   ======================================== */

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;                    /* Pienimmät otsikot */
    }

    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.6rem;
        font-size: 0.8rem;                  /* Hyvin pieni navigaatio */
        text-align: center;
    }

    .nav-links a {
        display: block;
        overflow-wrap: anywhere;
    }

    .logo {
        font-size: 1.2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;         /* Yksi kolumni (pino allekkain) */
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;              /* Painikkeet allekkain */
        gap: 0.8rem;
    }

    .hero-showcase {
        min-height: 245px;
    }

    .showcase-card-main {
        width: 78%;
        height: 175px;
    }

    .showcase-card-side {
        width: 66%;
        height: 135px;
    }

    .showcase-note {
        left: 0;
        right: auto;
        top: 0;
    }

    .btn {
        width: 100%;                        /* Painikkeet levittävät yli näytön */
    }

    .carousel-info {
        padding: 1.5rem;                    /* Vähemmän sisäväliä */
    }

    .demo-preview {
        --preview-scale: 0.32;
        height: 235px;
    }

    .carousel-dots {
        gap: 0.5rem;                        /* Pienemmät pisteet */
    }
}
