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

html {
    font-size: 16px;
}

body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: auto;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.12);
}

.theme-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle:active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

@media (hover: none) {
    .theme-toggle {
        transition: background 0.4s ease 0.3s, border-color 0.4s ease 0.3s, transform 0.4s ease;
    }

    .theme-toggle:hover {
        background: transparent;
        border-color: var(--border-color);
        transform: none;
    }

    [data-theme="dark"] .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .theme-toggle:active {
        transition-delay: 0s;
    }
}

.theme-toggle svg {
    transition: opacity 0.2s ease;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* Container */
.container {
    max-width: 700px;
    width: 100%;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Terminal Header */
.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.terminal-header.scrolled {
    background: transparent;
    border-color: transparent;
}

.prompt {
    color: var(--terminal-prompt);
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.command {
    color: var(--terminal-text);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.terminal-header.scrolled .prompt,
.terminal-header.scrolled .command {
    opacity: 0;
}

/* Content */
.content {
    padding: 0 1rem;
}

/* Avatar */
.avatar-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    object-fit: cover;
    object-position: -1px center;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--shadow);
}

.avatar-light {
    display: block;
}

.avatar-dark {
    display: none;
}

[data-theme="dark"] .avatar-light {
    display: none;
}

[data-theme="dark"] .avatar-dark {
    display: block;
}

/* Typography */
.name {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.title {
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Bio */
.bio {
    text-align: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
}

.bio p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

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

.bio-tldr {
    color: var(--text-muted);
    opacity: 0.7;
}

.bio .mantras {
    color: var(--accent-primary);
    font-weight: 500;
    margin-top: 1rem;
}

/* Sections */
.section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title .prompt {
    font-size: 0.9rem;
}

/* Skills List */
.skills-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.skills-list li {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.skills-list li:hover {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    transform: translateX(4px);
}

.skills-list li::before {
    content: "# ";
    color: var(--accent-primary);
    margin-right: 0.5rem;
}

/* Projects List */
.projects-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.projects-list li {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
}

.projects-list li:hover {
    background: var(--bg-primary);
    transform: translateX(4px);
    border-left-color: var(--accent-secondary);
}

.commit-hash {
    color: var(--terminal-prompt);
    font-weight: 600;
    flex-shrink: 0;
}

.branch-link {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.branch-link:hover .branch {
    text-decoration: underline;
}

.branch {
    color: var(--accent-primary);
    font-weight: 500;
    flex-shrink: 0;
}

.commit-msg {
    color: var(--text-primary);
    flex: 1;
}

/* Links */
.links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.links a:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.links a svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.footer {
    margin-top: 4rem;
    text-align: center;
}

.footer-separator {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--border-color) 20%,
        var(--accent-primary) 50%,
        var(--border-color) 80%,
        transparent
    );
    margin-bottom: 2rem;
    position: relative;
}

.footer-separator::before {
    content: "━━━";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    padding: 0 1rem;
    color: var(--accent-primary);
    font-size: 0.8rem;
    letter-spacing: 0.2rem;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.terminal-prompt {
    font-size: 0.9rem;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.prompt-user {
    color: var(--accent-primary);
    font-weight: 500;
}

.prompt-colon {
    color: var(--accent-primary);
}

.prompt-path {
    color: var(--terminal-text);
    font-weight: 500;
}

.prompt-symbol {
    color: var(--accent-primary);
    margin-left: 0.25rem;
    margin-right: 0.5rem;
}

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

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    50.1%, 100% {
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .theme-toggle {
        width: 32px;
        height: 32px;
    }

    .name {
        font-size: 1.75rem;
    }

    .title {
        font-size: 1rem;
    }

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

    .links {
        flex-direction: column;
    }

    .links a {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 0;
    }

    .content {
        padding: 0 0.5rem;
    }

    .avatar {
        width: 100px;
        height: 100px;
    }

    .name {
        font-size: 1.5rem;
    }

    .bio {
        padding: 1rem;
    }
}
