html {
    scrollbar-gutter: stable;
}

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

@font-face {
    font-family: 'Cascadia Code Light';
    src: url('assets/fonts/woff2/CascadiaCodePL.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-blue: #70b8ff;
    --blue-accent: #92d2ff;
    --blue-shadow: rgba(112, 184, 255, 0.2);
    --blue-border: rgba(112, 184, 255, 0.15);
    --blue-hover-shadow: rgba(112, 184, 255, 0.4);
}

body {
    font-family: 'Cascadia Code Light', monospace;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    background: #0b0c10;
    color: #e0e0e0;
    scroll-behavior: smooth;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    padding: 0.5rem 1rem;
}

footer {
    text-align: center;
    padding: 20px;
    background: #121317;
    font-size: 0.9rem;
    color: #aaa;
}

nav {
    display: flex;
    gap: 1rem;
}

nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem;
}

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

.logo {
    font-weight: bold;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.2rem;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(12, 14, 20, 0.2);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: "";
    display: block;
    height: 2px;
    width: 0;
    background: var(--blue-accent);
    transition: width 0.3s;
    position: absolute;
    bottom: -4px;
    left: 0;
}

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

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    transition: all 0.3s ease;
}

.hamburger span {
    display: block;
    height: 3px;
    background-color: #e0e0e0;
    border-radius: 2px;
    transition: 0.4s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

main section {
    padding: 60px 20px;
    text-align: center;
}

img.inverted {
    filter: invert(100%) !important;
}

p, h1, h2, h3, ul, li {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* Hero Section */
.hero-buttons .button {
    display: inline-block;
    margin: 10px;
    padding: 12px 28px;
    background: linear-gradient(90deg, var(--primary-blue), var(--blue-accent));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 0 8px var(--blue-shadow);
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.hero-buttons .button:hover {
    background: linear-gradient(90deg, var(--primary-blue), var(--blue-accent));
    box-shadow: 0 0 12px var(--blue-hover-shadow);
    transform: translateY(-2px);
}

#hero {
    position: relative;
    overflow: hidden;
    padding: 80px 20px;
    text-align: center;
    background: none;
    z-index: 1;
}

#hero h1,
#hero p,
#hero .hero-buttons {
    position: relative;
    z-index: 2;
}

.canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.connecting-dots {
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

.cursor-glow {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background: radial-gradient(
            circle,
            rgba(120, 180, 255, 0.12) 0%,
            rgba(112, 184, 255, 0.05) 50%,
            rgba(120, 180, 255, 0) 100%
    );
    mix-blend-mode: screen;
    z-index: 3;
}

/* About Section */
.about-icon {
    width: 120px;
    height: auto;
    opacity: 0.9;
}

/* Tech Stack Section */
.tech-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 20px;
    justify-items: center;
    padding: 20px;
}

.tech-icon {
    width: 48px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    filter: drop-shadow(0 0 4px rgba(112, 184, 255, 0.1));
}

.tech-icon:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px var(--blue-hover-shadow));
}

/* Projects Section */
.flip-card {
    aspect-ratio: 1 / 1;
    perspective: 1000px;
    background: transparent;
    width: 100%;
    max-width: 420px;
    margin-top: 20px;
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card.flipped .flip-card-front {
    pointer-events: none;
}

.flip-card:not(.flipped) .flip-card-back {
    pointer-events: none;
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    transform: rotateX(0deg);
    border-radius: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 8px rgba(120, 180, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.flip-card-front {
    z-index: 2;
}

.flip-card-back {
    transform: rotateY(180deg) rotateX(0deg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.back-scroll {
    overflow-y: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.back-scroll::-webkit-scrollbar {
    display: none;
}

.flip-card-back::-webkit-scrollbar {
    display: none;
}

.flip-card-back {
    text-align: justify;
}

.flip-card-back p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.flip-card-back strong {
    font-weight: 700;
}

.flip-card-back ul {
    list-style-type: disc;
    padding-left: 1.2rem;
    margin: 0.5rem 0 1rem;
}

.flip-card-back li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.project-img {
    width: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.project-description {
    font-size: 0.9rem;
    flex: 1;
}

.project-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: auto;
    list-style: none;
    padding: 6px 0;
}

.project-tags li {
    background: rgba(120, 180, 255, 0.1);
    border: 1px solid rgba(120, 180, 255, 0.15);
    color: #a4d4ff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
}

.gh-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #a4d4ff;
    background: rgba(120, 180, 255, 0.1);
    border: 1px solid rgba(120, 180, 255, 0.3);
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.gh-btn:hover {
    background: rgba(120, 180, 255, 0.3);
}

body.disable-scroll {
    overflow: hidden;
}

/* Contact Section */
.contact-icons {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.contact-icon-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px var(--blue-shadow);
    backdrop-filter: blur(4px);
}

.contact-icon-button:hover {
    background: #1c1f26;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(120, 180, 255, 0.4);
}

.contact-icon {
    width: 60%;
    height: 60%;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.contact-icon-button:hover .icon {
    filter: grayscale(0);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px;
        left: 20px;
        right: 20px;
        background: rgba(25, 30, 40, 0.75);
        backdrop-filter: blur(14px);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 0 20px rgba(112, 184, 255, 0.12);
        flex-direction: column;
        align-items: center;
        display: none;
        padding: 1.5rem 1rem;
        gap: 1.2rem;
        z-index: 999;
    }

    .nav-links.show {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .flip-card {
        height: 420px;
    }
}