:root {
    --primary: #0b0d12;
    --secondary: #161a23;
    --accent: #e8495f;
    --accent-dim: rgba(232, 73, 95, 0.12);
    --accent2: #3ecf8e;
    --accent2-dim: rgba(62, 207, 142, 0.12);
    --highlight: #242938;
    --text-primary: #e6e8ec;
    --text-secondary: #8b93a3;
    --text-muted: #5c6373;
    --glow: rgba(232, 73, 95, 0.12);
    --gradient-start: #1a1f2b;
    --gradient-end: #0b0d12;
    --discord-color: #5865F2;
    --online-color: #3ecf8e;
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 20% 80%, rgba(232, 73, 95, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(62, 207, 142, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 30%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(1deg); }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(11, 13, 18, 0.8);
    border-bottom: 1px solid var(--highlight);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    z-index: 1001;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.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(7px, -6px);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 5% 2rem;
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    display: block;
    border: 3px solid var(--accent);
    box-shadow: 0 8px 30px rgba(232, 73, 95, 0.35);
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-dim);
    border: 1px solid rgba(232, 73, 95, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    min-width: 160px;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 10px 30px rgba(232, 73, 95, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--highlight);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent2);
    color: var(--accent2);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Sections */
section {
    padding: 5rem 5%;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: clamp(0.9rem, 2vw, 1rem);
    padding: 0 1rem;
}

/* Experience Timeline */
.experience-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.experience-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.experience-item {
    position: relative;
    padding-left: 60px;
    padding-bottom: 2.5rem;
    animation: fadeInLeft 0.6s ease-out;
}

.experience-item:last-child {
    padding-bottom: 0;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.experience-dot {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    border: 3px solid var(--accent);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.experience-item:hover .experience-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(232, 73, 95, 0.5);
}

.experience-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-family: 'Space Grotesk', sans-serif;
}

.experience-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.experience-company {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.experience-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.experience-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.experience-tag {
    padding: 0.2rem 0.6rem;
    background: var(--accent2-dim);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--accent2);
    border: 1px solid rgba(62, 207, 142, 0.25);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background: var(--secondary);
    border: 1px solid var(--highlight);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(232, 73, 95, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card:hover::before {
    opacity: 1;
}

.project-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--highlight);
}

.project-content {
    padding: 1.25rem;
}

.project-tags {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.2rem 0.6rem;
    background: var(--accent2-dim);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--accent2);
    font-weight: 500;
}

.project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.skill-card {
    background: var(--secondary);
    border: 1px solid var(--highlight);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.skill-card:hover {
    border-color: var(--accent2);
    transform: translateY(-3px);
}

.skill-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.skill-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.skill-level {
    height: 4px;
    background: var(--highlight);
    border-radius: 2px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    border-radius: 2px;
    transition: width 1s ease;
    width: 0%;
}

/* Contact Section */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1rem;
}

.contact-card {
    background: var(--secondary);
    border: 1px solid var(--highlight);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 73, 95, 0.06) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.contact-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    line-height: 1.6;
}

.discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--discord-color);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    min-height: 52px;
    min-width: 200px;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.discord-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.4);
}

.discord-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

footer {
    padding: 2rem 5%;
    text-align: center;
    border-top: 1px solid var(--highlight);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(11, 13, 18, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(20px);
    }
    
    .nav-links.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .hero {
        padding: 5rem 5% 2rem;
        min-height: auto;
        padding-bottom: 3rem;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
    }
    
    .stats {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    section {
        padding: 3rem 5%;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .experience-container::before {
        left: 15px;
    }
    
    .experience-item {
        padding-left: 45px;
        padding-bottom: 2rem;
    }
    
    .experience-dot {
        left: 6px;
        width: 18px;
        height: 18px;
    }
    
    .experience-title {
        font-size: 1.1rem;
    }
    
    .experience-description {
        font-size: 0.85rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .project-image {
        height: 160px;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .skill-card {
        padding: 1.25rem 0.75rem;
    }
    
    .skill-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .skill-title {
        font-size: 0.85rem;
    }
    
    .contact-card {
        padding: 1.5rem 1.25rem;
    }
    
    .discord-btn {
        width: 100%;
        min-height: 56px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .stats {
        flex-direction: row;
        gap: 1rem;
    }
    
    .stat-item {
        flex: 1;
        min-width: 80px;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .experience-tags {
        gap: 0.35rem;
    }
    
    .experience-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    .project-tags {
        gap: 0.3rem;
    }
    
    .tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .stats {
        margin-top: 1rem;
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Touch device optimizations */
@media (hover: none) {
    .project-card:hover {
        transform: none;
    }
    
    .skill-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .discord-btn:hover {
        transform: none;
    }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    nav {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    
    .hero {
        padding-top: calc(5rem + env(safe-area-inset-top));
    }
}
