/* ===== CSS Variables ===== */
:root {
    --bg-primary: #f6f3ec;
    --bg-secondary: #fbf8f2;
    --bg-tertiary: #ffffff;
    --bg-card: #ffffff;
    
    --text-primary: #2b2a28;
    --text-secondary: #5f5b55;
    --text-muted: #8a847b;
    
    --accent-primary: #2f7f7a;
    --accent-secondary: #5f5b55;
    --accent-tertiary: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #2f7f7a 100%, #22d3ee 0%);
    
    --border-color: rgba(47, 127, 122, 0.18);
    --shadow-color: rgba(47, 127, 122, 0.15);
    
    --font-primary: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --container-max: 1200px;
    --section-padding: 100px 0;
}

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

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

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

/* ===== Background Animation ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(244, 183, 64, 0.18), transparent 55%),
        radial-gradient(circle at 20% 60%, rgba(47, 127, 122, 0.15), transparent 60%),
        linear-gradient(180deg, #fbf8f2 0%, #f6f3ec 100%);
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(47, 127, 122, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 127, 122, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0.6;
    }
}

/* ===== Container ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    /* background: rgba(246, 243, 236, 0.8); */
    backdrop-filter: blur(20px);
    /* border-bottom: 1px solid var(--border-color); */
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(246, 243, 236, 0.8);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1101;
}

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

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--transition-normal);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

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

.nav-tagline {
    display: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px 9px;
    border-radius: 999px;
    box-shadow: none;
    z-index: 1001;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 999px;
    transition: all var(--transition-fast);
}

.nav-toggle span:nth-child(2) {
    width: 18px;
}

.nav-toggle span:nth-child(3) {
    width: 12px;
}

.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

.nav-toggle:hover span {
    transform: translateX(2px);
}

/* ===== Section Styles ===== */
section {
    padding: var(--section-padding);
}

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

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-primary);
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 80px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-secondary);
    margin-bottom: 8px;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-title-prefix {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 1.5rem;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--accent-secondary);
}

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

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    font-family: var(--font-primary);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(239, 122, 89, 0.3);
}

.btn-secondary {
    background: rgba(47, 127, 122, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(47, 127, 122, 0.08);
    border-color: var(--accent-primary);
}

/* ===== Hero Stats ===== */
.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Hero Visual ===== */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.data-viz {
    width: 100%;
    max-width: 400px;
}

.neural-network {
    width: 100%;
    height: auto;
}

.node {
    animation: pulse 2s ease-in-out infinite;
}

.node:nth-child(odd) {
    animation-delay: 0.5s;
}

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

.connections line {
    animation: connectionPulse 3s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% {
        stroke-opacity: 0.3;
    }
    50% {
        stroke-opacity: 0.6;
    }
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.scroll-arrow {
    width: 20px;
    height: 30px;
    border: 2px solid rgba(47, 127, 122, 0.5);
    border-radius: 10px;
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: 2px;
    animation: scrollBounce 1.5s infinite;
}

@keyframes scrollBounce {
    0%, 100% { top: 6px; opacity: 1; }
    50% { top: 14px; opacity: 0.5; }
}

/* ===== About Section ===== */
.about {
    background: var(--bg-secondary);
}

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

.about-lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.7;
}

.about-lead strong {
    color: var(--accent-secondary);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-badges {
    display: flex;
    gap: 24px;
    margin-top: 32px;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 0;
}

.badge img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.badge span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.badge.credly-badge {
    padding: 0;
    background: transparent;
    border: none;
    min-height: auto;
    min-width: 165px;
}

.badge-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(47, 127, 122, 0.08);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.badge-fallback:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.badge-fallback img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.badge-fallback span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Hide fallback when Credly iframe loads */
.badge.credly-badge iframe ~ .badge-fallback {
    display: none;
}

/* ===== Code Window ===== */
.code-window {
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(47, 127, 122, 0.15);
    width: 100%;
}

.window-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.filename {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.code-content {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
}

.code-content code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

.keyword { color: #b45309; }
.class-name { color: #2f7f7a; }
.function { color: #1d4ed8; }
.param { color: #b91c1c; }
.string { color: #15803d; }

/* ===== Skills Section ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.skill-category {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.skill-category:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.category-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.skill-category h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    padding: 6px 12px;
    background: rgba(47, 127, 122, 0.08);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ===== Projects Section ===== */
.projects {
    background: var(--bg-secondary);
}

.projects-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.filter-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

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

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

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.project-image {
    position: relative;
    height: 180px;
    background: rgba(47, 127, 122, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.project-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(47, 127, 122, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.project-link {
    padding: 12px 24px;
    background: #ffffff;
    color: var(--accent-primary);
    border-radius: 8px;
    font-weight: 600;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

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

.project-content {
    padding: 24px;
}

.project-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 8px 0 12px;
    color: var(--text-primary);
}

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

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

.project-tech span {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ===== Journey Section ===== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding: 20px 0;
    display: flex;
    justify-content: flex-end;
    width: 50%;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    justify-content: flex-start;
}

.timeline-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    right: -8px;
    top: 28px;
    box-shadow: 0 0 0 4px var(--bg-secondary), 0 0 16px rgba(47, 127, 122, 0.35);
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -8px;
    right: auto;
}

.timeline-content {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: calc(100% - 40px);
    margin-right: 40px;
    transition: all var(--transition-normal);
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 40px;
    margin-right: 0;
}

.timeline-content:hover {
    border-color: var(--accent-primary);
    transform: translateX(-4px);
}

.timeline-item:nth-child(even) .timeline-content:hover {
    transform: translateX(4px);
}

.timeline-year {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin: 8px 0;
    color: var(--text-primary);
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: rgba(47, 127, 122, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

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

.contact-item a,
.contact-item span {
    color: var(--text-primary);
    font-size: 1rem;
    word-break: break-word;
}

.contact-item a:hover {
    color: var(--accent-primary);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 48px;
    height: 48px;
    background: rgba(47, 127, 122, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.social-link svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.social-link:hover svg {
    color: white;
}

/* ===== Contact Terminal ===== */
.contact-terminal {
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(47, 127, 122, 0.15);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.terminal-title {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.terminal-body {
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
}

.terminal-body p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.prompt {
    color: var(--accent-secondary);
}

.json-output {
    background: rgba(47, 127, 122, 0.08);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #1d4ed8;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.cursor-blink {
    animation: blink 1s infinite;
    color: var(--accent-secondary);
}

/* ===== Footer ===== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    text-align: center;
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-secondary);
}

/* ===== Back to Top Button ===== */
#back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 999;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(239, 122, 89, 0.35);
}

#back-to-top svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* ===== Responsive Design ===== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .skills-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-content,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .data-viz {
        max-width: 300px;
    }
    
    .about-image {
        order: -1;
    }
}

/* Tablets */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
    }
    
    .container {
        padding: 0 20px;
    }
    
    /* Navigation Mobile */
    .nav-links {
        position: fixed;
        inset: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: 100vh;
        background: rgba(246, 243, 236, 0.98);
        flex-direction: column;
        padding: 120px 32px 32px;
        gap: 28px;
        transition: transform var(--transition-normal), opacity var(--transition-normal);
        border-left: none;
        z-index: 900;
        opacity: 0;
        transform: translateY(-12px);
        pointer-events: none;
    }
    
    .nav-links.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        width: 24px;
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-6px);
    }
    
    .nav-toggle.active span:nth-child(3) {
        width: 24px;
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 1.4rem;
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-tagline {
        display: block;
        margin-top: auto;
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.2em;
        font-size: 0.75rem;
        color: var(--text-muted);
        padding-bottom: 70px;
    }

    /* Hero Mobile */
    .hero-content {
        padding: 0 20px;
        text-align: center;
    }
    
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-title-wrapper {
        justify-content: center;
    }
    
    .hero-description {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .btn {
        width: 100%;
    }
    
    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 32px;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* About Mobile - FIXED */
    .about-content {
        gap: 32px;
    }
    
    .about-text {
        text-align: center;
    }
    
    .about-lead {
        font-size: 1.1rem;
    }
    
    .about-text p {
        font-size: 0.95rem;
    }
    
    .about-badges {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }
    
    .badge {
        padding: 12px;
        flex: 0 1 auto;
        min-width: 120px;
    }
    
    .badge img {
        width: 50px;
        height: 50px;
    }
    
    .badge span {
        font-size: 0.7rem;
    }
    
    /* Code Window Mobile - FIXED */
    .about-image {
        width: 100%;
        padding: 0;
    }
    
    .code-window {
        margin: 0;
        border-radius: 12px;
    }
    
    .code-content {
        padding: 16px;
        font-size: 0.75rem;
        line-height: 1.6;
    }
    
    .code-content code {
        white-space: pre-wrap;
        word-break: break-word;
    }
    
    /* Skills Mobile */
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skill-category {
        padding: 24px;
    }
    
    /* Projects Mobile */
    .projects-filter {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .project-card {
        border-radius: 12px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    /* Timeline Mobile */
    .timeline::before {
        left: 8px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        padding-left: 32px;
    }
    
    .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 0;
        right: auto;
    }
    
    .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .timeline-content:hover,
    .timeline-item:nth-child(even) .timeline-content:hover {
        transform: none;
    }
    
    /* Contact Mobile */
    .contact-content {
        gap: 32px;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-details {
        align-items: center;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .contact-terminal {
        border-radius: 12px;
    }
    
    .terminal-body {
        padding: 16px;
        font-size: 0.75rem;
    }
    
    .json-output {
        padding: 12px;
        font-size: 0.7rem;
    }
    
    /* Section Headers Mobile */
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-tag {
        font-size: 0.8rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    :root {
        --section-padding: 48px 0;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .hero-name {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 1rem;
    }
    
    .hero-title-prefix {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* About Mobile Small */
    .about-lead {
        font-size: 1rem;
    }
    
    .about-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .badge {
        width: 100%;
        max-width: 200px;
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }
    
    .badge img {
        width: 40px;
        height: 40px;
    }
    
    /* Code Window Small Phones */
    .code-content {
        padding: 12px;
        font-size: 0.65rem;
        line-height: 1.5;
    }
    
    .window-header {
        padding: 10px 12px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
    
    .filename {
        font-size: 0.7rem;
    }
    
    /* Skills Small */
    .skill-category {
        padding: 20px;
    }
    
    .skill-category h3 {
        font-size: 1rem;
    }
    
    .skill-tag {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    /* Projects Small */
    .project-image {
        height: 150px;
    }
    
    .project-icon {
        width: 56px;
        height: 56px;
    }
    
    .project-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .project-content {
        padding: 16px;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    /* Timeline Small */
    .timeline-content {
        padding: 16px;
    }
    
    .timeline-content h3 {
        font-size: 1rem;
    }
    
    .timeline-content p {
        font-size: 0.85rem;
    }
    
    /* Contact Small */
    .contact-lead {
        font-size: 1rem;
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
    }
    
    .contact-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
    
    /* Back to Top Small */
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
    
    #back-to-top svg {
        width: 20px;
        height: 20px;
    }
    
    /* Footer Small */
    .footer {
        padding: 32px 0;
    }
    
    .copyright {
        font-size: 0.8rem;
    }
    
    .footer-tagline {
        font-size: 0.7rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero-name {
        font-size: 1.75rem;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .code-content {
        font-size: 0.6rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ===== Animation Utilities ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Selection Styles ===== */
::selection {
    background: var(--accent-secondary);
    color: #ffffff;
}

/* ===== Scrollbar Styles ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ===== Prevent horizontal scroll on mobile ===== */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
