/* CSS Variables - Design System */
:root {
    /* Colors */
    --background: hsl(220, 30%, 98%);
    --foreground: hsl(225, 50%, 10%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(225, 50%, 10%);
    --primary: hsl(220, 90%, 56%);
    --primary-foreground: hsl(0, 0%, 100%);
    --primary-glow: hsl(220, 90%, 70%);
    --secondary: hsl(220, 30%, 94%);
    --secondary-foreground: hsl(225, 50%, 10%);
    --muted: hsl(220, 30%, 94%);
    --muted-foreground: hsl(225, 20%, 50%);
    --accent: hsl(260, 90%, 64%);
    --accent-foreground: hsl(0, 0%, 100%);
    --border: hsl(220, 30%, 88%);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent));
    --gradient-hero: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-card: linear-gradient(145deg, var(--card) 0%, var(--secondary) 100%);
    
    /* Shadows */
    --shadow-elegant: 0 10px 40px -10px hsl(220, 90%, 56%, 0.2);
    --shadow-card: 0 4px 20px -4px hsl(220, 90%, 56%, 0.1);
    --shadow-hover: 0 20px 60px -10px hsl(220, 90%, 56%, 0.3);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 5rem 0;
    --card-padding: 1.5rem;
    
    /* Border Radius */
    --radius: 0.5rem;
    --radius-lg: 1rem;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --background: hsl(225, 50%, 8%);
        --foreground: hsl(220, 30%, 95%);
        --card: hsl(225, 50%, 10%);
        --card-foreground: hsl(220, 30%, 95%);
        --primary: hsl(220, 90%, 64%);
        --primary-glow: hsl(220, 90%, 80%);
        --secondary: hsl(225, 40%, 15%);
        --secondary-foreground: hsl(220, 30%, 95%);
        --muted: hsl(225, 40%, 15%);
        --muted-foreground: hsl(220, 20%, 60%);
        --accent: hsl(260, 90%, 70%);
        --border: hsl(225, 40%, 20%);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header .container {
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease-in-out infinite;

    & img{
        width: 200px;
        margin-top: 0.8rem;
    }
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 2rem;
}

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

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 1.5rem;
    height: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background: var(--foreground);
    border-radius: 1px;
    transition: all 0.3s linear;
    transform-origin: 1px;
}

.mobile-menu-btn.active span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-btn.active span:third-child {
    transform: rotate(-45deg);
}

.nav-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
}

.nav-mobile.active {
    display: flex;
}

@media (min-width: 768px) {
    .nav-mobile {
        display: none !important;
    }
}

/* Main Content */
.main-content {
    padding-top: 4rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-card);
}

.btn-primary:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
}

.btn-outline:hover {
    background: var(--secondary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    opacity: 0.1;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
}

.floating-1 {
    top: 25%;
    left: 25%;
    width: 5rem;
    height: 5rem;
    background: var(--primary);
    opacity: 0.1;
    animation: float 3s ease-in-out infinite;
}

.floating-2 {
    top: 33%;
    right: 25%;
    width: 4rem;
    height: 4rem;
    background: var(--accent);
    opacity: 0.1;
    animation: float 3s ease-in-out infinite 1s;
}

.floating-3 {
    bottom: 33%;
    left: 33%;
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    opacity: 0.2;
    animation: float 3s ease-in-out infinite 2s;
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: fade-in 0.6s ease-out;
}

.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;    
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

.hero-description {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-description {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 32rem;
    margin: 0 auto;
}

/* Page Hero */
.page-hero {
    padding: 8rem 0 5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    background-size: 200% 200%;
    /* opacity: 0.1; */
    position: relative;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--background);
    opacity: 0.9;
}

.page-hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 3rem;
    }
}

.page-description {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 32rem;
    margin: 0 auto;
}

/* Competences Section */
.competences {
    padding: var(--section-padding);
    background: var(--secondary);
    background-opacity: 0.5;
}

.competences-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .competences-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .competences-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.competence-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.competence-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.competence-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.competence-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.tag:hover {
    transform: scale(1.05);
}

.tag-frontend {
    background: hsl(220, 100%, 95%);
    color: hsl(220, 100%, 40%);
}

.tag-backend {
    background: hsl(120, 100%, 95%);
    color: hsl(120, 100%, 35%);
}

.tag-cloud {
    background: hsl(260, 100%, 95%);
    color: hsl(260, 100%, 40%);
}

.tag-devops {
    background: hsl(30, 100%, 95%);
    color: hsl(30, 100%, 40%);
}

.tag-database {
    background: hsl(0, 100%, 95%);
    color: hsl(0, 100%, 40%);
}

.tag-tools {
    background: hsl(0, 0%, 95%);
    color: hsl(0, 0%, 40%);
}

/* Clients Section */
.clients {
    padding: var(--section-padding);
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .clients-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .clients-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .clients-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.client-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 6rem;
    animation: fade-in 0.6s ease-out;
}

.client-card:hover {
    box-shadow: var(--shadow-hover);
    transform: scale(1.05);
}

.client-logo {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-align: center;
    padding: 0.5rem;
    background: var(--card);
    border-radius: var(--radius);
    width: 8rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;

    & img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}

/* Logo switching for dark mode */
.client-logo {
    position: relative;
}

.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .logo-light {
        display: none;
    }
    
    .logo-dark {
        display: block;
    }
    
    /* CSS filters for logos that don't have dark versions */
    .client-logo img[src*="brandskyddsforeningen.svg"] {
        filter: brightness(0) invert(1);
    }
    
    .client-logo img[src*="volvo.svg"] {
        filter: brightness(0) invert(1);
    }
    
    .client-logo img[src*="annevo.svg"] {
        filter: none; /* Keep original colors for Annevo */
    }
    
    .client-logo img[src*="essity.svg"] {
        filter: brightness(0) invert(1);
    }
}

@media screen and (max-width: 360px) {
    .client-logo {
        width: 7rem;
    }    
}

.client-card:hover .client-logo {
    transform: scale(1.1);
}

.clients-footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--muted-foreground);
}

.link {
    color: var(--primary);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Projects */
.projects {
    padding: var(--section-padding);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    animation: fade-in 0.6s ease-out;
}

.project-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-client {
    background: hsl(var(--primary), 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.project-year {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: var(--primary);
}

.project-description {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-highlights,
.project-technologies {
    margin-bottom: 1.5rem;
}

.project-highlights h4,
.project-technologies h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.project-highlights ul {
    list-style: none;
    padding: 0;
}

.project-highlights li {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.project-highlights li::before {
    content: '';
    width: 0.375rem;
    height: 0.375rem;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tech-tag {
    padding: 0.125rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--foreground);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.project-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* CTA Section */
.cta {
    padding: var(--section-padding);
    background: var(--secondary);
    background-opacity: 0.5;
    text-align: center;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-description {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

/* Contact */
.contact {
    padding: var(--section-padding);
}

.contact-grid {
    margin: 0 auto;
    width: 40vw;
}

@media (max-width: 1024px) {    
    .contact-grid {
        width: 50vw;    
    }
}
 
@media (max-width: 768px) {    
    .contact-grid {
        width: 88vw;    
    }
}

.contact-info-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.contact-info-description {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-methods {
    margin-bottom: 2rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.contact-method:hover {
    box-shadow: var(--shadow-hover);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: hsl(var(--primary), 0.1);
    border-radius: var(--radius);
    color: var(--primary);
    flex-shrink: 0;
}

.contact-details h3 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-details a {
    color: var(--muted-foreground);
    transition: color 0.3s ease;
}

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

.why-choose-us {
    background: var(--gradient-primary);
    color: var(--primary-foreground);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.why-choose-us h3 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.why-choose-us ul {
    list-style: none;
    padding: 0;
}

.why-choose-us li {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.why-choose-us li::before {
    content: '• ';
    margin-right: 0.5rem;
}

/* Contact Form */
.contact-form-container {
    position: relative;
}

.contact-form-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-elegant);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-description {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsl(var(--primary), 0.1);
}

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

/* Responsive Design */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .mobile-menu-btn,
    .nav-mobile,
    .floating-element {
        display: none;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}