/* ===== DESIGN TOKENS ===== */
:root {
    --bg-color: #02040a;
    --bg-radial: radial-gradient(circle at 50% 0%, rgba(0, 122, 255, 0.2), transparent 34rem);
    --card-bg: linear-gradient(145deg, rgba(14, 20, 36, 0.88), rgba(5, 8, 18, 0.78));
    --card-bg-solid: #080c16;
    --panel-bg: rgba(7, 11, 22, 0.84);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(0, 122, 255, 0.48);
    --text-primary: #f8fbff;
    --text-secondary: #a9b5c8;
    --text-muted: #76839a;
    --accent-color: #007aff;
    --accent-bright: #00d4ff;
    --accent-soft: rgba(0, 122, 255, 0.14);
    --accent-gradient: linear-gradient(135deg, #007aff 0%, #00d4ff 100%);
    --accent-glow: rgba(0, 122, 255, 0.36);
    --nav-bg: rgba(2, 4, 10, 0.72);
    --card-shadow: 0 22px 70px rgba(0, 0, 0, 0.38), 0 8px 34px rgba(0, 122, 255, 0.08);
    --transition-fast: 0.2s ease;
    --transition-med: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Cabinet Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Clash Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background:
        var(--bg-radial),
        radial-gradient(circle at 88% 18%, rgba(0, 212, 255, 0.08), transparent 28rem),
        linear-gradient(180deg, #030711 0%, var(--bg-color) 44%, #000 100%);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .glitch-text, .section-title, .logo, .nav-links a {
    font-family: var(--font-display);
}

code, pre, .typing-text, .date {
    font-family: var(--font-mono);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 72%);
}

/* ===== CUSTOM CURSOR (Nexus Studio style) ===== */
@media (pointer: fine) {
    * {
        cursor: none !important;
    }
    
    .custom-cursor-dot {
        width: 8px;
        height: 8px;
        background-color: var(--accent-bright, #00d4ff);
        border-radius: 50%;
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 99999;
        transform: translate3d(-50%, -50%, 0);
        transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
    }

    .custom-cursor-ring {
        width: 36px;
        height: 36px;
        border: 1.5px solid rgba(0, 212, 255, 0.5);
        border-radius: 50%;
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 99998;
        transform: translate3d(-50%, -50%, 0);
        transition: width 0.25s cubic-bezier(0.25, 1, 0.5, 1), height 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s ease, background-color 0.25s ease;
    }

    body.cursor-hover .custom-cursor-dot {
        width: 12px;
        height: 12px;
        background-color: #ffffff;
        box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
    }

    body.cursor-hover .custom-cursor-ring {
        width: 52px;
        height: 52px;
        border-color: var(--accent-color, #007aff);
        background-color: rgba(0, 122, 255, 0.1);
    }
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
    transition: background-color var(--transition-med), box-shadow var(--transition-med);
}

.navbar.scrolled {
    background-color: rgba(2, 4, 10, 0.94);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

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

.logo {
    font-weight: 800;
    font-size: 0.84rem;
    letter-spacing: 0;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.logo-dot {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(0, 122, 255, 0.98), rgba(0, 212, 255, 0.82));
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 16px 38px rgba(0, 122, 255, 0.36);
    font-size: 0.9rem;
    font-weight: 800;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    z-index: 1002;
    width: 28px;
    height: 20px;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
}

.menu-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    position: absolute;
    left: 0;
}

.menu-toggle .bar1 {
    top: 0;
}

.menu-toggle .bar2 {
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle .bar3 {
    bottom: 0;
    width: 70%;
}

.menu-toggle.active .bar1 {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar2 {
    opacity: 0;
    transform: translateX(10px);
}

.menu-toggle.active .bar3 {
    width: 100%;
    transform: translateY(-9px) rotate(-45deg);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 650;
    padding: 8px 10px;
    border-radius: 999px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
}

.btn-download {
    background: var(--accent-gradient);
    color: white !important;
    padding: 10px 18px !important;
    border-radius: 999px;
    font-weight: 800;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.btn-download::after {
    display: none !important;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px var(--accent-glow);
}

/* ===== SECTIONS ===== */
.section {
    padding: 92px 0 36px;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    font-weight: 850;
    margin-bottom: 26px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-bottom: 14px;
    letter-spacing: -0.03em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 96px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 3px;
}

.section-icon {
    color: var(--accent-color);
    font-size: 1.25rem;
    padding: 10px;
    border-radius: 12px;
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.sub-section-title {
    margin: 40px 0 20px;
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    margin-bottom: 34px;
    padding: 86px 24px 64px;
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(0, 122, 255, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 16px;
    border-radius: 22px;
    border: 1px solid rgba(0, 122, 255, 0.16);
    pointer-events: none;
}

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

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.avatar-img {
    width: 138px;
    height: 138px;
    border-radius: 28px;
    border: 1px solid rgba(0, 122, 255, 0.34);
    background-color: var(--card-bg-solid);
    transition: transform var(--transition-med), box-shadow var(--transition-med);
    position: relative;
    z-index: 2;
}

.avatar-img:hover {
    transform: scale(1.08);
    box-shadow: 0 24px 60px rgba(0, 122, 255, 0.28);
}

.avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 34px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: 1;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.glitch-text {
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
    line-height: 0.98;
    text-wrap: balance;
    text-shadow: 0 0 42px rgba(0, 122, 255, 0.28);
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #d9e6f9;
    margin-bottom: 28px;
    min-height: 1.7em;
}

.typing-text {
    color: #d9e6f9;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--accent-color);
    font-weight: 300;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.social-links a {
    color: #d8e6fa;
    font-size: 1.25rem;
    transition: transform var(--transition-med), color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.social-links a:hover {
    color: #fff;
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--accent-gradient);
    box-shadow: 0 18px 40px rgba(0, 122, 255, 0.24);
}

/* ===== GLASS CARDS ===== */
.card,
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 30px;
    margin-bottom: 22px;
    transition: border-color var(--transition-med), transform var(--transition-med), box-shadow var(--transition-med), background var(--transition-med);
    text-decoration: none;
    color: inherit;
    display: block;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.card::before,
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 38%);
    opacity: 0.5;
    pointer-events: none;
}

.card > *,
.glass-card > * {
    position: relative;
    z-index: 1;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-med);
    z-index: 2;
}

.card:hover .card-accent {
    opacity: 1;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38), 0 14px 44px rgba(0, 122, 255, 0.12);
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1.32rem;
    position: relative;
}

.card-icon {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.card-icon-sm {
    color: var(--accent-color);
    font-size: 0.95rem;
    margin-right: 6px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.7;
}

/* ===== BADGE ===== */
.badge {
    background: var(--accent-gradient);
    color: white;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
}

.badge-score {
    background: rgba(0, 122, 255, 0.15);
    color: var(--accent-color);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), var(--accent-color), transparent);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 32px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 6px rgba(0, 122, 255, 0.1), 0 0 22px var(--accent-glow);
    z-index: 2;
}

.timeline-header,
.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}

.date {
    background: rgba(0, 122, 255, 0.13);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--accent-color);
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 122, 255, 0.15);
}

.company {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
}

.company i {
    color: var(--accent-color);
    font-size: 0.85rem;
}

/* ===== PROJECTS (FLAT CARDS) ===== */
.project-card-flat {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card-flat h4 {
    font-size: 1.06rem;
    font-weight: 750;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.project-card-flat p {
    margin-bottom: 12px;
}

.project-link {
    font-size: 0.82rem;
    color: #67c7ff;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition-fast);
}

.project-card-flat:hover .project-link {
    gap: 10px;
}

/* ===== SKILLS ===== */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.skill-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 760;
    color: var(--text-primary);
}

.skill-group h3 i {
    color: var(--accent-color);
    font-size: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.tag {
    background-color: rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.83rem;
    color: #dfeaff;
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.tag:hover {
    border-color: var(--border-hover);
    background: rgba(0, 122, 255, 0.14);
    transform: translateY(-2px);
}

a:focus-visible,
.menu-toggle:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 4px;
}

.hobby-tag {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hobby-tag i {
    color: var(--accent-color);
    font-size: 0.85rem;
}

/* ===== EXTRAS ===== */
.extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.extra-item {
    text-align: center;
    padding: 36px 28px;
}

.extra-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.extra-icon i {
    font-size: 1.6rem;
    color: #fff;
}

.extra-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.extra-stat {
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    text-shadow: 0 0 28px rgba(0, 122, 255, 0.36);
    margin-bottom: 4px !important;
}

.extra-detail {
    font-size: 1rem !important;
    color: var(--text-primary) !important;
    font-weight: 500;
}

.extra-label {
    font-size: 0.82rem !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* ===== EDUCATION ===== */
.edu-item h4 {
    font-size: 0.98rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== HOBBIES ===== */
.hobbies h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.hobbies h3 i {
    color: var(--accent-bright);
}

/* ===== FOOTER ===== */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, transparent, rgba(0, 122, 255, 0.04));
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== SCROLL REVEAL ANIMATION ===== */
.reveal {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(26px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), filter 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(180deg, rgba(5, 9, 18, 0.98), rgba(2, 4, 10, 0.98));
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 0 24px;
        border-bottom: 1px solid var(--border-color);
        gap: 0;
        align-items: flex-start;
        z-index: 1001;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            transform 0.3s ease,
            padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
    }

    .nav-links.active {
        max-height: 620px;
        opacity: 1;
        transform: translateY(0);
        padding: 16px 24px 20px;
    }

    .nav-links li {
        width: 100%;
        opacity: 0;
        transform: translateX(-12px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-links.active li:nth-child(1) {
        transition-delay: 0.05s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.15s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(5) {
        transition-delay: 0.25s;
    }

    .nav-links.active li:nth-child(6) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(7) {
        transition-delay: 0.35s;
    }

    .nav-links a {
        display: block;
        width: 100%;
        font-size: 1rem;
        padding: 11px 12px;
    }

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

    .btn-download {
        justify-content: center;
        margin-top: 8px;
    }

    .glitch-text {
        font-size: 3rem;
    }

    .hero {
        padding: 72px 18px 48px;
        border-radius: 24px;
    }

    .timeline-header,
    .edu-header {
        flex-direction: column;
        gap: 8px;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

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

    .timeline {
        padding-left: 24px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .edu-item h4 {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .glitch-text {
        font-size: 2.35rem;
    }

    .avatar-img {
        width: 120px;
        height: 120px;
        border-radius: 24px;
    }

    .avatar-glow {
        width: 150px;
        height: 150px;
    }
}

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