:root {
    color-scheme: dark;
    --bg: #0b0d10;
    --bg-soft: #10141a;
    --surface: #141922;
    --surface-strong: #1b222d;
    --line: #2a3442;
    --line-strong: #3a4656;
    --text: #f7fafc;
    --muted: #a7b0be;
    --soft: #d8dee8;
    --cyan: #35d7e6;
    --amber: #f6c453;
    --green: #39d98a;
    --violet: #9b8cff;
    --shadow: 0 20px 70px rgba(0, 0, 0, .34);
    --header-height: 84px;
    --radius: 8px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(246, 196, 83, .05), transparent 340px),
        linear-gradient(135deg, #0b0d10 0%, #10141a 48%, #0d1014 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.modal-open {
    overflow: hidden;
}

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

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(53, 215, 230, .55);
    outline-offset: 3px;
}

.loader-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0b0d10;
    transition: opacity .35s ease, visibility .35s ease;
}

.loader-screen.loader-finished {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    margin-bottom: 22px;
    color: var(--cyan);
    font-size: 3.4rem;
    font-weight: 900;
    line-height: 1;
}

.loader-bar {
    position: relative;
    width: 280px;
    max-width: 72vw;
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
}

.loader-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    appearance: none;
    background: transparent;
}

.loader-progress::-webkit-progress-bar {
    border-radius: inherit;
    background: transparent;
}

.loader-progress::-webkit-progress-value {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--amber), var(--green));
    transition: width .12s ease;
}

.loader-progress::-moz-progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--amber), var(--green));
}

.loader-percent {
    margin-top: 14px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    width: 100%;
    min-height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 7%;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(11, 13, 16, .86);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: #fff;
    padding: 5px;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    font-size: 1rem;
}

.brand-text span {
    color: var(--muted);
    font-size: .78rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-menu a {
    color: var(--soft);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}

.nav-menu a:hover {
    color: var(--cyan);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
}

.hero {
    display: grid;
    min-height: auto;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
    align-items: center;
    gap: 48px;
    padding: 108px 7% 46px;
}

.hero-content {
    max-width: 820px;
}

.eyebrow,
.section-heading span,
.contact-box > span,
.modal-label {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--cyan);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.architecture-grid h2,
.contact-box h2 {
    font-weight: 900;
    letter-spacing: 0;
}

.hero h1 {
    max-width: 680px;
    margin-bottom: 26px;
    font-size: 2.9rem;
    line-height: 1.11;
}

.hero p {
    max-width: 720px;
    color: var(--soft);
    font-size: 1.08rem;
    line-height: 1.85;
}

.hero-actions,
.hero-links,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-actions {
    margin-top: 34px;
}

.hero-links {
    margin-top: 24px;
}

.hero-links a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--soft);
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}

.hero-links a:hover {
    color: var(--amber);
}

.btn,
.contact-actions a,
.project-open {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--radius);
    font-weight: 900;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.btn {
    padding: 0 22px;
}

.btn-primary {
    border: 1px solid transparent;
    background: var(--cyan);
    color: #071013;
}

.btn-secondary,
.contact-actions a {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}

.btn:hover,
.contact-actions a:hover,
.project-open:hover {
    transform: translateY(-2px);
}

.btn-secondary:hover,
.contact-actions a:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.profile-card,
.highlight-card,
.skill-card,
.project-card,
.timeline-item,
.security-panel,
.contact-box,
.architecture-grid,
.project-landing-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(20, 25, 34, .74);
    box-shadow: var(--shadow);
}

.profile-card {
    width: min(100%, 340px);
    padding: 18px;
}

.profile-image-wrap {
    overflow: hidden;
    aspect-ratio: 1 / .95;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #10141a;
}

.profile-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    padding: 22px 4px 0;
}

.profile-info h2 {
    margin-bottom: 8px;
    font-size: 1.65rem;
}

.profile-info p {
    color: var(--cyan);
    font-weight: 800;
}

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

.profile-badges {
    margin-top: 18px;
}

.profile-badges span,
.project-tags span {
    border: 1px solid rgba(53, 215, 230, .22);
    border-radius: 4px;
    background: rgba(53, 215, 230, .08);
    color: #aaf4fb;
    font-size: .75rem;
    font-weight: 800;
    padding: 7px 10px;
}

.section {
    padding: 104px 7%;
}

.section-heading {
    max-width: 900px;
    margin: 0 auto 54px;
    text-align: center;
}

.section-heading h2,
.architecture-grid h2,
.contact-box h2 {
    font-size: 3.3rem;
    line-height: 1.12;
}

.about-grid,
.security-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.about-text,
.highlight-card,
.skill-card,
.security-panel,
.timeline-item {
    padding: 28px;
}

.about-text {
    border-left: 4px solid var(--amber);
    color: var(--soft);
}

.about-text p + p {
    margin-top: 18px;
}

.highlight-card i,
.skill-card i,
.security-panel i {
    margin-bottom: 20px;
    color: var(--cyan);
    font-size: 2rem;
}

.highlight-card h3,
.skill-card h3,
.security-panel h3,
.project-content h3,
.timeline-item h3 {
    margin-bottom: 12px;
    font-size: 1.35rem;
}

.highlight-card p,
.skill-card p,
.security-panel p,
.project-content p,
.timeline-item p {
    color: var(--soft);
    line-height: 1.75;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.skill-card,
.project-card,
.security-panel,
.timeline-item {
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.skill-card:hover,
.project-card:hover,
.security-panel:hover,
.timeline-item:hover {
    border-color: rgba(53, 215, 230, .45);
    background: rgba(27, 34, 45, .86);
    transform: translateY(-4px);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.project-card {
    overflow: hidden;
}

.project-image {
    display: grid;
    min-height: 190px;
    place-items: center;
    color: #071013;
    font-size: 3rem;
}

.project-image.clinic {
    background: linear-gradient(135deg, var(--cyan), #8ee7f0);
}

.project-image.dojo {
    background: linear-gradient(135deg, var(--violet), #d5cdff);
}

.project-image.ecommerce {
    background: linear-gradient(135deg, var(--green), var(--amber));
}

.project-content {
    padding: 26px;
}

.project-content p {
    margin-bottom: 22px;
}

.project-open {
    width: 100%;
    margin-top: 22px;
    border: 1px solid rgba(53, 215, 230, .32);
    background: rgba(53, 215, 230, .09);
    color: var(--cyan);
    cursor: pointer;
    font-family: inherit;
    font-size: .95rem;
}

.project-open:hover {
    background: var(--cyan);
    color: #071013;
}

.timeline {
    display: grid;
    max-width: 980px;
    margin: 0 auto;
    gap: 18px;
}

.timeline-item {
    border-left: 4px solid var(--cyan);
}

.timeline-item strong {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--amber);
}

.security-panel:nth-child(2) i {
    color: var(--amber);
}

.security-panel:nth-child(3) i {
    color: var(--green);
}

.security-panel:nth-child(4) i {
    color: var(--violet);
}

.architecture {
    padding-top: 40px;
}

.architecture-grid {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 32px;
    align-items: start;
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(53, 215, 230, .08), transparent),
        rgba(20, 25, 34, .74);
}

.architecture-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.architecture-list article {
    display: grid;
    gap: 6px;
    min-height: 116px;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    padding: 18px;
}

.architecture-list strong {
    color: var(--cyan);
}

.architecture-list span {
    color: var(--soft);
}

.contact-box {
    max-width: 1080px;
    margin: 0 auto;
    padding: 58px 38px;
    text-align: center;
}

.contact-box p {
    max-width: 820px;
    margin: 22px auto 0;
    color: var(--soft);
    line-height: 1.8;
}

.contact-actions {
    justify-content: center;
    margin-top: 34px;
}

.contact-actions a {
    padding: 0 20px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 30px 7%;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted);
    font-size: .9rem;
}

.modal-overlay,
.image-viewer {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 5, 8, .82);
    backdrop-filter: blur(12px);
}

.modal-overlay {
    z-index: 999;
    padding: 22px;
}

.modal-overlay.active,
.image-viewer.active {
    display: flex;
}

.project-modal {
    position: relative;
    width: min(100%, 940px);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #11161d;
    box-shadow: 0 32px 100px rgba(0, 0, 0, .5);
    padding: 34px;
}

.modal-close,
.image-viewer-close {
    position: absolute;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
}

.modal-close {
    top: 16px;
    right: 16px;
}

.modal-content {
    display: none;
}

.modal-content.active {
    display: block;
}

.modal-content h2 {
    max-width: 760px;
    margin: 0 54px 16px 0;
    font-size: 2.6rem;
    line-height: 1.14;
}

.modal-content p,
.modal-content li {
    color: var(--soft);
    line-height: 1.75;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0;
}

.modal-gallery img,
.modal-shot {
    width: 100%;
    min-height: 170px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.modal-gallery img {
    height: 170px;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform .2s ease, border-color .2s ease;
}

.modal-gallery img:hover {
    border-color: var(--cyan);
    transform: scale(1.02);
}

.modal-shot {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

.modal-content ul {
    display: grid;
    gap: 10px;
    padding-left: 20px;
}

.image-viewer {
    z-index: 1000;
    padding: 18px;
}

.image-viewer img {
    width: auto;
    max-width: 96vw;
    max-height: 92vh;
    border-radius: var(--radius);
    object-fit: contain;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .72);
}

.image-viewer-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2;
}

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

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

.project-page {
    min-height: 100vh;
    background: var(--bg);
}

.project-landing {
    display: grid;
    min-height: 100svh;
    align-items: center;
    padding: 132px 7% 80px;
}

.project-landing-card {
    max-width: 900px;
    padding: 38px;
}

.project-landing-card h1 {
    margin-bottom: 18px;
    font-size: 3.6rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.project-landing-card p {
    max-width: 720px;
    color: var(--soft);
    font-size: 1.05rem;
    line-height: 1.8;
}

.project-landing-card .hero-actions {
    margin-top: 28px;
}

@media (max-width: 1120px) {
    .hero,
    .about-grid,
    .security-grid,
    .architecture-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        gap: 46px;
    }

    .hero-visual {
        justify-content: flex-start;
    }

    .skills-grid,
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    :root {
        --header-height: 76px;
    }

    .site-header {
        padding: 12px 5%;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: 5%;
        display: grid;
        width: min(90vw, 330px);
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #11161d;
        box-shadow: var(--shadow);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity .2s ease, transform .2s ease;
    }

    .nav-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-menu a {
        padding: 15px 18px;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }

    .nav-menu a:last-child {
        border-bottom: 0;
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 118px 5% 68px;
    }

    .hero h1 {
        font-size: 3.1rem;
    }

    .section {
        padding: 78px 5%;
    }

    .section-heading {
        margin-bottom: 38px;
        text-align: left;
    }

    .section-heading h2,
    .architecture-grid h2,
    .contact-box h2 {
        font-size: 2.35rem;
    }

    .skills-grid,
    .project-grid,
    .architecture-list,
    .modal-gallery {
        grid-template-columns: 1fr;
    }

    .contact-box,
    .architecture-grid,
    .project-modal,
    .project-landing-card {
        padding: 26px;
    }

    .modal-content h2 {
        margin-right: 46px;
        font-size: 2rem;
    }

    .site-footer {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .brand-text {
        display: none;
    }

    .hero h1 {
        font-size: 2.55rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-actions,
    .contact-actions {
        flex-direction: column;
    }

    .btn,
    .contact-actions a {
        width: 100%;
    }

    .loader-logo {
        font-size: 2.6rem;
    }

    .project-landing-card h1 {
        font-size: 2.4rem;
    }
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
