/**
 * Portfolio Styles - Dark Mode, Premium Design
 * Mobile-first approach
 */

/* CSS Variables */
:root {
    --color-bg: #0a0a0a;
    --color-bg-secondary: #111111;
    --color-bg-tertiary: #1a1a1a;
    --color-text: #ffffff;
    --color-text-secondary: #888888;
    --color-text-muted: #555555;
    --color-accent: #ffffff;
    --color-border: #222222;

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;

    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll container for Lenis */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* Selection */
::selection {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
    color: var(--color-text-secondary);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    mix-blend-mode: difference;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav-links a:hover {
    opacity: 1;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--space-xl) var(--space-md);
}

.hero-title {
    margin-bottom: var(--space-md);
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-secondary);
    max-width: 500px;
}

/* Three.js Canvas */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Projects Grid */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-md);
}

.project-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-secondary);
    cursor: pointer;
    transform: translateY(50px);
    opacity: 0;
}

.project-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-bg-tertiary);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.project-card:hover .project-card-image img {
    transform: scale(1.05);
}

.project-card-content {
    padding: var(--space-md);
}

.project-card-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.project-card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.project-card-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--color-text);
    color: var(--color-bg);
}

.btn-primary:hover {
    transform: scale(1.02);
}

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

.btn-secondary:hover {
    border-color: var(--color-text);
}

/* CV Section */
.cv-section {
    background: var(--color-bg-secondary);
}

.cv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 768px) {
    .cv-grid {
        grid-template-columns: 1fr;
    }
}

.cv-category {
    margin-bottom: var(--space-lg);
}

.cv-category-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--color-border);
}

.cv-item {
    margin-bottom: var(--space-md);
}

.cv-item-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cv-item-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Skills Tags */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Footer */
.footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-border);
}

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

.footer-links {
    display: flex;
    gap: var(--space-md);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-text);
}

/* Custom Cursor */
.cursor {
    display: none;
}

@media (pointer: fine) {
    .cursor {
        display: block;
        position: fixed;
        width: 20px;
        height: 20px;
        border: 1px solid var(--color-text);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: width 0.2s, height 0.2s, border-color 0.2s;
        mix-blend-mode: difference;
    }

    .cursor.hover {
        width: 50px;
        height: 50px;
        border-color: var(--color-accent);
    }
}

/* Page Transition */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: bottom;
}

/* Loading */
.loader {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader-text {
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        padding: var(--space-sm);
    }

    .nav-links {
        display: none;
    }

    .hero-content {
        padding: var(--space-lg) var(--space-sm);
    }

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

    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}
