/* ========================================
   CSS Variables & Design Tokens
   ======================================== */
:root {
    /* Colors - Dark Theme (VS Code inspired) */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-editor: #1e1e2e;
    --bg-terminal: #11111b;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-tertiary: #ec4899;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));

    /* Syntax Highlighting Colors */
    --syntax-keyword: #ff79c6;
    --syntax-string: #a5d6ff;
    --syntax-comment: #6e7681;
    --syntax-function: #d2a8ff;
    --syntax-class: #79c0ff;
    --syntax-variable: #ffa657;
    --syntax-param: #ff7b72;
    --syntax-builtin: #79c0ff;

    /* Text Colors */
    --text-primary: #e6edf3;
    --text-secondary: rgba(230, 237, 243, 0.7);
    --text-tertiary: rgba(230, 237, 243, 0.4);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* Shadows */
    --shadow-glow: 0 0 80px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

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

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   Background Animations
   ======================================== */
.background-animation {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 25s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -150px;
    left: -150px;
    animation-delay: -8s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-tertiary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -16s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }

    75% {
        transform: translate(-50px, -30px) scale(1.05);
    }
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.02;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Cursor Glow Effect */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: opacity var(--transition-slow);
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
}

/* ========================================
   Code Window Base
   ======================================== */
.code-window {
    background: var(--bg-editor);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
}

.code-window:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.main-window {
    animation: slideUp 0.6s ease-out;
}

.skill-window {
    animation: slideUp 0.6s ease-out backwards;
}

.skill-window:nth-child(1) {
    animation-delay: 0.1s;
}

.skill-window:nth-child(2) {
    animation-delay: 0.2s;
}

.skill-window:nth-child(3) {
    animation-delay: 0.3s;
}

.terminal-window {
    animation: slideUp 0.6s ease-out 0.4s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Window Header (Title Bar) */
.window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.control.close {
    background: #ff5f57;
}

.control.minimize {
    background: #febc2e;
}

.control.maximize {
    background: #28c840;
}

.control:hover {
    filter: brightness(1.2);
    transform: scale(1.1);
}

.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.file-icon {
    font-size: 14px;
}

.window-actions {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Code Content Area */
.code-content {
    display: flex;
    padding: 16px 0;
    overflow-x: auto;
}

.code-content.compact {
    padding: 12px 0;
}

.line-numbers {
    display: flex;
    flex-direction: column;
    padding: 0 14px 0 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-tertiary);
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border-subtle);
}

.code-text {
    flex: 1;
    padding: 0 16px;
    overflow-x: auto;
}

.code-text pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
}

.code-text code {
    font-family: inherit;
}

/* Syntax Highlighting */
.keyword {
    color: var(--syntax-keyword);
    font-weight: 500;
}

.string {
    color: var(--syntax-string);
}

.comment {
    color: var(--syntax-comment);
    font-style: italic;
}

.function-name {
    color: var(--syntax-function);
}

.class-name {
    color: var(--syntax-class);
    font-weight: 600;
}

.variable {
    color: var(--syntax-variable);
}

.param {
    color: var(--syntax-param);
}

.builtin {
    color: var(--syntax-builtin);
}

/* Email Link in Code */
.email-link {
    color: var(--syntax-string);
    text-decoration: none;
    position: relative;
    transition: all var(--transition-base);
}

.email-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-primary);
    transition: width var(--transition-base);
}

.email-link:hover {
    color: var(--accent-primary);
}

.email-link:hover::after {
    width: 100%;
}

/* ========================================
   Skills Grid
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

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

.skill-window {
    height: 100%;
}

.skill-window:hover {
    transform: translateY(-4px);
}

/* ========================================
   Terminal Window
   ======================================== */
.terminal-window {
    background: var(--bg-terminal);
}

.terminal-header-bar {
    background: rgba(0, 0, 0, 0.4);
}

.terminal-content {
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.terminal-line {
    line-height: 1.8;
}

.terminal-prompt {
    color: #28c840;
    margin-right: 8px;
}

.terminal-line.output {
    margin-top: 8px;
    padding-left: 4px;
}

.terminal-result {
    color: var(--syntax-string);
}

/* Typing Animation */
.typing-animation {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: typing 1.2s steps(18) 0.5s forwards;
    width: 0;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 10.5em;
    }
}

/* Cursor Blink */
.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--text-primary);
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ========================================
   Social Footer
   ======================================== */
.social-footer {
    display: flex;
    justify-content: center;
    padding-top: var(--space-sm);
    animation: fadeIn 0.6s ease-out 0.5s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.social-link svg {
    width: 22px;
    height: 22px;
}

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

    .code-text pre {
        font-size: 12px;
    }

    .line-numbers {
        font-size: 12px;
        padding: 0 10px 0 12px;
    }

    .window-header {
        padding: 10px 12px;
    }

    .window-title {
        font-size: 11px;
    }

    .social-links {
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .code-text pre {
        font-size: 11px;
    }

    .line-numbers {
        font-size: 11px;
        padding: 0 8px 0 10px;
    }

    .social-link {
        width: 42px;
        height: 42px;
    }
}

/* ========================================
   Selection & Scrollbar
   ======================================== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.code-content::-webkit-scrollbar {
    height: 6px;
}

.code-content::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}