:root {
    --primary-color: #4568dc;
    --primary-dark: #3f5bd5;
    --accent-color: #00c6ff;
    --text-color: #2d3748;
    --dark-bg: #f8fafc;
    --dark-card: #ffffff;
    --dark-nav: rgba(255, 255, 255, 0.95);
    --white: #ffffff;
    --gray: #666;
    --shadow-light: rgba(0,0,0,0.03);
    --shadow-medium: rgba(0,0,0,0.06);
    --shadow-dark: rgba(0,0,0,0.2);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(200, 215, 240, 0.3);

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 6rem;

    --font-main: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-content h1 {
        font-size: 1.7rem;
        letter-spacing: 0.3px;
        margin-bottom: 1rem;
        line-height: 1.3;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .cta-button {
        padding: 0.8rem 1.8rem;
        font-size: 0.95rem;
    }

    .hero {
        padding: 1.5rem;
    }
}

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

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--dark-nav);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(230, 235, 245, 0.8);
}


@media (min-width: 769px) {
    .navbar {
        padding-left: 10vw;
        padding-right: 10vw;
    }
}

.burger {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
    color: var(--primary-color);
}

.burger.active {
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .burger {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--dark-nav);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 2rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.25s ease-in-out;
        max-height: 0;
        overflow: hidden;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        max-height: 300px;
    }

    .nav-links a {
        margin-left: 0;
        padding: 0.5rem 0;
    }

    .service-cards {
        flex-direction: column;
        align-items: center;
    }

    .hero-content {
        transform: translateY(-5%);
        margin: 0 auto;
        padding: 0 1rem;
        width: 90%;
        max-width: 500px;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1.2rem;
        letter-spacing: 0.3px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .hero-content p {
        font-size: 1.15rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .section {
        padding: 4rem 1.5rem;
        min-height: auto;
    }

    .section h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .card {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1.5rem;
        padding: 2rem;
    }
}

.logo {
    font-weight: 600;
    font-size: 2rem;
    line-height: 1;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(69, 104, 220, 0.2);
    position: relative;
    overflow: hidden;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.4s ease;
}

.logo:hover::after {
    width: 100%;
}

.nav-links {
    display: flex;
}

.nav-links a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

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

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

.hero {
    height: 100vh;
    background: url('../media/volvo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    margin: 0;
    border: none;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Increased opacity for better contrast */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 100%;
    padding: 0 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpIn 1s ease forwards 0.5s;
}

@keyframes fadeUpIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #ffffff, var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.hero-content p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    opacity: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.cta-button {
    position: relative;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.3);
    z-index: 1;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transition: width 0.5s ease;
    z-index: -1;
}

.cta-button:hover::before {
    width: 100%;
}

.cta-button:hover,
.cta-button:active {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

.section {
    position: relative;
    overflow: hidden;
}

.section:not(.hero)::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    height: 100px;
    background: inherit;
    transform: skewY(-2deg);
    transform-origin: 100%;
    z-index: -1;
}

.section:nth-child(odd) {
    background-color: var(--dark-bg);
}

.section:nth-child(even) {
    background-color: var(--dark-card);
}

.section {
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.section h2 {
    margin-bottom: 2.5rem;
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: translateX(-50%);
}

.section p {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: 0.1s;
}

/* Classes for JS to add when elements are visible */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.services .service-cards {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: var(--glass-bg);
    padding: 3rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 350px;
    transition: all 0.4s ease, opacity 0.8s ease, transform 0.8s ease;
    opacity: 0;
    transform: translateY(30px);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 40px rgba(69, 104, 220, 0.1);
    border-color: var(--accent-color);
}

.card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.75rem;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.card p {
    color: var(--text-color);
    line-height: 1.7;
    opacity: 1;
    transform: none;
}

.track-input {
    margin-top: 1rem;
    padding: 0.8rem;
    width: 100%;
    max-width: 250px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    margin-bottom: 1rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
    -webkit-appearance: none; /* Removes default styling on iOS */
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
}

.track-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--dark-nav);
    color: var(--gray);
    border-top: 1px solid rgba(230, 235, 245, 0.8);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Contact section links styling */
.contact a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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