/* ================
   Base / Globals
   ================ */
:root {
    --bg-main: #030816;
    --bg-section: #050b1b;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --card-bg: #0b1224;
    --card-border: #111827;
    --radius-lg: 14px;
    --shadow-soft: 0 18px 35px rgba(0, 0, 0, 0.25);
    --shadow-strong: 0 25px 60px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[data-lang] {
    display: none;
}

body[data-current-lang="en"] [data-lang="en"],
body[data-current-lang="sv"] [data-lang="sv"] {
    display: inline;
}

/* ================
   Navbar
   ================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(3, 8, 22, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}

.nav-brand {
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--text-main);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hamburger button */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 18px;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--text-main);
}

/* Menu */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 2px;
    width: 0;
    background: var(--accent);
    transition: width 0.2s ease-out;
}

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

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

.language-switcher select {
    background: #0f172a;
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 100px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.language-switcher select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* ================
   Hero
   ================ */
.hero {
    background: radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.18), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.15), transparent 30%),
                linear-gradient(135deg, #0a1024, #020715 60%);
    color: #e5e7eb;
    padding: 5rem 1.5rem 4.5rem;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.2rem, 4vw, 3.15rem);
    margin-bottom: 0.75rem;
    letter-spacing: 0.01em;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0 auto;
    max-width: 640px;
}

.hero-cta {
    margin-top: 1.8rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.18s ease-out, transform 0.1s ease-out, box-shadow 0.2s ease-out;
}

.btn-primary {
    background: var(--accent-dark);
    color: white;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.6);
}

.btn-primary:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 3px;
}

/* ================
   Sections
   ================ */
section {
    padding: 4.5rem 0;
    background: var(--bg-section);
}

.section-title {
    text-align: center;
    font-size: 1.9rem;
    margin-bottom: 0.35rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 2.6rem;
    font-size: 0.98rem;
}

/* ================
   Services
   ================ */
.services {
    background: var(--bg-section);
}

.services-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.service-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.6rem 1.8rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
    transition: transform 0.16s ease-out, box-shadow 0.18s ease-out, border-color 0.16s ease-out;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.16);
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.service-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.service-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.96rem;
}

/* ================
   Portfolio
   ================ */
.portfolio {
    background: var(--bg-main);
}

.portfolio-grid {
    display: grid;
    gap: 1.7rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.portfolio-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: transform 0.16s ease-out, box-shadow 0.18s ease-out, border-color 0.16s ease-out;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.portfolio-image {
    height: 160px;
    overflow: hidden;
}

.portfolio-placeholder {
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1rem 1.2rem;
    color: #f9fafb;
    font-weight: 600;
    font-size: 0.95rem;
}

.portfolio-placeholder .project-type {
    background: rgba(3, 7, 18, 0.5);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    display: inline-flex;
    flex-direction: column;
    gap: 0.05rem;
}

.portfolio-content {
    padding: 1.4rem 1.6rem 1.5rem;
}

.portfolio-content h3 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
}

.portfolio-content p {
    margin: 0 0 0.9rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.16);
    color: #c7d7ff;
    border: 1px solid rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

/* ================
   Contact
   ================ */
.contact {
    background: var(--bg-section);
}

.contact-wrapper {
    display: grid;
    gap: 2rem;
    align-items: flex-start;
}

.contact-info {
    display: grid;
    gap: 1.2rem;
}

.info-item {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--accent);
}

.info-item h4 {
    margin: 0 0 0.1rem;
    font-size: 0.98rem;
}

.info-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-form {
    background: var(--card-bg);
    padding: 1.9rem 1.6rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
}

.form-group {
    margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 9px;
    border: 1px solid #1f2937;
    font: inherit;
    resize: vertical;
    background: #0d1324;
    color: var(--text-main);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-status {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    min-height: 1.2em;
}

.form-status.success {
    color: #34d399;
}

.form-status.error {
    color: #f87171;
}

/* ================
   Footer
   ================ */
.footer {
    background: var(--bg-main);
    color: var(--text-muted);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.footer-section p {
    margin: 0;
    font-size: 0.93rem;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section li + li {
    margin-top: 0.35rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.93rem;
}

.footer-section a:hover {
    color: var(--text-main);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.social-link {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.03);
}

.social-link:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ================
   Hover Effects
   ================ */
@media (hover: hover) {
    .service-card:hover,
    .portfolio-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-strong);
        border-color: rgba(37, 99, 235, 0.35);
    }
}

/* ================
   Responsiveness
   ================ */
@media (max-width: 900px) {
    .nav-menu {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        padding-inline: 1.25rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-actions {
        align-items: flex-start;
    }

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

    .nav-menu li {
        border-top: 1px solid var(--card-border);
    }

    .nav-menu .nav-link {
        display: block;
        padding: 0.9rem 1.5rem;
    }

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

    .language-switcher select {
        min-width: auto;
        padding: 0.45rem 0.6rem;
        font-size: 0.85rem;
    }

    .nav-actions {
        gap: 0.6rem;
    }

    .hero {
        padding-top: 4.2rem;
        padding-bottom: 3.6rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .contact-wrapper {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr);
    }
}
