/* === Base === */
:root {
    --bg-primary: #06090f;
    --bg-secondary: #0c1018;
    --bg-card: #111827;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --accent-hover: #60a5fa;
    --text-primary: #e8edf5;
    --text-secondary: #7b8ba5;
    --text-muted: #8494a7;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 6px;
}

/* === Light theme === */
[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ebeef3;
    --bg-card: #ffffff;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.12);
    --accent-hover: #1d4ed8;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .navbar {
    background: rgba(245, 247, 250, 0.9);
}

[data-theme="light"] .hero-bg img {
    opacity: 0.08;
    filter: brightness(1.5) saturate(0.3);
}

[data-theme="light"] .section-image img {
    opacity: 0.12;
    filter: brightness(1.6) saturate(0.3);
}

[data-theme="light"] .noise {
    opacity: 0.015;
}

[data-theme="light"] .service-card:hover,
[data-theme="light"] .project-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn:hover {
    color: #fff;
}

[data-theme="light"] .contact-email:hover {
    color: #fff;
}

[data-theme="light"] .tag {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .project-icon {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .project-icon--shield {
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* === Noise overlay === */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* === Section labels === */
.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 12px;
    text-align: center;
}

/* === Animations === */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(8px); }
}

@keyframes barGrow {
    from { width: 0; }
    to { width: var(--width); }
}

.anim-fade-up {
    animation: fadeUp 0.8s ease both;
}

.anim-delay-1 { animation-delay: 0.15s; }
.anim-delay-2 { animation-delay: 0.3s; }
.anim-delay-3 { animation-delay: 0.45s; }
.anim-delay-4 { animation-delay: 0.6s; }

/* === Navigation === */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(6, 9, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 18px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-bracket {
    color: var(--text-muted);
    font-weight: 400;
}

.logo-accent {
    color: var(--accent);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s;
}

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

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

.lang-toggle {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.lang-toggle:hover,
.theme-toggle:hover,
.cookie-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.cookie-toggle {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="light"] .theme-icon-light {
    display: inline;
}

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    filter: brightness(1.2) saturate(0.4);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 30%, var(--accent-glow) 0%, transparent 50%),
        linear-gradient(180deg, transparent 60%, var(--bg-primary) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 800;
    letter-spacing: -3px;
    margin-bottom: 20px;
    line-height: 1;
}

.hero-line {
    width: 60px;
    height: 2px;
    background: var(--accent);
    margin: 0 auto 24px;
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.tagline {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.btn {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    padding: 14px 36px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 30px var(--accent-glow);
}

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-indicator span {
    display: block;
    width: 2px;
    height: 24px;
    background: var(--accent);
    opacity: 0.4;
    animation: scrollPulse 2s ease infinite;
}

/* === Section divider image === */
.section-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.section-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    filter: brightness(1.4) saturate(0.4);
}

.section-image::before,
.section-image::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 100px;
    z-index: 1;
}

.section-image::before {
    top: 0;
    background: linear-gradient(180deg, var(--bg-primary), transparent);
}

.section-image::after {
    bottom: 0;
    background: linear-gradient(0deg, var(--bg-secondary), transparent);
}

.section-image.to-primary::after {
    background: linear-gradient(0deg, var(--bg-primary), transparent);
}

.section-image.from-secondary::before {
    background: linear-gradient(180deg, var(--bg-secondary), transparent);
}

/* === Services === */
.services {
    padding: 100px 24px;
    background: var(--bg-secondary);
}

.services h2,
.about h2,
.contact h2 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 56px;
    text-align: center;
    letter-spacing: -1px;
}

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

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.75;
}

.service-line {
    width: 30px;
    height: 1px;
    background: var(--border);
    margin-top: 24px;
    transition: width 0.4s, background 0.4s;
}

.service-card:hover .service-line {
    width: 50px;
    background: var(--accent);
}

/* === About === */
.about {
    padding: 100px 24px;
    background: var(--bg-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 56px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.85;
    margin-bottom: 18px;
}

.stats {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.stats h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-icon {
    color: var(--accent);
    font-size: 1rem;
}

.stat-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 16px;
}

.stat-year {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.stat-bar {
    height: 3px;
    background: var(--bg-primary);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.stat-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--width);
    background: var(--accent);
    border-radius: 2px;
    animation: barGrow 1.5s ease both;
}

.stat-detail {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* === Projects === */
.projects {
    padding: 100px 24px;
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
    transform: scaleX(1);
}

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

.project-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
}

.project-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.project-icon--shield {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.project-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.project-role {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-card > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* === Contact === */
.contact {
    padding: 100px 24px;
    background: var(--bg-secondary);
    text-align: center;
}

.contact-sub {
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-size: 1rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 36px;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    padding: 18px 40px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius);
    transition: all 0.3s;
    position: relative;
}

.contact-email::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: var(--accent-glow);
    opacity: 0;
    transition: opacity 0.3s;
}

.contact-email:hover {
    border-color: var(--accent);
    box-shadow: 0 0 40px var(--accent-glow);
    color: #fff;
}

.contact-email:hover::before {
    opacity: 1;
}

.contact-email-icon {
    font-size: 1.2rem;
    position: relative;
}

/* === Footer === */
footer {
    padding: 36px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-cookie-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s;
    padding: 0;
}

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

/* === Cookie Banner === */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    padding: 24px;
}


.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.cookie-title {
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.cookie-btn--accept {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}

.cookie-btn--accept:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.cookie-btn--decline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.cookie-btn--decline:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* === Accessibility === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 200;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 12px;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

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

    html {
        scroll-behavior: auto;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        gap: 18px;
    }

    .nav-links a {
        font-size: 0.82rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .stat {
        grid-template-columns: 50px 1fr;
        gap: 8px;
    }

    .stat-bar {
        display: none;
    }
}

@media (max-width: 480px) {
    .nav-links a:not(.lang-toggle) {
        display: none;
    }

    .hero {
        padding: 100px 16px 60px;
    }

    .services,
    .about,
    .contact,
    .projects {
        padding: 72px 16px;
    }

    .cookie-content {
        flex-direction: column;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
    }
}
