/* ========================================
   KOMSANS.DEV - Professional Portfolio
   Modern Dark Theme
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;

    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);

    --gradient-start: #6366f1;
    --gradient-end: #a855f7;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --code-keyword: #c084fc;
    --code-string: #34d399;
    --code-variable: #60a5fa;
    --code-property: #fbbf24;
    --code-method: #f472b6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    --nav-height: 70px;
    --container-max: 1200px;
    --container-padding: 24px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background gradient effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(168, 85, 247, 0.1), transparent);
    pointer-events: none;
    z-index: -1;
}

/* Cursor glow effect */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--container-padding);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-bracket {
    color: var(--accent-primary);
}

.logo-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transition: width var(--transition-normal);
}

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

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

.nav-social {
    display: flex;
    gap: 16px;
}

.nav-social a {
    color: var(--text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-social a:hover {
    color: var(--accent-secondary);
    transform: translateY(-2px);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: calc(var(--nav-height) + 60px) var(--container-padding) 60px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.hero-greeting {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.hero-greeting .line {
    width: 40px;
    height: 1px;
    background: var(--accent-primary);
}

.hero-greeting .text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--accent-secondary);
    letter-spacing: 0.05em;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.1;
}

.name-first {
    display: block;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.name-last {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.title-dynamic {
    color: var(--accent-secondary);
    font-weight: 500;
}

.cursor {
    color: var(--accent-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--accent-glow);
    color: var(--accent-secondary);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.05rem;
}

/* Code Window */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-window {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.code-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.code-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.code-content {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
}

.code-content code {
    display: block;
}

.code-keyword { color: var(--code-keyword); }
.code-string { color: var(--code-string); }
.code-variable { color: var(--code-variable); }
.code-property { color: var(--code-property); }
.code-method { color: var(--code-method); }

/* ========================================
   Sections Common
   ======================================== */
.section {
    padding: 100px var(--container-padding);
    max-width: var(--container-max);
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.section-header h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    white-space: nowrap;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
    max-width: 300px;
}

/* ========================================
   About Section
   ======================================== */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========================================
   Skills Section
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    transition: all var(--transition-normal);
}

.skill-category:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.skill-category h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

/* ========================================
   Projects Section
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.project-card.featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.project-image {
    background: var(--bg-tertiary);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-placeholder {
    text-align: center;
}

.project-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.project-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
}

.project-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
    line-height: 1.7;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tech span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-link {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.project-link:hover {
    color: var(--accent-secondary);
    transform: translateY(-2px);
}

/* ========================================
   Contact Section
   ======================================== */
.contact {
    text-align: center;
    padding-bottom: 60px;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.contact-social {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all var(--transition-normal);
}

.social-link:hover {
    color: var(--accent-secondary);
    transform: translateY(-4px);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 40px var(--container-padding);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-credit {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-credit span {
    color: var(--accent-secondary);
}

.footer-tech {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ========================================
   Scroll to Top
   ======================================== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 100;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-greeting {
        justify-content: center;
    }

    .hero-description {
        margin: 0 auto 32px;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .code-window {
        max-width: 400px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        flex-direction: row;
        justify-content: center;
    }

    .project-card.featured {
        grid-template-columns: 1fr;
    }

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

    .project-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 20px;
        --nav-height: 60px;
    }

    .nav-links {
        display: none;
    }

    .hero {
        padding-top: calc(var(--nav-height) + 40px);
        min-height: auto;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .section {
        padding: 60px var(--container-padding);
    }

    .about-stats {
        flex-direction: column;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

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

    .contact-social {
        flex-wrap: wrap;
        gap: 24px;
    }

    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .code-window {
        max-width: 100%;
    }

    .code-content {
        font-size: 0.75rem;
        padding: 16px;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

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

    .project-content {
        padding: 20px;
    }
}

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

.hero-content > * {
    animation: fadeInUp 0.6s ease backwards;
}

.hero-greeting { animation-delay: 0.1s; }
.hero-name { animation-delay: 0.2s; }
.hero-title { animation-delay: 0.3s; }
.hero-description { animation-delay: 0.4s; }
.hero-cta { animation-delay: 0.5s; }

.hero-visual {
    animation: fadeInUp 0.8s ease 0.3s backwards;
}

/* Smooth scroll indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}
