:root {
    --bg: #05070a;
    --bg-soft: #0a0e14;
    --card: rgba(15, 21, 30, 0.72);
    --card-solid: #0d131c;
    --text: #f5f7fa;
    --muted: #8f9aaa;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #00d9ff;
    --accent-soft: rgba(0, 217, 255, 0.14);
    --max-width: 1240px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 217, 255, 0.08), transparent 28%),
        radial-gradient(circle at 85% 30%, rgba(0, 217, 255, 0.05), transparent 25%),
        var(--bg);
    color: var(--text);
    font-family: Arial, Tahoma, sans-serif;
    line-height: 1.8;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.18;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 55px 55px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

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

button {
    font: inherit;
}

.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 0 max(28px, calc((100vw - var(--max-width)) / 2));
    border-bottom: 1px solid var(--line);
    background: rgba(5, 7, 10, 0.76);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    direction: ltr;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 217, 255, 0.6);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
    letter-spacing: -1px;
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.08);
}

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

.brand-text strong {
    font-size: 15px;
    letter-spacing: 2px;
}

.brand-text small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 2.2px;
}

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

.nav-links a {
    position: relative;
    color: #b9c1cc;
    font-size: 14px;
    transition: color 0.25s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -9px;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.nav-links a:hover {
    color: white;
}

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

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 28px;
}

.hero {
    position: relative;
    min-height: 100vh;
    width: min(var(--max-width), calc(100% - 56px));
    margin: auto;
    padding: 140px 0 70px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 70px;
}

.hero-background {
    position: absolute;
    width: 520px;
    height: 520px;
    left: -280px;
    top: 15%;
    z-index: -1;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.05);
    filter: blur(100px);
}

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

.hero-label {
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
}

.hero-label::before {
    content: "";
    width: 38px;
    height: 1px;
    background: var(--accent);
}

.hero h1 {
    font-size: clamp(52px, 7vw, 95px);
    line-height: 1.05;
    letter-spacing: -4px;
}

.hero h1 span {
    display: block;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
}

.hero h2 {
    direction: ltr;
    margin-top: 28px;
    color: #c5ccd6;
    font-size: clamp(17px, 2vw, 23px);
    font-weight: 400;
    letter-spacing: 1.5px;
}

.hero-description {
    max-width: 650px;
    margin-top: 25px;
    color: var(--muted);
    font-size: 17px;
}

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

.button {
    min-width: 165px;
    padding: 13px 25px;
    border: 1px solid var(--line);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.button:hover {
    transform: translateY(-3px);
}

.button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #001014;
}

.button.primary:hover {
    background: #55e7ff;
}

.button.secondary {
    background: rgba(255, 255, 255, 0.025);
}

.button.secondary:hover {
    border-color: rgba(0, 217, 255, 0.5);
}

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

.profile-frame {
    position: relative;
    width: min(400px, 100%);
    aspect-ratio: 4 / 5;
    padding: 1px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(145deg, rgba(0, 217, 255, 0.35), transparent 25%),
        linear-gradient(315deg, rgba(0, 217, 255, 0.12), transparent 35%);
}

.profile-frame::before {
    content: "";
    position: absolute;
    top: -13px;
    right: -13px;
    width: 80px;
    height: 80px;
    border-top: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.profile-frame::after {
    content: "";
    position: absolute;
    bottom: -13px;
    left: -13px;
    width: 80px;
    height: 80px;
    border-bottom: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    background:
        radial-gradient(circle, rgba(0, 217, 255, 0.11), transparent 40%),
        #090d13;
}

.profile-placeholder span {
    direction: ltr;
    color: rgba(255, 255, 255, 0.8);
    font-size: 80px;
    font-weight: 900;
    letter-spacing: -8px;
}

.profile-placeholder small {
    direction: ltr;
    margin-top: 10px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 4px;
}

.section {
    width: min(var(--max-width), calc(100% - 56px));
    margin: auto;
    padding: 110px 0;
    border-top: 1px solid var(--line);
}

.section-heading {
    margin-bottom: 45px;
}

.section-heading span {
    direction: ltr;
    display: block;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
}

.section-heading h2 {
    margin-top: 8px;
    font-size: clamp(32px, 5vw, 55px);
    line-height: 1.2;
}

.about-card {
    position: relative;
    max-width: 900px;
    padding: 38px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
}

.about-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.about-card p {
    color: #aab3c0;
    font-size: 18px;
}

.cards-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.skill-card,
.project-card {
    position: relative;
    min-height: 240px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.skill-card:hover,
.project-card:hover {
    transform: translateY(-7px);
    border-color: rgba(0, 217, 255, 0.35);
    background: rgba(15, 21, 30, 0.95);
}

.skill-card > span,
.project-number {
    direction: ltr;
    display: block;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.skill-card h3,
.project-card h3 {
    direction: ltr;
    margin-top: 48px;
    color: white;
    font-size: 20px;
}

.skill-card p,
.project-card p {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

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

.project-card {
    min-height: 280px;
}

.project-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    transform: scaleX(0);
    transform-origin: right;
    background: var(--accent);
    transition: transform 0.3s ease;
}

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

.contact-section {
    text-align: center;
}

.contact-section .section-heading {
    margin-bottom: 20px;
}

.contact-section > p {
    max-width: 650px;
    margin: auto;
    color: var(--muted);
}

.social-links {
    direction: ltr;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 35px;
}

.social-links a {
    min-width: 135px;
    padding: 11px 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: #c3cad4;
    font-size: 13px;
    transition:
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--accent);
}

footer {
    width: min(var(--max-width), calc(100% - 56px));
    margin: auto;
    padding: 28px 0;
    border-top: 1px solid var(--line);
    color: #687382;
    text-align: center;
    font-size: 12px;
}

::selection {
    background: var(--accent);
    color: #001014;
}

@media (max-width: 950px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 150px;
    }

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

    .hero-visual {
        padding: 20px 0 30px;
    }

    .profile-frame {
        width: min(430px, 90%);
    }

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

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

@media (max-width: 760px) {
    .navbar {
        height: 72px;
        padding: 0 20px;
    }

    .brand-text small {
        display: none;
    }

    .nav-links {
        position: absolute;
        top: 72px;
        right: 16px;
        left: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px;
        border: 1px solid var(--line);
        background: rgba(7, 10, 15, 0.98);
        backdrop-filter: blur(20px);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 13px 15px;
    }

    .nav-links a::after {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .hero,
    .section,
    footer {
        width: min(100% - 36px, var(--max-width));
    }

    .hero {
        min-height: auto;
        padding-top: 125px;
        gap: 35px;
    }

    .hero h1 {
        font-size: clamp(48px, 16vw, 72px);
        letter-spacing: -3px;
    }

    .hero h2 {
        font-size: 16px;
    }

    .hero-description {
        font-size: 15px;
    }

    .section {
        padding: 80px 0;
    }

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

    .about-card {
        padding: 28px 24px;
    }
}

@media (max-width: 420px) {
    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .brand-text strong {
        font-size: 12px;
    }

    .hero-label {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

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

    .button {
        width: 100%;
    }

    .profile-placeholder span {
        font-size: 60px;
    }
}

/* Improved projects layout */

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

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

@media (max-width: 650px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== PROFILE IMAGE ===== */

.profile-placeholder {
    overflow: hidden;
    background:
        radial-gradient(circle at center,
        rgba(255, 110, 0, 0.10),
        transparent 65%),
        #090d13;
}

.profile-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition:
        transform 0.5s ease,
        filter 0.5s ease;
}

.profile-frame:hover .profile-image {
    transform: scale(1.035);
    filter: brightness(1.08);
}
