/* ==========================================================
   DESIGN TOKENS
   ========================================================== */
:root {
    --bg: #050508;
    --bg-card: #0c0c14;
    --bg-elevated: #12121e;
    --surface: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.06);
    --text: #e8e6f0;
    --text-muted: #7a7890;
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.25);
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.2);
    --gradient: linear-gradient(135deg, var(--primary), var(--accent));
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --z-nav: 1000;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--text);
}

ul {
    list-style: none;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==========================================================
   LAYOUT UTILITIES
   ========================================================== */
.container {
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.section {
    padding: 7rem 0 4rem;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
}

/* ==========================================================
   PARTICLE CANVAS
   ========================================================== */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ==========================================================
   GRAIN OVERLAY
   ========================================================== */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.035;
    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.85' 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: 128px 128px;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-heading);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn--ghost {
    border: 1.5px solid var(--border);
    color: var(--text);
    backdrop-filter: blur(6px);
}

.btn--ghost:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-3px);
}

.btn--lg {
    padding: 1rem 2.25rem;
    font-size: 1.05rem;
}

/* ==========================================================
   REVEAL ANIMATIONS
   ========================================================== */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-up {
    transform: translateY(40px);
}

.reveal-left {
    transform: translateX(-40px);
}

.reveal-right {
    transform: translateX(40px);
}

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
    opacity: 1;
    transform: translate(0);
}

/* ==========================================================
   NAVIGATION
   ========================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-nav);
    transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
    padding: 0 1.5rem;
}

.header.scrolled {
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--border);
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.logo-bracket {
    color: var(--primary);
}

.nav__list {
    display: flex;
    gap: 2rem;
}

.nav__link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width var(--transition);
}

.nav__link:hover,
.nav__link.active {
    color: var(--text);
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav__cta {
    padding: 0.55rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--gradient);
    color: #fff;
    transition: var(--transition);
}

.nav__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.nav__close {
    display: none;
    font-size: 1.5rem;
    color: var(--text);
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 2rem;
    position: relative;
    z-index: 2;
}

.hero__container {
    max-width: 720px;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

.hero__title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero__name {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 400;
}

.hero__description {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    min-height: 1.7em;
}

.typed-wrapper {
    color: var(--primary-light);
    font-weight: 500;
}

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

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero__scroll-indicator {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    animation: float-scroll 3s ease-in-out infinite;
}

.mouse {
    width: 22px;
    height: 34px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.mouse-wheel {
    width: 3px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 3px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) translateY(8px);
        opacity: 0.3;
    }
}

@keyframes float-scroll {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* ==========================================================
   ABOUT
   ========================================================== */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about__text p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 1.02rem;
}

.about__text strong {
    color: var(--text);
}

.about__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-4px);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline;
}

.stat-plus {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================================
   SKILLS — BENTO GRID
   ========================================================== */
.skills__bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

.bento-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-4px);
}

.bento-card:hover::before {
    opacity: 1;
}

.bento--wide {
    grid-column: span 2;
}

.bento-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.bento-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.bento-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: var(--primary-light);
    transition: var(--transition);
}

.chip:hover {
    background: rgba(139, 92, 246, 0.18);
}

/* ==========================================================
   PROJECTS
   ========================================================== */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.project-card__image {
    position: relative;
    overflow: hidden;
    height: 220px;
}

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

.project-card:hover .project-card__image img {
    transform: scale(1.05);
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.project-card:hover .project-card__overlay {
    opacity: 1;
}

.overlay-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    transform: translateY(10px);
}

.project-card:hover .overlay-btn {
    transform: translateY(0);
}

.overlay-btn:hover {
    transform: scale(1.1) !important;
}

.project-card__body {
    padding: 1.5rem;
}

.project-card__body h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.project-card__body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-card__tags span {
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    color: var(--accent);
}

/* ==========================================================
   EXPERIENCE TIMELINE
   ========================================================== */
.timeline {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--accent), transparent);
}

.timeline__item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline__item:last-child {
    margin-bottom: 0;
}

.timeline__marker {
    position: absolute;
    left: -3rem;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 0.75rem;
    z-index: 2;
}

.timeline__content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: var(--transition);
}

.timeline__content:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.timeline__date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.2rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.timeline__content h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.timeline__content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================
   RESUME CTA
   ========================================================== */
.resume__card {
    position: relative;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    padding: 4rem 2rem;
    overflow: hidden;
}

.resume__glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    top: -100px;
    right: -50px;
    pointer-events: none;
}

.resume__card h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
}

.resume__card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 460px;
    margin-inline: auto;
}

/* ==========================================================
   CONTACT
   ========================================================== */
.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact__intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.02rem;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.contact__item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact__item h4 {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

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

.contact__socials {
    display: flex;
    gap: 0.75rem;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.15rem;
    transition: var(--transition);
}

.social-icon:hover {
    color: #fff;
    background: var(--gradient);
    border-color: transparent;
    transform: translateY(-3px);
}

/* Contact Form */
.contact__form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
}

.form-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 1rem;
    padding-top: 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    resize: vertical;
}

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

.form-field label {
    position: absolute;
    top: 1.15rem;
    left: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
}

.form-field input:focus+label,
.form-field input:not(:placeholder-shown)+label,
.form-field textarea:focus+label,
.form-field textarea:not(:placeholder-shown)+label {
    top: 0.4rem;
    font-size: 0.7rem;
    color: var(--primary-light);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--accent);
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
}

.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.footer__logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

.footer__links {
    display: flex;
    gap: 1.5rem;
}

.footer__links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer__links a:hover {
    color: var(--text);
}

.footer__copy {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================
   SCROLL TO TOP
   ========================================================== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1024px) {

    .about__grid,
    .contact__grid {
        grid-template-columns: 1fr;
    }

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

    .bento--wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: var(--bg-elevated);
        padding: 5rem 2rem;
        transition: right 0.4s ease;
        z-index: 1001;
        border-left: 1px solid var(--border);
    }

    .nav__menu.show {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: 1.75rem;
    }

    .nav__toggle {
        display: flex;
    }

    .nav__close {
        display: block;
    }

    .nav__cta {
        display: none;
    }

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

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

    .bento--wide {
        grid-column: span 1;
    }

    .hero__scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero__actions {
        flex-direction: column;
        align-items: center;
    }

    .about__stats {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem 1rem;
    }
}