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

:root {
    --bg-color: #f5f5f5;
    --text-color: #0d0d0d;
    --accent-color: #7c3aed;
    --accent-light: #a78bfa;
    --secondary-color: #2596be;
    --border-color: #7c3aed;
    --card-bg: #ffffff;
    --muted-text: #525252;
    --code-bg: #ede9fe;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Corner Decorations */
.corner {
    position: fixed;
    width: 60px;
    height: 60px;
    z-index: 100;
    pointer-events: none;
}

.corner::before,
.corner::after {
    content: '';
    position: absolute;
    background-color: var(--accent-color);
}

.corner-tl {
    top: 20px;
    left: 20px;
}
.corner-tl::before {
    width: 3px;
    height: 40px;
    top: 0;
    left: 0;
}
.corner-tl::after {
    width: 40px;
    height: 3px;
    top: 0;
    left: 0;
}

.corner-tr {
    top: 20px;
    right: 20px;
}
.corner-tr::before {
    width: 3px;
    height: 40px;
    top: 0;
    right: 0;
}
.corner-tr::after {
    width: 40px;
    height: 3px;
    top: 0;
    right: 0;
}

.corner-bl {
    bottom: 20px;
    left: 20px;
}
.corner-bl::before {
    width: 3px;
    height: 40px;
    bottom: 0;
    left: 0;
}
.corner-bl::after {
    width: 40px;
    height: 3px;
    bottom: 0;
    left: 0;
}

.corner-br {
    bottom: 20px;
    right: 20px;
}
.corner-br::before {
    width: 3px;
    height: 40px;
    bottom: 0;
    right: 0;
}
.corner-br::after {
    width: 40px;
    height: 3px;
    bottom: 0;
    right: 0;
}

/* Side Navigation */
.side-nav {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.side-nav ul {
    list-style: none;
}

.side-nav li {
    margin: 12px 0;
}

.nav-link {
    color: var(--muted-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: block;
    padding: 5px 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    margin-left: 200px;
    margin-right: auto;
    margin-left: auto;
    padding: 80px 60px 80px 260px;
    max-width: 1100px;
    width: 100%;
}

/* Sections */
.section {
    margin-bottom: 100px;
    min-height: 50vh;
}

/* Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding-top: 50px;
}

.ascii-art {
    margin-bottom: 30px;
}

.ascii-art pre {
    font-size: 10px;
    line-height: 1.1;
    color: var(--text-color);
    letter-spacing: -1px;
}

.hero-name {
    font-size: 41px;
    font-weight: normal;
    letter-spacing: 4px;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
}

.hero-tagline {
    font-size: 18px;
    color: var(--muted-text);
    border-top: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    padding: 15px 40px;
}

/* Interactive Portrait with Canvas Reveal Effect */
.interactive-portrait {
    position: relative;
    width: 450px;
    height: 400px;
    margin-bottom: 60px;
    cursor: crosshair;
    border: 3px solid var(--accent-color);
    overflow: hidden;
    background-color: var(--bg-color);
}

.ascii-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.reveal-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.portrait-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
}

.portrait-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--muted-text);
    z-index: 4;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.interactive-portrait:hover .portrait-hint {
    opacity: 0;
}

/* Legacy profile styles for fallback */
.profile-container {
    position: relative;
    width: 120px;
    height: 150px;
    margin-bottom: 25px;
    cursor: pointer;
    border: 2px solid var(--accent-color);
    overflow: hidden;
}

.profile-image-old {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.profile-ascii {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    z-index: 1;
}

.profile-ascii pre {
    font-size: 2.5px;
    line-height: 1;
    letter-spacing: 0px;
    color: var(--secondary-color);
    white-space: pre;
    font-family: monospace;
}

.profile-container:hover .profile-image-old {
    opacity: 0;
}

.prompt {
    color: var(--accent-color);
    font-weight: bold;
}

/* Section Headers */
.section-header {
    text-align: center;
    font-size: 21px;
    letter-spacing: 3px;
    margin-bottom: 40px;
    padding: 15px 0;
    border-top: 2px solid var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

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

/* Terminal Box */
.terminal-box {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 40px;
    position: relative;
}

.terminal-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    right: 20px;
    height: 4px;
    background-color: var(--accent-color);
}

.terminal-box p {
    margin-bottom: 15px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    flex-direction: column;
}

.label {
    color: var(--accent-color);
    font-size: 14px;
    margin-bottom: 5px;
}

.value {
    color: var(--text-color);
}

a.value {
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Links Grid */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.link-item {
    text-decoration: none;
    color: var(--text-color);
    padding: 15px 30px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    font-size: 16px;
}

.link-item:hover {
    background-color: var(--accent-color);
    color: white;
}

.link-icon {
    color: var(--accent-color);
}

.link-item:hover .link-icon {
    color: white;
}

/* Social Links with Icons */
.social-links {
    gap: 40px;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    padding: 20px;
}

.social-link:hover {
    transform: translateY(-5px);
}

.social-link:hover .social-icon {
    color: var(--accent-color);
}

.social-icon {
    width: 48px;
    height: 48px;
    color: var(--text-color);
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.social-label {
    font-size: 14px;
    color: var(--muted-text);
    transition: color 0.3s ease;
}

.social-link:hover .social-label {
    color: var(--accent-color);
}

/* Role Items */
.role-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.role-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.role-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.role-title {
    font-size: 21px;
    font-weight: bold;
}

.role-type {
    color: var(--accent-light);
    font-size: 13px;
    background-color: var(--code-bg);
    padding: 2px 8px;
}

.role-date {
    color: var(--muted-text);
    font-size: 14px;
    margin-left: auto;
}

.role-company-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.role-company-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.role-org-description {
    color: var(--muted-text);
    font-style: italic;
    margin-bottom: 8px;
    font-size: 14px;
}

.role-description {
    color: var(--muted-text);
}

.role-bullets {
    color: var(--muted-text);
    margin-top: 10px;
    padding-left: 20px;
    list-style-type: none;
}

.role-bullets li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 15px;
}

.role-bullets li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    border: 2px solid var(--border-color);
    padding: 25px;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.project-description {
    color: var(--muted-text);
    margin-bottom: 15px;
    font-size: 14px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.tech-tag {
    background-color: var(--code-bg);
    padding: 5px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
}

.project-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-light);
}

/* Blog List */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.blog-item {
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.blog-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-date {
    color: var(--accent-color);
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.blog-title {
    color: var(--text-color);
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.blog-title:hover {
    color: var(--accent-color);
}

.blog-excerpt {
    color: var(--muted-text);
    font-size: 14px;
}

/* Publications */
.publication-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.publication-item {
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.publication-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.publication-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.publication-venue {
    color: var(--accent-color);
    margin-bottom: 5px;
}

.publication-authors {
    color: var(--muted-text);
    font-size: 14px;
    margin-bottom: 10px;
}

.publication-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.publication-link:hover {
    color: var(--accent-light);
}

/* CV Section */
.cv-section {
    margin-bottom: 30px;
}

.cv-heading {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-color);
}

.cv-item {
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 3px solid var(--accent-color);
}

.cv-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.cv-subtitle {
    color: var(--muted-text);
    font-size: 14px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.cv-download {
    margin-top: 30px;
    text-align: center;
}

.download-btn {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 16px;
    padding: 15px 30px;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
    display: inline-block;
}

.download-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: var(--muted-text);
}

.coming-soon .terminal-cursor {
    display: inline-block;
    margin-top: 10px;
}

/* Contact Section */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.contact-item {
    display: flex;
    flex-direction: column;
}

/* Terminal Cursor */
.terminal-cursor {
    margin-top: 20px;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--muted-text);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        padding: 60px 40px 60px 220px;
    }

    .ascii-art pre {
        font-size: 8px;
    }
}

@media (max-width: 768px) {
    .side-nav {
        position: fixed;
        left: 0;
        top: 0;
        transform: none;
        width: 100%;
        background-color: var(--bg-color);
        padding: 15px;
        border-bottom: 2px solid var(--accent-color);
        z-index: 1000;
    }

    .side-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px 15px;
    }

    .side-nav li {
        margin: 0;
    }

    .nav-link {
        font-size: 12px;
        padding: 5px;
    }

    .main-content {
        margin-left: 0;
        padding: 100px 30px 40px;
    }

    .corner {
        display: none;
    }

    .ascii-art pre {
        font-size: 5px;
        letter-spacing: -0.5px;
    }

    .interactive-portrait {
        width: 320px;
        height: 280px;
    }

    .hero-name {
        font-size: 24px;
    }

    .hero-tagline {
        font-size: 14px;
        padding: 10px 20px;
    }

    .terminal-box {
        padding: 25px;
    }

    .info-grid,
    .contact-info {
        grid-template-columns: 1fr;
    }

    .role-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .role-date {
        margin-left: 0;
    }

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

    .social-links {
        gap: 20px;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .ascii-art {
        display: none;
    }

    .interactive-portrait {
        width: 280px;
        height: 250px;
    }

    .hero-name {
        font-size: 20px;
        margin-top: 30px;
    }

    .section-header {
        font-size: 14px;
        padding: 10px 0;
    }

    .links-grid {
        flex-direction: column;
        align-items: stretch;
    }

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

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