:root {
    --bg: #030712;
    --bg-soft: #07111f;
    --surface: rgba(10, 24, 42, .72);
    --surface-strong: rgba(12, 29, 51, .92);
    --text: #eef7ff;
    --muted: #9fb3c8;
    --line: rgba(148, 200, 255, .18);
    --shadow: 0 24px 80px rgba(0, 0, 0, .35);
    --radius: 8px;
    --container: 1180px;
}

[data-theme="light"] {
    --bg: #f7fbff;
    --bg-soft: #eaf4ff;
    --surface: rgba(255, 255, 255, .78);
    --surface-strong: rgba(255, 255, 255, .94);
    --text: #091625;
    --muted: #52677e;
    --line: rgba(16, 55, 94, .14);
    --shadow: 0 22px 70px rgba(18, 48, 88, .14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(34, 211, 238, .08), transparent 28%),
        linear-gradient(220deg, rgba(124, 58, 237, .11), transparent 35%),
        repeating-linear-gradient(90deg, rgba(148, 200, 255, .035) 0, rgba(148, 200, 255, .035) 1px, transparent 1px, transparent 72px),
        repeating-linear-gradient(0deg, rgba(148, 200, 255, .026) 0, rgba(148, 200, 255, .026) 1px, transparent 1px, transparent 72px),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(34, 211, 238, .08), transparent),
        linear-gradient(180deg, transparent, rgba(139, 92, 246, .06), transparent);
    mask-image: linear-gradient(to bottom, black, transparent 78%);
    z-index: -1;
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

.container {
    width: min(var(--container), calc(100% - 40px));
    margin: 0 auto;
}

.loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--bg);
    z-index: 9999;
    transition: opacity .35s ease, visibility .35s ease;
}

.loader span {
    width: 46px;
    height: 46px;
    border: 2px solid rgba(255, 255, 255, .12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader.loaded {
    opacity: 0;
    visibility: hidden;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(3, 7, 18, .76);
    border-bottom: 1px solid var(--line);
}

[data-theme="light"] .site-header {
    background: rgba(247, 251, 255, .82);
}

.nav-wrap {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    color: var(--text);
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand-mark,
.icon-box {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(139, 92, 246, .16));
    color: var(--primary);
}

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a {
    padding: 10px 13px;
    color: var(--muted);
    border-radius: var(--radius);
    font-size: 14px;
    transition: color .2s ease, background .2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
}

.nav-cta,
.btn,
.button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    color: var(--text);
    background: rgba(255, 255, 255, .06);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
    cursor: pointer;
}

.nav-cta {
    min-height: 40px;
    font-size: 14px;
}

.btn.primary,
.button.primary {
    border: 0;
    color: #03111f;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    font-weight: 800;
}

.btn.ghost {
    background: rgba(255, 255, 255, .04);
}

.btn.small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
}

.btn:hover,
.nav-cta:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, .46);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(255, 255, 255, .06);
}

.hero-section {
    padding: 82px 0 36px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    gap: 54px;
    align-items: center;
}

.hero-copy h1,
.page-hero h1,
.project-detail-hero h1 {
    margin: 0;
    max-width: 780px;
    font-size: 64px;
    line-height: 1.02;
    letter-spacing: 0;
}

.hero-copy p,
.page-hero p,
.project-detail-hero p {
    margin: 24px 0 0;
    max-width: 690px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.hero-visual {
    position: relative;
    min-height: 520px;
    display: grid;
    place-items: center;
}

.profile-frame {
    width: min(430px, 100%);
    aspect-ratio: 1;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, .32);
    background:
        linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(124, 58, 237, .14)),
        rgba(8, 20, 38, .82);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.profile-frame img,
.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.code-orbit {
    position: absolute;
    inset: 22px;
    pointer-events: none;
}

.code-orbit span {
    position: absolute;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(4, 15, 30, .68);
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .24);
}

.code-orbit span:nth-child(1) { top: 4%; left: 6%; }
.code-orbit span:nth-child(2) { top: 17%; right: 0; }
.code-orbit span:nth-child(3) { bottom: 16%; left: 0; }
.code-orbit span:nth-child(4) { bottom: 5%; right: 18%; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 34px;
}

.stat-card,
.service-card,
.project-card,
.testimonial-card,
.tech-card,
.glass-panel,
.service-wide,
.final-cta {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
    backdrop-filter: blur(16px);
}

.stat-card {
    padding: 20px;
}

.stat-card strong {
    display: block;
    font-size: 31px;
    color: var(--primary);
}

.stat-card span {
    color: var(--muted);
    font-size: 14px;
}

.section-block {
    padding: 68px 0;
}

.section-head {
    margin-bottom: 28px;
}

.section-head.split {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
}

.section-head h2,
.final-cta h2,
.glass-panel h2 {
    margin: 0;
    font-size: 40px;
    line-height: 1.12;
}

.section-head p,
.final-cta p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

.card-grid,
.project-grid,
.testimonial-grid,
.tech-grid {
    display: grid;
    gap: 18px;
}

.card-grid {
    grid-template-columns: repeat(4, 1fr);
}

.project-grid {
    grid-template-columns: repeat(3, 1fr);
}

.testimonial-grid {
    grid-template-columns: repeat(3, 1fr);
}

.tech-grid {
    grid-template-columns: repeat(4, 1fr);
}

.service-card,
.testimonial-card,
.tech-card {
    padding: 24px;
}

.service-card h3,
.project-card h3,
.project-card h2,
.tech-card strong {
    margin: 18px 0 10px;
    font-size: 20px;
}

.service-card p,
.project-card p,
.testimonial-card p,
.tech-card span {
    color: var(--muted);
    line-height: 1.65;
}

.service-card a {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
    color: var(--primary);
    font-weight: 700;
}

.projects-band {
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .045), transparent);
}

.project-card {
    overflow: hidden;
    transition: transform .25s ease, border-color .25s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, .48);
}

.project-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.06);
}

.project-content {
    padding: 22px;
}

.project-content > span,
.detail-category {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.project-actions a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}

.tech-strip,
.filter-bar,
.skill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-strip {
    justify-content: center;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
}

.tech-strip span,
.skill-cloud span,
.filter-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .04);
}

.filter-btn {
    color: var(--text);
}

.filter-btn.active,
.filter-btn:hover {
    border-color: rgba(34, 211, 238, .5);
    color: var(--primary);
}

.stars {
    color: #fbbf24;
}

.testimonial-card strong {
    display: block;
    margin-top: 20px;
}

.testimonial-card span {
    color: var(--muted);
    font-size: 14px;
}

.final-cta {
    margin-bottom: 80px;
    padding: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(124, 58, 237, .12)),
        var(--surface);
}

.page-hero {
    padding: 86px 0 42px;
}

.page-hero.compact {
    padding-bottom: 18px;
}

.page-hero-grid,
.about-grid,
.contact-grid,
.detail-grid,
.project-detail-content {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 34px;
    align-items: center;
}

.about-photo {
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--surface);
}

.glass-panel {
    padding: 30px;
}

.glass-panel h3 {
    color: var(--primary);
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    position: relative;
    padding: 24px 24px 24px 34px;
    border-left: 2px solid var(--primary);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
}

.timeline-item span {
    color: var(--primary);
    font-weight: 800;
}

.services-list {
    display: grid;
    gap: 16px;
}

.service-wide {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 22px;
    padding: 26px;
}

.service-wide h2 {
    margin: 0 0 10px;
}

.service-wide p,
.service-wide div {
    color: var(--muted);
    line-height: 1.7;
}

.project-detail-hero {
    padding: 84px 0 30px;
}

.project-detail-cover,
.map-frame {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.project-detail-cover img {
    width: 100%;
    aspect-ratio: 16 / 11;
    object-fit: cover;
}

.project-meta {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
}

.project-meta li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.contact-form label,
.contact-info a,
.contact-info span {
    display: grid;
    gap: 8px;
    color: var(--muted);
}

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

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 13px 14px;
    color: var(--text);
    background: rgba(255, 255, 255, .06);
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
}

.contact-form {
    display: grid;
    gap: 16px;
}

.hp-field {
    position: absolute;
    left: -9999px;
}

.contact-info {
    display: grid;
    gap: 16px;
}

.contact-info .glass-panel {
    display: grid;
    gap: 14px;
}

.contact-info i {
    color: var(--primary);
}

.map-frame iframe {
    width: 100%;
    height: 300px;
    border: 0;
}

.notice {
    padding: 13px 14px;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, .14);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, .26);
}

.notice.error {
    background: rgba(248, 113, 113, .14);
    color: #fecaca;
    border-color: rgba(248, 113, 113, .28);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(3, 7, 18, .72);
    padding: 42px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 28px;
}

.footer-grid p,
.footer-contact,
.footer-contact a,
.footer-contact span {
    color: var(--muted);
}

.footer-contact {
    display: grid;
    gap: 10px;
}

.social-list {
    display: flex;
    gap: 10px;
}

.social-list a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--primary);
    background: rgba(255, 255, 255, .05);
}

.social-list.inline {
    margin-top: 20px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.whatsapp-float,
.back-to-top {
    position: fixed;
    right: 20px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: white;
    z-index: 40;
    box-shadow: var(--shadow);
}

.whatsapp-float {
    bottom: 78px;
    background: #22c55e;
}

.back-to-top {
    bottom: 20px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .55s ease, transform .55s ease;
}

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

.maintenance-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
}

.section-label {
    color: var(--primary);
    font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 1040px) {
    .hero-copy h1,
    .page-hero h1,
    .project-detail-hero h1 {
        font-size: 48px;
    }

    .hero-grid,
    .page-hero-grid,
    .about-grid,
    .contact-grid,
    .detail-grid,
    .project-detail-content {
        grid-template-columns: 1fr;
    }

    .card-grid,
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-grid,
    .testimonial-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: grid;
        place-items: center;
    }

    .main-nav,
    .nav-cta {
        display: none;
    }

    .main-nav.open {
        position: absolute;
        top: 78px;
        left: 20px;
        right: 20px;
        display: grid;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface-strong);
        box-shadow: var(--shadow);
    }

    .hero-section {
        padding-top: 48px;
    }

    .hero-visual {
        min-height: 360px;
    }

    .section-head.split,
    .final-cta,
    .footer-bottom {
        align-items: start;
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, var(--container));
    }

    .hero-copy h1,
    .page-hero h1,
    .project-detail-hero h1 {
        font-size: 34px;
    }

    .hero-copy p,
    .page-hero p,
    .project-detail-hero p {
        font-size: 16px;
    }

    .section-head h2,
    .final-cta h2,
    .glass-panel h2 {
        font-size: 30px;
    }

    .stats-grid,
    .card-grid,
    .project-grid,
    .testimonial-grid,
    .tech-grid,
    .gallery-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .service-wide {
        grid-template-columns: 1fr;
    }
}
