/* Modern Flowing Portfolio Design */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', system-ui, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fafafa;
    overflow-x: hidden;
}

/* Custom Properties */
:root {
    --primary-color: #0066cc;
    --secondary-color: #ff6b35;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --background-primary: #fafafa;
    --background-secondary: #ffffff;
    --border-light: #e5e5e5;
    --border-medium: #cccccc;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 24px rgba(0, 0, 0, 0.08);
    --radius-small: 8px;
    --radius-medium: 16px;
    --radius-large: 24px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-right: 280px; /* Make space for version selector */
}

/* Version Navigation */
.nav-versions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 102, 204, 0.05);
    border-radius: var(--radius-small);
    border: 1px solid rgba(0, 102, 204, 0.15);
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 10000;
}

.nav-version-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.nav-versions .nav-link {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--radius-small) - 2px);
    margin: 0;
}

.nav-link.version-active {
    background: var(--primary-color);
    color: white;
}

.nav-link.version-active:hover {
    background: #0052a3;
    color: white;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-small);
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.nav-link.external svg {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.nav-link.external:hover svg {
    opacity: 1;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.hero-text {
    max-width: 600px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    color: white;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-title .highlight {
    color: var(--secondary-color);
    display: block;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-medium);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
    letter-spacing: -0.01em;
}

.hero-cta:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.3);
}

/* Projects Section */
.projects {
    padding: 8rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 6rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: -0.01em;
}

/* Project Articles */
.project-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 8rem;
    align-items: center;
}

.project-article:nth-child(even) {
    direction: rtl;
}

.project-article:nth-child(even) > * {
    direction: ltr;
}

/* Project Media */
.project-media {
    position: relative;
}

.media-container {
    position: relative;
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    background: var(--background-secondary);
}

.media-gallery {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.media-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.media-item.active {
    opacity: 1;
}

.media-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.media-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active,
.dot:hover {
    background: white;
    transform: scale(1.2);
}

/* Project Content */
.project-content {
    padding: 2rem 0;
}

.project-header {
    margin-bottom: 2rem;
}

.project-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary-color);
    border-radius: var(--radius-small);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.project-description {
    margin: 2rem 0;
}

.project-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.project-description p:last-child {
    margin-bottom: 0;
}

/* Project Specifications */
.project-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 2rem;
    background: var(--background-secondary);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-light);
}

.spec-item {
    text-align: center;
}

.spec-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spec-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* About Section */
.about {
    padding: 8rem 2rem;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.about-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.about-text {
    margin-bottom: 4rem;
}

.about-description {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.01em;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* Footer */
.footer {
    padding: 3rem 2rem;
    background: var(--text-primary);
    color: white;
    text-align: center;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        padding: 0.5rem 1rem;
        height: auto;
        min-height: 100px;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-links {
        gap: 1rem;
        margin-right: 0; /* Remove margin on mobile */
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Mobile version selector */
    .nav-versions {
        position: static;
        transform: none;
        margin-top: 0.5rem;
        order: 3;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
    }
    
    .nav-version-label {
        font-size: 0.7rem;
        margin-right: 0.25rem;
    }
    
    .nav-versions .nav-link {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
        margin: 0;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .hero {
        padding-top: 120px; /* Account for larger mobile navbar */
        min-height: calc(100vh - 120px);
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .projects {
        padding: 6rem 1rem;
    }
    
    .section-header {
        margin-bottom: 4rem;
    }
    
    .project-article {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 6rem;
    }
    
    .project-article:nth-child(even) {
        direction: ltr;
    }
    
    .media-gallery {
        height: 300px;
    }
    
    .project-content {
        padding: 1rem 0;
    }
    
    .project-title {
        font-size: 1.75rem;
    }
    
    .project-specs {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .about {
        padding: 6rem 1rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .nav-content {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }
    
    .hero {
        height: 90vh;
        padding-top: 120px;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .project-specs {
        grid-template-columns: 1fr;
    }
    
    .media-gallery {
        height: 250px;
    }
}

/* Animation and Interaction Enhancements */
.project-article {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s ease forwards;
}

.project-article:nth-child(2) {
    animation-delay: 0.2s;
}

.project-article:nth-child(3) {
    animation-delay: 0.4s;
}

.project-article:nth-child(4) {
    animation-delay: 0.6s;
}

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

/* Smooth scrolling enhancements */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.hero-cta:focus,
.dot:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    :root {
        --border-light: #999999;
        --text-secondary: #333333;
    }
}