/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors - Monochromatic base with vibrant accent */
    --color-bg: #0a0a0a;
    --color-surface: #141414;
    --color-surface-elevated: #1a1a1a;
    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0a0;
    --color-text-tertiary: #606060;
    --color-accent: #00ff88;
    --color-accent-dim: #00cc6a;
    --color-accent-glow: rgba(0, 255, 136, 0.2);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Inter', sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    --text-6xl: 4rem;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--color-accent-glow);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

/* ==================== RESET & BASE ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    overflow-x: hidden;
}

::selection {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--space-3xl) 0;
}

/* ==================== HERO SECTION ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
}

.hero__content {
    max-width: 900px;
}

.hero__greeting {
    font-size: var(--text-lg);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
}

.hero__name {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl));
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.4s forwards;
}

.hero__name .accent {
    color: var(--color-accent);
    display: inline-block;
    position: relative;
}

.hero__name .accent::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    animation: scaleIn 0.6s ease-out 0.8s forwards;
}

.hero__title {
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.6s forwards;
}

.hero__description {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    line-height: 1.8;
    margin-bottom: var(--space-2xl);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.8s forwards;
}

/* ==================== SOCIAL LINKS ==================== */
.social-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 1s forwards;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-elevated);
    border-radius: var(--radius-full);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-accent-glow), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.social-link:hover,
.social-link:focus {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.social-link:hover::before,
.social-link:focus::before {
    opacity: 1;
}

.social-link svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.social-link span {
    position: relative;
    z-index: 1;
}

/* ==================== PROJECTS SECTION ==================== */
.projects {
    padding: var(--space-3xl) var(--space-lg);
}

.projects__header {
    margin-bottom: var(--space-2xl);
}

.projects__title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.projects__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
}

.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.project-card {
    background: var(--color-surface);
    border: 1px solid var(--color-surface-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.project-card:hover,
.project-card:focus-within {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card:hover::before,
.project-card:focus-within::before {
    transform: scaleX(1);
}

.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.project-card__icon {
    width: 48px;
    height: 48px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.project-card__link:hover,
.project-card__link:focus {
    color: var(--color-accent);
}

.project-card__link svg {
    width: 16px;
    height: 16px;
}

.project-card__title {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.project-card__tagline {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.project-card__description {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.project-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tech-badge {
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-surface-elevated);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ==================== BACKGROUND EFFECTS ==================== */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--color-surface-elevated) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-surface-elevated) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

.bg-gradient {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
    animation: pulse 8s ease-in-out infinite;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes scaleIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ==================== UTILITIES ==================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    :root {
        --space-3xl: 4rem;
        --space-2xl: 3rem;
    }

    .hero {
        padding: var(--space-xl) var(--space-md);
    }

    .hero__name {
        font-size: var(--text-4xl);
    }

    .hero__title {
        font-size: var(--text-xl);
    }

    .projects {
        padding: var(--space-2xl) var(--space-md);
    }

    .projects__title {
        font-size: var(--text-3xl);
    }

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

    .social-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .social-link {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}