/* Swiss Style + Scandinavian Design */

/* Hero Section */
#hero-section {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
}

.hero-left {
    padding: var(--margin);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-right: 1px solid var(--border-color);
    position: relative;
}

.hero-left .canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    z-index: 0;
}

.hero-left-content {
    position: relative;
    z-index: 1;
}

#hero-title {
    font-size: 4em;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero-tagline {
    font-size: 1.1em;
    color: var(--text-muted);
    margin: 0;
    max-width: 300px;
}

.hero-right {
    display: flex;
    flex-direction: column;
}

.hero-info {
    padding: var(--margin);
    border-bottom: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-info p {
    margin: 0 0 5px;
    color: var(--text-muted);
    font-size: 0.95em;
}

.hero-links {
    padding: var(--margin);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--accent);
}

.hero-links a {
    font-family: "Space Mono", monospace;
    font-size: 0.85em;
    color: var(--bg-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-links a::before {
    content: "→";
    color: var(--bg-color);
    opacity: 0.6;
}

.hero-links a:hover {
    color: #fff;
}

.hero-links a:hover::before {
    opacity: 1;
}

/* Projects Section */
#projects {
    border-bottom: 1px solid var(--border-color);
}

/* Featured Project - Big visual impact */
.featured-project {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    min-height: 70vh;
    border-bottom: 1px solid var(--border-color);
}

/* Last featured project doesn't need bottom border */
.featured-project:last-child {
    border-bottom: none;
}

/* Flipped version - content on right, features on left */
.featured-project.featured-flipped {
    grid-template-columns: 1.5fr 1fr;
}

.featured-project.featured-flipped .featured-left {
    border-right: 1px solid var(--border-color);
    background-color: #f5f3f0;
}

.featured-project.featured-flipped .featured-right {
    background-color: var(--bg-color);
    padding: var(--margin);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-project.featured-flipped .featured-right .project-number {
    font-family: "Space Mono", monospace;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.featured-project.featured-flipped .featured-right .featured-title {
    font-size: 2.5em;
}

.featured-project.featured-flipped .featured-right .featured-description {
    max-width: 100%;
}

.featured-left {
    padding: var(--margin);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.featured-left .project-number {
    font-family: "Space Mono", monospace;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.featured-title {
    font-size: 3em;
    font-weight: 500;
    line-height: 1;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.featured-description {
    font-size: 1.1em;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 30px;
    max-width: 320px;
}

.featured-link {
    font-family: "Space Mono", monospace;
    font-size: 0.85em;
    color: var(--bg-color);
    background-color: var(--text-color);
    padding: 12px 20px;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.featured-link:hover {
    background-color: var(--accent);
    color: var(--bg-color);
}

.featured-right {
    background-color: #f5f3f0;
    padding: var(--margin);
    overflow: hidden;
}

.featured-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
}

.featured-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-icon {
    font-size: 1.3em;
    color: var(--accent);
    width: 24px;
    flex-shrink: 0;
}

.feature-text {
    font-family: "Space Mono", monospace;
    font-size: 0.8em;
    color: var(--text-color);
}

.featured-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.featured-gallery img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.featured-gallery img:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.featured-code {
    background-color: var(--bg-color);
    border-radius: 6px;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
}

.featured-code pre {
    margin: 0;
    background: transparent !important;
}

.featured-code code {
    font-family: "Space Mono", monospace;
    font-size: 0.85em;
    line-height: 1.7;
    background: transparent !important;
    color: var(--text-color) !important;
    text-shadow: none !important;
}

/* Light syntax highlighting for featured code */
.featured-code .token.keyword {
    color: var(--accent) !important;
}

.featured-code .token.function {
    color: #2563eb !important;
}

.featured-code .token.string {
    color: #059669 !important;
}

.featured-code .token.number {
    color: #7c3aed !important;
}

.featured-code .token.operator,
.featured-code .token.punctuation {
    color: var(--text-muted) !important;
}

.featured-code .token.builtin {
    color: #0891b2 !important;
}

.featured-tech {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.featured-tech span {
    font-family: "Space Mono", monospace;
    font-size: 0.7em;
    color: var(--text-muted);
    background-color: var(--bg-color);
    padding: 6px 12px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
}

.project {
    padding: var(--margin);
}

.project:nth-child(odd) {
    border-right: 1px solid var(--border-color);
}

.project-number {
    font-family: "Space Mono", monospace;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: block;
}

.project-title {
    font-size: 1.4em;
    font-weight: 500;
    margin: 0 0 10px;
    line-height: 1.2;
}

.project-link {
    color: var(--accent);
    font-family: "Space Mono", monospace;
    font-size: 0.7em;
    margin-left: 10px;
}

.project-description {
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0 0 15px;
}

.project-logo {
    max-width: 60px;
    margin-bottom: 15px;
}

.project-images {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.project-images img {
    height: 50px;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.project-images img:hover {
    transform: scale(1.05);
}

.project pre {
    background-color: var(--text-color);
    border-radius: 3px;
    padding: 12px;
    margin: 15px 0 0;
    overflow-x: auto;
}

.project pre code {
    font-family: "Space Mono", monospace;
    font-size: 0.7em;
    color: var(--bg-color);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.contact-left {
    padding: var(--margin);
    border-right: 1px solid var(--border-color);
}

.contact-left p {
    color: var(--text-muted);
    margin: 0 0 5px;
    font-size: 0.95em;
}

.contact-right {
    padding: var(--margin);
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.contact-right a {
    font-family: "Space Mono", monospace;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-right a::before {
    content: "→";
    color: var(--accent);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(250, 249, 247, 0.97);
}

.image-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 80%;
    border: 1px solid var(--border-color);
}

.image-modal .close {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 24px;
    cursor: pointer;
    font-family: "Space Mono", monospace;
}

/* LaTeX styling */
.latex sub, .latex sup {
    text-transform: uppercase;
}

.latex sub {
    vertical-align: -0.5ex;
    margin-left: -0.1667em;
    margin-right: -0.125em;
}

.latex sup {
    font-size: 0.85em;
    vertical-align: 0.15em;
    margin-left: -0.36em;
    margin-right: -0.15em;
}

/* Mobile Styles */
@media (max-width: 800px) {
    #hero-section {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 50vh;
    }

    #hero-title {
        font-size: 2.5em;
    }

    .featured-project {
        grid-template-columns: 1fr;
        min-height: auto;
    }

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

    .featured-project.featured-flipped .featured-left {
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }

    .featured-project.featured-flipped .featured-right {
        order: 1;
    }

    .featured-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: var(--margin);
    }

    .featured-title {
        font-size: 2em;
    }

    .featured-right {
        min-height: auto;
        padding: var(--margin);
    }

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

    .featured-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .project {
        border-right: none !important;
    }

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

    .contact-left {
        border-right: none;
        border-bottom: none;
    }
}
