@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --primary: #f59e0b;
    --primary-hover: #fbbf24;
    --primary-light: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --success: #22c55e;
    --accent: #fafafa;
    --gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Light theme — applied via <html data-theme="light">. Keeps the same amber accent. */
[data-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --surface: rgba(0, 0, 0, 0.02);
    --surface-hover: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.10);
    --border-hover: rgba(0, 0, 0, 0.20);
    --text: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-light: rgba(234, 88, 12, 0.10);
    --gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --error: #dc2626;
    --success: #16a34a;
    --accent: #18181b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

/* Unified scroll-reveal — added by JS, revealed via IntersectionObserver.
   Same "comes in as you scroll" feel on every page; never gets stuck invisible. */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Header theme/language controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 24px;
}

.btn-cv-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 100px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-cv-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
    font-size: 0.9rem;
}

.ctrl-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.lang-switch button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 7px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.lang-switch button.active {
    background: var(--primary);
    color: #fff;
}

.lang-switch button:not(.active):hover {
    color: var(--text);
}

.mobile-menu-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.mobile-menu-controls .ctrl-btn {
    width: auto;
    border-radius: 100px;
    padding: 8px 16px;
}

/* Hide the desktop header controls at the same breakpoint the nav collapses;
   theme/language/download then live inside the mobile menu. */
@media (max-width: 968px) {
    .header-controls {
        display: none;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

@media (hover: none) {
    body { cursor: auto; }
}

@media (hover: none), (pointer: coarse) {
    #cursor, #cursor-blur { display: none !important; }
}

#touch-indicator {
    position: fixed;
    width: 80px;
    height: 80px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s, width 0.3s, height 0.3s, border-color 0.3s;
    will-change: transform;
    mix-blend-mode: difference;
}

#touch-indicator.active {
    opacity: 0.6;
    width: 100px;
    height: 100px;
    border-color: var(--primary-hover);
}

#touch-ripple {
    position: fixed;
    width: 20px;
    height: 20px;
    background: rgba(245, 158, 11, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    opacity: 0;
}

@keyframes touchRipple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

.touch-ripple-animate {
    animation: touchRipple 0.6s ease-out forwards;
}

#bg-effects {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 80% 90%, rgba(249, 115, 22, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    animation: gradientShift 15s ease-in-out infinite;
}

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

.bg-shapes {
    position: absolute;
    inset: 0;
    perspective: 1000px;
}

.shape {
    position: absolute;
    transform-style: preserve-3d;
}

.shape-cube {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 10%;
    animation: floatRotate 20s ease-in-out infinite;
}

.shape-cube::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.03);
    transform: rotateY(45deg) rotateX(45deg);
    box-shadow: 
        0 0 30px rgba(245, 158, 11, 0.2),
        inset 0 0 30px rgba(245, 158, 11, 0.1);
}

.shape-cube::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    transform: rotateY(45deg) rotateX(45deg);
}

@keyframes floatRotate {
    0%, 100% { 
        transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    25% {
        transform: translateY(-30px) rotateX(90deg) rotateY(45deg) rotateZ(15deg);
    }
    50% { 
        transform: translateY(-50px) rotateX(180deg) rotateY(90deg) rotateZ(30deg);
    }
    75% {
        transform: translateY(-30px) rotateX(270deg) rotateY(135deg) rotateZ(45deg);
    }
}

.shape-torus {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    border: 40px solid transparent;
    border-radius: 50%;
    border-top-color: rgba(245, 158, 11, 0.3);
    border-right-color: rgba(245, 158, 11, 0.1);
    animation: spin 25s linear infinite;
}

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

.shape-ring {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 5%;
    border: 3px solid rgba(245, 158, 11, 0.2);
    border-radius: 50%;
    animation: pulseRing 8s ease-in-out infinite;
}

@keyframes pulseRing {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.6;
    }
}

.shape-pyramid {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 100px solid rgba(245, 158, 11, 0.1);
    top: 40%;
    right: 25%;
    animation: floatPyramid 15s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.2));
}

.shape-pyramid::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 100px solid rgba(245, 158, 11, 0.2);
    transform: translate(-60px, 20px);
}

@keyframes floatPyramid {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(180deg); }
}

.shape-grid {
    position: absolute;
    inset: -50%;
    background-image: 
        linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
    to { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

.bg-particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(245, 158, 11, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: particleFloat 10s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; top: 40%; animation-delay: 1s; animation-duration: 8s; }
.particle:nth-child(3) { left: 30%; top: 60%; animation-delay: 2s; animation-duration: 15s; }
.particle:nth-child(4) { left: 40%; top: 30%; animation-delay: 0.5s; animation-duration: 10s; }
.particle:nth-child(5) { left: 50%; top: 70%; animation-delay: 1.5s; animation-duration: 13s; }
.particle:nth-child(6) { left: 60%; top: 25%; animation-delay: 2.5s; animation-duration: 9s; }
.particle:nth-child(7) { left: 70%; top: 55%; animation-delay: 0.8s; animation-duration: 11s; }
.particle:nth-child(8) { left: 80%; top: 35%; animation-delay: 1.8s; animation-duration: 14s; }
.particle:nth-child(9) { left: 85%; top: 65%; animation-delay: 3s; animation-duration: 7s; }
.particle:nth-child(10) { left: 15%; top: 80%; animation-delay: 2.2s; animation-duration: 16s; }
.particle:nth-child(11) { left: 25%; top: 15%; animation-delay: 0.3s; animation-duration: 12s; }
.particle:nth-child(12) { left: 55%; top: 45%; animation-delay: 1.2s; animation-duration: 8s; }
.particle:nth-child(13) { left: 75%; top: 75%; animation-delay: 2.8s; animation-duration: 10s; }
.particle:nth-child(14) { left: 35%; top: 85%; animation-delay: 0.7s; animation-duration: 13s; }
.particle:nth-child(15) { left: 90%; top: 50%; animation-delay: 1.7s; animation-duration: 9s; }

@keyframes particleFloat {
    0%, 100% { 
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-100px) translateX(30px) scale(1.5);
        opacity: 1;
    }
    50% { 
        transform: translateY(-50px) translateX(-20px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-150px) translateX(10px) scale(1.2);
        opacity: 0.8;
    }
}

.shape-terminal {
    position: absolute;
    width: 300px;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.cmd-terminal {
    top: 10%;
    right: 4%;
    transform: rotate(-1deg);
    animation: cmdFloat 8s ease-in-out infinite;
    z-index: 2;
}

.log-terminal {
    top: 52%;
    right: 6%;
    transform: rotate(1deg);
    animation: logFloat 8s ease-in-out infinite 0.3s;
    z-index: 1;
}

@keyframes cmdFloat {
    0%, 100% { transform: rotate(-1deg) translateY(0); }
    50% { transform: rotate(-1deg) translateY(-8px); }
}

@keyframes logFloat {
    0%, 100% { transform: rotate(1deg) translateY(0); }
    50% { transform: rotate(1deg) translateY(8px); }
}

.terminal-header {
    background: rgba(220, 38, 38, 0.9);
    padding: 12px 15px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.log-header {
    background: rgba(34, 197, 94, 0.9);
}

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

.terminal-dot.red { background: #fca5a5; }
.terminal-dot.yellow { background: #fde047; }
.terminal-dot.green { background: #86efac; }

.terminal-body {
    padding: 12px 15px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #4ade80;
    line-height: 1.7;
    max-height: 200px;
    min-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 222, 128, 0.3) transparent;
}

.cmd-body {
    height: 200px;
}

.log-body {
    height: 180px;
}

.terminal-body::-webkit-scrollbar {
    width: 4px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.3);
    border-radius: 2px;
}

.terminal-line {
    opacity: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line.cmd-line {
    color: #4ade80;
}

.terminal-line.log-line {
    color: #fde047;
    opacity: 0;
}

.terminal-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    margin-left: 10px;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #4ade80;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {
    50% { opacity: 0; }
}

#cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
    will-change: transform;
}

#cursor-blur {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    will-change: transform;
}

body.cursor-hover #cursor {
    width: 50px;
    height: 50px;
    border-color: var(--primary-hover);
    background: rgba(245, 158, 11, 0.15);
    mix-blend-mode: normal;
}

#loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.loader-logo {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 40px;
    overflow: hidden;
}

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

.loader-bar {
    width: 200px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 16px;
}

.loader-progress {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease-out;
}

.loader-percent {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 150px 0;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.section-label::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--primary);
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.8;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 24px 0;
    transition: all 0.4s ease;
}

header.scrolled {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--border);
    padding: 16px 0;
}

[data-theme="light"] header.scrolled {
    background: rgba(255, 255, 255, 0.85);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.03em;
}

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

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

nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}

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

nav a:hover::after {
    width: 100%;
}

nav a.active::after {
    width: 100%;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
    z-index: 1;
}

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

.hero-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.hero-label .dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 32px;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.hero-title .accent {
    color: var(--primary);
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 48px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.hero-scroll {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-scroll .line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--primary), transparent);
    animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
    margin-top: 80px;
}

.projects-group {
    margin-bottom: 48px;
}

.projects-group-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.projects-group .projects-grid {
    margin-top: 0;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(245, 158, 11, 0.1);
}

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

.project-card-image {
    aspect-ratio: 16/10;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-card-image img {
    transform: scale(1.08);
}

.project-card-content {
    padding: 28px;
    position: relative;
    z-index: 1;
}

.project-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.project-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.project-card-tech span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 12px;
    border-radius: 100px;
}

.project-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.project-card-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.project-card-links a:hover {
    color: var(--primary);
}

.cv-section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.cv-section:last-child {
    border-bottom: none;
}

.cv-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
}

.cv-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cv-section-title::before {
    content: '';
    width: 30px;
    height: 1px;
    background: var(--primary);
}

.cv-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 40px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.cv-item > * {
    min-width: 0;
}

.cv-item:last-child {
    border-bottom: none;
}

.cv-item:hover {
    padding-left: 16px;
}

.cv-item-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cv-item-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.project-detail-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.project-detail-link:hover {
    color: var(--primary);
}

.cv-item-subtitle {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.cv-item-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.cv-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.cv-skill-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
}

.cv-skill-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.cv-skill-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.cv-skill-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cv-skill-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.cv-skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
    transition: width 1s ease-out;
}

/* Home — compact featured projects grid */
.home-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.home-project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.home-project-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.home-project-year {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.home-project-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 10px 0 8px;
}

.home-project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.home-project-tech span {
    font-size: 0.7rem;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
}

.home-project-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.home-project-card:hover .home-project-more i {
    transform: translateX(4px);
}

.home-project-more i {
    transition: transform 0.3s ease;
}

.home-projects-all {
    margin-top: 40px;
    text-align: center;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
    margin-top: 80px;
}

.contact-info h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
}

.contact-link:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(8px);
}

.contact-link-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
}

.contact-link-text {
    flex: 1;
}

.contact-link-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-link-value {
    font-weight: 600;
}

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    min-height: 150px;
    resize: vertical;
}

.form-submit {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: none;
    transition: all 0.4s ease;
}

.form-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.3);
}

footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 80px 0 40px;
    position: relative;
    z-index: 1;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 60px;
}

.footer-brand .logo {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: inline-block;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 300px;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 80px;
}

.footer-links-group h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.footer-links-group a {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 14px;
    transition: color 0.3s ease;
}

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

.footer-social {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.footer-social a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    transition: all 0.4s ease;
}

.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
    transform: translateY(-4px);
}

.footer-bottom {
    width: 100%;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
}

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

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

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

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    transition: right 0.4s ease;
    z-index: 999;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    color: var(--primary);
}

@media (max-width: 968px) {
    nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .section {
        padding: 100px 0;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .cv-item {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .cv-item-date {
        font-size: 0.8rem;
        color: var(--primary);
        font-weight: 600;
    }

    .project-card-links {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    footer .container {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 40px;
    }

    .shape-terminal {
        display: block;
        opacity: 0.35;
        transform-origin: right center;
    }

    .cmd-terminal {
        top: 2%;
        right: -5%;
        animation: cmdFloatMobile 8s ease-in-out infinite;
    }

    .log-terminal {
        top: 55%;
        right: -5%;
        animation: logFloatMobile 8s ease-in-out infinite 0.3s;
    }

    @keyframes cmdFloatMobile {
        0%, 100% { transform: scale(0.7) rotate(-1deg) translateY(0); }
        50% { transform: scale(0.7) rotate(-1deg) translateY(-8px); }
    }

    @keyframes logFloatMobile {
        0%, 100% { transform: scale(0.7) rotate(1deg) translateY(0); }
        50% { transform: scale(0.7) rotate(1deg) translateY(8px); }
    }
}

@media (max-width: 1400px) and (min-width: 969px) {
    .shape-terminal {
        width: 250px;
        opacity: 0.7;
    }

    .cmd-terminal {
        right: 2%;
    }

    .log-terminal {
        right: 3%;
    }

    .cmd-body {
        height: 160px;
    }

    .log-body {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .project-card-tech span {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .cv-item {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 24px 0;
    }
    
    .cv-item-date {
        font-size: 0.75rem;
    }
    
    .cv-item-title {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .contact-form {
        padding: 24px;
    }
    
    footer {
        padding: 60px 0 30px;
    }
    
    .footer-social a {
        width: 40px;
        height: 40px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .hero-title {
        font-size: 1.8rem;
    }
}
@media (max-width: 768px) {
    .section {
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    
    .cv-item {
        opacity: 1;
        transform: none;
    }
}

.cv-item-title, .cv-item-title a {
    word-break: break-word;
    white-space: normal;
}
