/* ========== CSS VARIABLES ========== */
:root {
    --purple: #7B5EA7;
    --purple-light: #9B7DC7;
    --purple-dark: #5A3D85;
    --lime: #CDFF00;
    --lime-dark: #B8E600;
    --black: #111111;
    --white: #FFFFFF;
    --gray-bg: #EDEDEE;
    --gray-light: #F5F5F6;
    --gray-mid: #C4C4C6;
    --gray-text: #6B6B6F;
    --font-main: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--purple) var(--gray-bg);
}

body {
    font-family: var(--font-main);
    background: var(--gray-bg);
    color: var(--black);
    overflow-x: hidden;
    line-height: 1.6;
}

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

ul {
    list-style: none;
}

/* ========== CUSTOM CURSOR ========== */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--lime);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.1s;
    mix-blend-mode: difference;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--purple);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s, width 0.3s, height 0.3s;
    transform: translate(-50%, -50%);
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(237, 237, 238, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.navbar.hidden {
    transform: translateY(-100%);
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--lime);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

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

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--purple);
    transition: width 0.3s;
}

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

.nav-links a:hover {
    color: var(--purple);
}

.nav-cta {
    background: var(--black);
    color: var(--white);
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid var(--black);
}

.nav-cta:hover {
    background: transparent;
    color: var(--black);
}

/* ========== HERO ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 60px 60px;
    position: relative;
    overflow: hidden;
}

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

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--black);
    color: var(--lime);
    padding: 8px 20px;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.hero-tag .blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -3px;
    margin-bottom: 24px;
}

.hero h1 .highlight {
    color: var(--purple);
    position: relative;
    display: inline-block;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--lime);
    z-index: -1;
    opacity: 0.7;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--gray-text);
    max-width: 550px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--purple);
    color: var(--white);
    padding: 14px 32px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid var(--purple);
    cursor: pointer;
    font-family: var(--font-main);
}

.btn-primary:hover {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(123, 94, 167, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--black);
    padding: 14px 32px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid var(--black);
    cursor: pointer;
    font-family: var(--font-main);
}

.btn-secondary:hover {
    background: var(--black);
    color: var(--white);
    transform: translateY(-2px);
}

/* Hero graphics */
.hero-graphics {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    z-index: 1;
}

.pixel-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pixel-block {
    position: absolute;
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.pixel-block:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Floating elements */
.float-element {
    position: absolute;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-15px) rotate(2deg); }
    66% { transform: translateY(-8px) rotate(-1deg); }
}

/* Terminal block in hero */
.hero-terminal {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    width: 460px;
    background: var(--black);
    border-radius: 16px;
    padding: 0;
    z-index: 2;
    box-shadow: 0 30px 80px rgba(0,0,0,0.2);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #FF5F57; }
.terminal-dot.yellow { background: #FEBC2E; }
.terminal-dot.green { background: #28C840; }

.terminal-title {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.terminal-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.7);
}

.terminal-line {
    display: flex;
    gap: 8px;
    opacity: 0;
    animation: typeIn 0.5s forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.5s; }
.terminal-line:nth-child(2) { animation-delay: 1s; }
.terminal-line:nth-child(3) { animation-delay: 1.5s; }
.terminal-line:nth-child(4) { animation-delay: 2s; }
.terminal-line:nth-child(5) { animation-delay: 2.5s; }
.terminal-line:nth-child(6) { animation-delay: 3s; }
.terminal-line:nth-child(7) { animation-delay: 3.5s; }

@keyframes typeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.terminal-prompt {
    color: var(--lime);
}

.terminal-cmd {
    color: var(--white);
}

.terminal-output {
    color: var(--purple-light);
}

.terminal-comment {
    color: rgba(255,255,255,0.3);
}

/* Decorative pixel shapes */
.deco-pixel {
    position: absolute;
    z-index: 0;
}

.deco-pixel svg {
    opacity: 0.15;
}

/* ========== MARQUEE ========== */
.marquee-section {
    padding: 30px 0;
    background: var(--black);
    overflow: hidden;
    position: relative;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 40px;
    white-space: nowrap;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.marquee-item .sep {
    width: 8px;
    height: 8px;
    background: var(--lime);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========== SECTION STYLES ========== */
.section {
    padding: 120px 60px;
}

.section-header {
    margin-bottom: 60px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.section-label::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--purple);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.15;
}

/* ========== ABOUT ========== */
.about {
    background: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--gray-text);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: var(--gray-bg);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-text);
    margin-top: 4px;
}

/* About visual */
.about-visual {
    position: relative;
}

.about-card {
    background: var(--black);
    border-radius: 20px;
    padding: 40px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--purple), transparent, var(--lime), transparent);
    animation: rotate 8s linear infinite;
    opacity: 0.1;
}

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

.about-card-content {
    position: relative;
    z-index: 1;
}

.about-card .code-block {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 2;
}

.code-keyword { color: var(--purple-light); }
.code-string { color: var(--lime); }
.code-prop { color: #FF8C42; }
.code-bracket { color: rgba(255,255,255,0.4); }
.code-comment { color: rgba(255,255,255,0.25); }

/* ========== SKILLS ========== */
.skills {
    background: var(--gray-bg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skill-card {
    background: var(--white);
    border-radius: 20px;
    padding: 36px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0%;
    background: var(--purple);
    transition: height 0.4s;
}

.skill-card:hover::before {
    height: 100%;
}

.skill-card:hover {
    transform: translateY(-6px);
    border-color: var(--purple);
    box-shadow: 0 20px 50px rgba(123, 94, 167, 0.1);
}

.skill-icon {
    width: 56px;
    height: 56px;
    background: var(--gray-bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.skill-card:hover .skill-icon {
    background: var(--lime);
    transform: rotate(-5deg) scale(1.05);
}

.skill-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.skill-card p {
    font-size: 0.9rem;
    color: var(--gray-text);
    line-height: 1.6;
}

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

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 10px;
    background: var(--gray-bg);
    border-radius: 6px;
    color: var(--gray-text);
    transition: all 0.3s;
}

.skill-card:hover .skill-tag {
    background: rgba(123, 94, 167, 0.1);
    color: var(--purple);
}

/* ========== EXPERIENCE / TIMELINE ========== */
.experience {
    background: var(--black);
    color: var(--white);
}

.experience .section-label {
    color: var(--lime);
}

.experience .section-label::before {
    background: var(--lime);
}

.timeline {
    position: relative;
    max-width: 900px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--purple), var(--lime));
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-dot {
    position: absolute;
    left: 15px;
    top: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--purple);
    border: 4px solid var(--black);
    z-index: 1;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--lime);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.timeline-company {
    font-size: 0.95rem;
    color: var(--purple-light);
    margin-bottom: 12px;
}

.timeline-desc {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
}

/* ========== PROJECTS ========== */
.projects {
    background: var(--white);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--gray-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.12);
}

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

.project-preview-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: transform 0.4s;
}

.project-card:hover .project-preview-inner {
    transform: scale(1.05);
}

.project-preview-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.project-number {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 100px;
}

.project-info {
    padding: 28px;
}

.project-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.project-info p {
    font-size: 0.9rem;
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 16px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: var(--white);
    color: var(--purple);
    font-weight: 500;
    border: 1px solid rgba(123, 94, 167, 0.15);
}

.project-arrow {
    position: absolute;
    bottom: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.project-card:hover .project-arrow {
    background: var(--purple);
    transform: translate(4px, -4px);
}

.project-arrow svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--white);
    stroke-width: 2;
}

/* ========== TECH STACK GRID ========== */
.tech-stack {
    background: var(--gray-bg);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.tech-item {
    background: var(--white);
    padding: 24px 16px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s;
    cursor: default;
    border: 2px solid transparent;
}

.tech-item:hover {
    border-color: var(--purple);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

.tech-item .tech-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.tech-item .tech-name {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.tech-item .tech-level {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-text);
    margin-top: 4px;
}

/* ========== DATA PIPELINE VISUAL ========== */
.pipeline-section {
    background: var(--black);
    color: var(--white);
    padding: 100px 60px;
    overflow: hidden;
}

.pipeline-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    margin-top: 50px;
}

.pipeline-node {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    min-width: 150px;
    transition: all 0.3s;
    position: relative;
}

.pipeline-node:hover {
    border-color: var(--purple);
    background: rgba(123, 94, 167, 0.1);
    transform: translateY(-4px);
}

.pipeline-node .node-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pipeline-node .node-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.pipeline-node .node-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-text);
    margin-top: 4px;
}

.pipeline-arrow {
    font-size: 1.5rem;
    color: var(--lime);
    padding: 0 16px;
    animation: arrowPulse 2s infinite;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(4px); }
}

/* ========== CONTACT ========== */
.contact {
    background: var(--white);
    text-align: center;
}

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

.contact-desc {
    font-size: 1.05rem;
    color: var(--gray-text);
    max-width: 500px;
    margin: 0 auto 50px;
    line-height: 1.7;
}

.contact-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.contact-card {
    background: var(--gray-bg);
    padding: 32px 40px;
    border-radius: 20px;
    transition: all 0.3s;
    min-width: 200px;
    border: 2px solid transparent;
}

.contact-card:hover {
    border-color: var(--purple);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.contact-card .contact-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.contact-card .contact-label {
    font-size: 0.8rem;
    color: var(--gray-text);
    margin-bottom: 4px;
}

.contact-card .contact-value {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 50px 60px 30px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-brand .logo {
    margin-bottom: 12px;
    color: var(--white);
}

.footer-brand p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    max-width: 300px;
}

.footer-links-group h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links-group a {
    display: block;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-links-group a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3);
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.08);
}

.footer-socials a:hover {
    background: var(--purple);
    border-color: var(--purple);
    transform: translateY(-2px);
}

/* ========== SCROLL REVEAL ========== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* ========== RESPONSIVE & MOBILE STYLES ========== */
@media (max-width: 1024px) {
    .hero-terminal {
        display: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 16px 24px;
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1002;
        background: none;
        border: none;
        padding: 6px;
    }

    .mobile-menu-btn span {
        width: 24px;
        height: 2px;
        background: var(--black);
        transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
        display: block;
    }

    .mobile-menu-btn.active span {
        background: var(--white);
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: var(--black);
        color: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 28px;
        padding: 40px 24px;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
        transition: right 0.35s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 1001;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1.15rem;
        color: var(--white);
        font-weight: 600;
    }

    .nav-links a:hover {
        color: var(--lime);
    }

    .nav-links a::after {
        background: var(--lime);
    }

    .nav-cta {
        border-color: var(--lime);
        color: var(--lime);
        background: transparent;
        margin-top: 12px;
        padding: 12px 28px;
    }

    .nav-cta:hover {
        background: var(--lime);
        color: var(--black);
    }

    /* Mobile backdrop */
    .nav-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    .hero {
        padding: 110px 24px 60px;
        min-height: auto;
    }

    .section {
        padding: 80px 24px;
    }

    .pipeline-section {
        padding: 80px 24px;
    }

    .footer {
        padding: 40px 24px 24px;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

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

    .pipeline-visual {
        flex-direction: column;
        gap: 8px;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
        padding: 8px 0;
    }

    .hero h1 {
        letter-spacing: -1.5px;
    }
}

/* Small mobile devices (e.g. <= 480px) */
@media (max-width: 480px) {
    .section {
        padding: 60px 18px;
    }

    .hero {
        padding: 95px 18px 45px;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 9vw, 3.2rem);
        letter-spacing: -1px;
    }

    .hero-desc {
        font-size: 0.98rem;
        margin-bottom: 30px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 12px 24px;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

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

    .about-card .code-block {
        font-size: 0.72rem;
        overflow-x: auto;
    }

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

    .skill-card {
        padding: 24px 20px;
    }

    .timeline-item {
        padding-left: 45px;
        margin-bottom: 36px;
    }

    .timeline-dot {
        left: 9px;
        width: 16px;
        height: 16px;
    }

    .timeline::before {
        left: 16px;
    }

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

    .project-preview {
        height: 170px;
    }

    .project-info {
        padding: 20px 18px;
    }

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

    .contact-card {
        width: 100%;
        min-width: 0;
        padding: 24px 18px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* Touch devices: hide custom desktop cursor */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-ring {
        display: none !important;
    }
}

/* ========== NOISE TEXTURE OVERLAY ========== */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--purple);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    border: none;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(123, 94, 167, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--purple-dark);
    transform: translateY(-2px);
}
