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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 16px;
}

.nav-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: translateY(-2px);
}

.nav-link.active {
    background: #3498db;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: #2980b9;
    transform: translateY(-5px);
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    color: white;
    text-align: center;
    padding: 4rem 1rem 6rem;
    position: relative;
    overflow: hidden;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

.glitch {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    position: relative;
    animation: glitchText 5s infinite;
}

@keyframes glitchText {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-1px, 1px);
    }
}

.typing-effect {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    overflow: hidden;
    border-right: 2px solid white;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3s steps(60, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: white; }
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

section {
    background: white;
    margin-bottom: 1.5rem;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

section h2 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    background: #e74c3c;
    animation: expandWidth 1s ease-out 0.3s forwards;
}

@keyframes expandWidth {
    to { width: 80px; }
}

section h3 {
    color: #34495e;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.skill {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.skill:hover {
    transform: translateX(10px);
    border-left-width: 8px;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.skill h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill ul {
    list-style: none;
    padding-left: 0;
}

.skill li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.skill li:hover {
    padding-left: 2rem;
    color: #3498db;
}

.skill li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
    transition: all 0.2s ease;
}

.skill li:hover::before {
    transform: translateX(5px);
}

.item,
.project {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.item:hover,
.project:hover {
    padding-left: 1rem;
    border-left: 4px solid #3498db;
}

.item:last-child,
.project:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.project h3,
.item h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.project p,
.item p {
    margin-bottom: 0.75rem;
}

.project ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.project li {
    margin-bottom: 0.5rem;
}

.languages {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.language-item {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.language-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.interests {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.interest-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
    transition: all 0.3s ease;
    cursor: pointer;
}

.interest-item:hover {
    transform: rotateY(10deg) scale(1.05);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

.interest-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.25rem;
}

a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

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

a:hover {
    color: #2980b9;
}

a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    border-radius: 2px;
}

footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background: #2c3e50;
    color: white;
    margin-top: 2rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .nav-container {
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    header {
        padding: 3rem 1rem 5rem;
    }

    .glitch {
        font-size: 2rem;
    }

    .typing-effect {
        font-size: 1rem;
    }

    section {
        padding: 1.5rem;
    }

    section h2 {
        font-size: 1.3rem;
    }

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

    .skill {
        padding: 1rem;
    }

    .languages {
        flex-direction: column;
        gap: 1rem;
    }

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

    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        justify-content: space-between;
    }

    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    header {
        padding: 2rem 1rem 4rem;
    }

    .glitch {
        font-size: 1.5rem;
    }

    .typing-effect {
        font-size: 0.9rem;
        border-right: none;
    }

    section {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    section h2 {
        font-size: 1.2rem;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    section {
        background: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    section h2,
    .project h3,
    .item h3,
    .skill h3 {
        color: #fff;
    }

    .skill,
    .language-item,
    .interest-item {
        background: #3a3a3a;
    }

    .item,
    .project {
        border-bottom-color: #444;
    }

    a {
        color: #5dade2;
    }

    a:hover {
        color: #85c1e9;
    }

    .interest-item strong,
    .language-item strong {
        color: #fff;
    }
}

@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .nav-sticky,
    .scroll-top {
        display: none;
    }

    header {
        background: #2c3e50;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
        padding: 2rem 1rem;
    }

    section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    a {
        color: #2c3e50;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
