/* ========================================
   KILTALA PRODUCTIONS — Main Stylesheet
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #cbc5bd;
    --color-bg-warm: #c5bfb7;
    --color-bg-section: #b6bbb3;
    --color-bg-contact: #cdc7bf;
    --color-text: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-accent: #2e6b45;
    --color-accent-light: #3d8a5a;
    --color-accent-dark: #1a3a2a;
    --color-gold: #d4a853;
    --color-white: #ffffff;
    --color-border: rgba(0,0,0,0.08);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --header-height: 80px;
    --section-padding: 120px;
    --container-width: 1200px;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.header.scrolled {
    background-color: rgba(203, 197, 189, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--color-border);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    z-index: 1001;
}

.logo-img {
    height: 60px;
    width: auto;
    transition: opacity 0.3s ease;
}

.logo:hover .logo-img {
    opacity: 0.7;
}

.nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    position: relative;
    transition: color 0.3s ease;
}

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

.nav-link:hover {
    color: var(--color-text);
}

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

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.lang-btn {
    padding: 4px 10px;
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    background: transparent;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.lang-btn:hover {
    color: var(--color-text);
    border-color: var(--color-text-secondary);
}

.lang-btn.active {
    background-color: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
}

.nav-social a {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-social a:hover {
    color: var(--color-accent);
    transform: scale(1.1);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    isolation: isolate;
    display: flex;
    align-items: center;
    padding: calc(var(--header-height) + 10px) 32px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(46, 107, 69, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(212, 168, 83, 0.05) 0%, transparent 65%);
    pointer-events: none;
}

.hero-content {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

.hero-text {
    text-align: center;
}

.hero-title {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.hero-title-line {
    display: block;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero-cta {
    display: inline-block;
    padding: 16px 40px;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-cta:hover {
    background-color: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(46, 107, 69, 0.25);
}

/* Hero Devices */
.hero-devices {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.device {
    flex-shrink: 0;
    transition: transform 0.6s var(--ease-out-expo);
}

.device img {
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 15px 40px rgba(0,0,0,0.15));
    transform: translateZ(0);
    backface-visibility: hidden;
}

.device:hover {
    transform: translateY(-8px) scale(1.02) !important;
}

.device-macbook img {
    height: 310px;
}

.device-ipad img {
    height: 270px;
}

.device-phone {
    margin-bottom: 3px;
}

.device-phone img {
    height: 180px;
}

.device-watch img {
    height: 90px;
}

/* --- Section Base --- */
.section {
    padding: var(--section-padding) 32px;
}

.section-inner {
    max-width: var(--container-width);
    margin: 0 auto;
}

/* --- Päivän Sähkö Section --- */
.section-app {
    padding-bottom: 56px;
    background-color: var(--color-bg-section);
    isolation: isolate;
    position: relative;
    overflow: visible;
}

.section-app::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(46, 107, 69, 0.08), transparent);
    pointer-events: none;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.app-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    letter-spacing: -1px;
}

.app-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: center;
    overflow: visible;
}

.app-text {
    position: relative;
    z-index: 1;
}

.app-description {
    font-size: 17px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.app-badges {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.badge-link {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.badge-link:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

.store-badge {
    height: 56px;
    width: auto;
    display: block;
}

/* Google Play badge has ~32% vertical and ~12.5% horizontal built-in transparent padding.
   Height ratio: 56px / 0.68 ≈ 82px. Negative margins cancel the padding visually. */
.badge-link:last-child .store-badge {
    height: 82px;
    margin: -13px 0 -13px -13px;
}

/* App Devices — puhelimet rinta rinnan, tyhjä tila rajataan object-fit:cover */
.app-devices {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
}

.device-app {
    flex-shrink: 0;
    transition: transform 0.6s var(--ease-out-expo);
}

.device-app img {
    display: block;
    object-fit: cover;
    object-position: center;
    max-width: none;
    backface-visibility: hidden;
}

.device-app:hover {
    transform: translateY(-8px) scale(1.02) !important;
}

/* Vasen — keskikoko */
.device-app-1 img {
    width: 233px;
    height: 510px;
    border-radius: 33px;
}

/* Keskimmäinen — isoin */
.device-app-2 {
    margin-bottom: 2px;
}

.device-app-2 img {
    width: 278px;
    height: 600px;
    border-radius: 39px;
}

/* Oikea — pienin */
.device-app-3 img {
    width: 195px;
    height: 428px;
    border-radius: 30px;
}

/* --- About Section --- */
.section-about {
    background-color: var(--color-bg);
}

.about-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 80px;
    align-items: center;
}

.about-image {
    flex-shrink: 0;
}

.about-photo {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(10%);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.about-photo:hover {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.about-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.about-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.about-role {
    font-size: 16px;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 24px;
}

.about-description {
    font-size: 17px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.about-contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

.about-contact-link:hover {
    color: var(--color-accent);
}

.about-contact-link svg {
    flex-shrink: 0;
    color: var(--color-accent);
}

.about-social {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.about-social a {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.about-social a:hover {
    color: var(--color-accent);
    transform: scale(1.1);
}

/* --- Contact Section --- */
.section-contact {
    padding-top: 56px;
    background-color: var(--color-bg-contact);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: start;
}

.contact-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.contact-description {
    font-size: 17px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group textarea {
    padding: 14px 18px;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 15px;
    background-color: var(--color-white);
    color: var(--color-text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(46, 107, 69, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    align-self: flex-start;
    padding: 16px 48px;
    background-color: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(46, 107, 69, 0.25);
}

.btn-submit:active {
    transform: translateY(0);
}

/* --- Footer --- */
.footer {
    padding: 40px 32px;
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo-img {
    height: 36px;
    width: auto;
}

.footer-info p {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social a {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
    color: var(--color-text);
    transform: scale(1.1);
}

/* ========================================
   ANIMATIONS
   ======================================== */

.anim-fade-up,
.anim-fade-right,
.anim-fade-left {
    opacity: 1;
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

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

.anim-fade-right {
    transform: translateX(0);
}

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

.anim-fade-up.visible,
.anim-fade-right.visible,
.anim-fade-left.visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* ========================================
   RESPONSIVE — Tablet
   ======================================== */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .hero-devices {
        gap: 16px;
    }

    .device-macbook img {
        height: 240px;
    }

    .device-ipad img {
        height: 210px;
    }

    .device-phone img {
        height: 140px;
    }

    .device-watch img {
        height: 70px;
    }

    .app-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .app-devices {
        gap: 5px;
    }

    .device-app-1 img {
        width: 180px;
        height: 398px;
    }

    .device-app-2 img {
        width: 218px;
        height: 473px;
    }

    .device-app-3 img {
        width: 150px;
        height: 330px;
    }

    .about-content {
        gap: 60px;
    }

    .about-photo {
        width: 240px;
        height: 240px;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* ========================================
   RESPONSIVE — Mobile
   ======================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
        --section-padding: 64px;
    }

    .header-inner {
        padding: 0 20px;
    }

    .nav-link-desktop,
    .nav-social-desktop {
        display: none;
    }

    .nav {
        gap: 0;
    }

    .lang-switcher {
        margin-left: 0;
        gap: 8px;
    }

    .lang-btn {
        font-size: 14px;
        padding: 6px 14px;
    }

    .hero {
        padding: calc(var(--header-height) + 20px) 20px 60px;
        min-height: auto;
    }

    .hero-content {
        gap: 40px;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-devices {
        gap: 8px;
    }

    .device-macbook img {
        height: 180px;
    }

    .device-ipad img {
        height: 155px;
    }

    .device-phone img {
        height: 105px;
    }

    .device-watch img {
        height: 50px;
    }

    .section {
        padding: var(--section-padding) 20px;
    }

    .app-header {
        margin-bottom: 40px;
    }

    .app-badges {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    .store-badge {
        height: 48px;
        width: auto;
    }

    /* 48px / 0.68 = 71px. Margins cancel Google Play's built-in padding. */
    .badge-link:last-child .store-badge {
        height: 71px;
        margin: -11.5px 0 -11.5px -4.5px;
    }

    .app-content {
        gap: 40px;
    }

    .app-text {
        order: 1;
    }

    .app-devices {
        order: 2;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        gap: 12px;
        padding-bottom: 24px;
        overflow: hidden;
    }

    .device-app {
        flex-shrink: 1;
    }

    .device-app-1 img,
    .device-app-3 img {
        width: 120px;
        height: 262px;
        border-radius: 24px;
    }

    .device-app-2 img {
        width: 145px;
        height: 316px;
        border-radius: 28px;
    }

    .device-app-2 {
        margin-bottom: 0;
    }

    .device-app:hover {
        transform: none;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .about-image {
        display: flex;
        justify-content: center;
    }

    .about-photo {
        width: 200px;
        height: 200px;
    }

    .about-contact-info {
        align-items: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Decorative shape removed - now behind phones directly */

/* --- Form success state --- */
.btn-submit.success {
    background-color: var(--color-accent) !important;
    pointer-events: none;
}


/* ========================================
   RESPONSIVE — Small Mobile
   ======================================== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 36px;
    }

    .device-macbook img {
        height: 130px;
    }

    .device-ipad img {
        height: 112px;
    }

    .device-phone img {
        height: 75px;
    }

    .device-watch img {
        height: 38px;
    }

    .app-header {
        margin-bottom: 32px;
    }

    .app-title {
        font-size: 28px;
    }

    .app-content {
        gap: 32px;
    }

    .app-description {
        font-size: 15px;
    }

    .app-devices {
        gap: 10px;
        padding-bottom: 20px;
    }

    .device-app-1 img,
    .device-app-3 img {
        width: 95px;
        height: 207px;
        border-radius: 20px;
    }

    .device-app-2 img {
        width: 115px;
        height: 251px;
        border-radius: 24px;
    }

    .contact-title {
        font-size: 28px;
    }

    .app-badges {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        margin-top: 28px;
        gap: 6px;
    }
}
