/* =========================================
   Design Tokens & Variables
   ========================================= */
:root {
    --bg-color: #09090b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* Accents */
    --accent-primary: #94a3b8;
    --accent-secondary: #64748b;
    --gradient-glow: linear-gradient(135deg, rgba(148, 163, 184, 0.4), rgba(100, 116, 139, 0.4));

    /* Card/Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover-bg: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(12px);

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Language Colors */
    --lang-rust: #dea584;
    --lang-python: #3572A5;
    --lang-ts: #3178c6;
    --lang-vue: #41b883;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Remove scroll-padding-top if it exists, scroll snap will be on main */
}

/* Enable Scroll Snapping on the body/html wrapper or main container */
/* We will make the HTML element handle the scrolling */
html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Apply scroll snapping to the top-level sections */
.hero,
.section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Background Mesh Gradient */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(148, 163, 184, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(100, 116, 139, 0.08), transparent 25%);
    filter: blur(80px);
}

/* =========================================
   Typography
   ========================================= */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.04em;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.2em;
}

.bio {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

.gh-chart-container {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
    filter: invert(1);
    opacity: 0.95;
}

.gh-chart-container img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   Layout & Sections
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    /* Ensure each section takes up at least a full viewport for snapping */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    text-align: center;
}

.section-line {
    height: 1px;
    width: 60%;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 1rem;
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    border: none;
    background: var(--glass-bg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    display: block;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================
   Components (Cards, Buttons, Badges)
   ========================================= */

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 9999px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-family: var(--font-heading);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: var(--glass-blur);
    cursor: pointer;
}

.btn:hover {
    background: var(--glass-hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(148, 163, 184, 0.3);
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
    box-shadow: none;
}

/* Side Navigation */
.side-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.nav-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-btn:hover {
    background: var(--glass-hover-bg);
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
    border-color: transparent;
}

/* 3D Arsenal */
.arsenal-container {
    position: relative;
    width: 100%;
    height: 70vh;
    max-width: 1200px;
    margin: 0 auto;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.arsenal-scene {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.arsenal-positioner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-style: preserve-3d;
}

.arsenal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    will-change: transform;
    animation: arsenal-float 6s ease-in-out infinite;
}

@keyframes arsenal-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.arsenal-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.8));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.arsenal-item .fallback-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.arsenal-positioner:hover .arsenal-item img {
    transform: scale(1.3);
    filter: drop-shadow(0 0 30px var(--accent-primary));
}

.arsenal-positioner:hover .arsenal-item .fallback-text {
    transform: scale(1.15);
    box-shadow: 0 0 30px var(--accent-primary);
}

/* Glass Card */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2rem;
    backdrop-filter: var(--glass-blur);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    z-index: 1;
}

/* Card Glow Effect (handled by JS mousemove) */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.06), transparent 40%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--glass-hover-bg);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

/* Card Meta (Stars, Lang) */
.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-heading);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.lang-Rust {
    background-color: var(--lang-rust);
}

.lang-Python {
    background-color: var(--lang-python);
}

.lang-TypeScript {
    background-color: var(--lang-ts);
}

.lang-Vue {
    background-color: var(--lang-vue);
}

/* =========================================
   Animations & Utilities
   ========================================= */

/* Initial states for intersection observer */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframes for Hero load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.5, 0, 0, 1) forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.15s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.45s;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    color: rgba(148, 163, 184, 0.5);
    font-size: 0.8rem;
    border-top: none;
    z-index: 50;
    pointer-events: none;
}