/* =============================================
   CSS VARIABLES
   ============================================= */

:root {
    --primary-color: #2c2c2c;
    --secondary-color: #9DFBC1;
    --light-color: #faf9f6;
    --border-color: #d4d0c8;
}

/* Remove default browser spacing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;

    background-color: #faf9f6;
    font-family: 'Caveat', cursive;
    color: #2c2c2c;
}

body.panel-open {
    overflow: hidden;
}


/* =============================================
   PAGE WRAPPER
   ============================================= */

.page {
    width: 90%;
    max-width: 900px;
    padding: 3rem 0 4rem;
}


/* =============================================
   HERO LAYOUT
   ============================================= */

.hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding-bottom: 3rem;
    min-height: 85vh;
}


/* =============================================
   PORTRAIT (left column)
   ============================================= */

.portrait-column {
    flex: 0 0 auto;
}

.portrait-wrapper {
    position: relative;
    display: block;
    width: 280px;
    height: 280px;
}

.portrait {
    display: block;
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #faf9f6;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

.portrait:first-child {
    opacity: 1;
}

.portrait.is-active {
    opacity: 1;
}

.portrait-smile {
    position: absolute;
    inset: 0;
}

.portrait-column:hover .portrait {
    opacity: 0;
}

.portrait-column:hover .portrait.is-active {
    opacity: 1;
}


/* =============================================
   CONTENT (right column)
   ============================================= */

.content-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.name {
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.bio {
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.5;
    color: #4a4a4a;
}

.divider {
    border: none;
    border-top: 1px solid #d4d0c8;
    width: 100%;
}

.belief {
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.6;
    color: #2c2c2c;
    font-style: italic;
}

.recent-work {
    margin-top: 0.2rem;
    padding: 1rem 1.1rem;
    border: 1.5px solid #d4d0c8;
    border-radius: 4px;
    background-color: #fcfbf8;
}

.recent-work h2 {
    font-family:'Courier New', Courier, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: #1a1a1a;
}

.recent-work-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.recent-work-loading,
.recent-work-empty {
    font-family:'Courier New', Courier, monospace;
    font-size: 1rem;
    line-height: 1.5;
    color: #4a4a4a;
}

.recent-work-title {
    /*font-family:'Courier New', Courier, monospace;*/
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2c2c2c;
    text-decoration: none;
}

.recent-work-title:hover {
    text-decoration: underline;
}

.recent-work-description {
    font-family:'Courier New', Courier, monospace;
    font-size: 1rem;
    line-height: 1.5;
    color: #4a4a4a;
}

.recent-work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-family:'Courier New', Courier, monospace;
    font-size: 0.95rem;
    color: #6b6b6b;
}

.recent-work-link {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 0.15rem;
    padding: 0.4rem 0.8rem;
    border: 1.5px solid #2c2c2c;
    border-radius: 4px;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.recent-work-link:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}


/* =============================================
   ICON BUTTONS (social links)
   ============================================= */

.links {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    border: 1.5px solid #2c2c2c;
    border-radius: 4px;

    text-decoration: none;
    color: #2c2c2c;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.icon-placeholder {
    font-family: 'Caveat', cursive;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.icon-image {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
    padding-right: 0.5px;
}


/* =============================================
   PORTFOLIO SECTION
   ============================================= */

.portfolio {
    border-top: 1px solid #d4d0c8;
    padding-top: 2rem;
}


/* --- Tab bar --- */

.tab-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.tab {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.4rem 1.2rem;

    background: transparent;
    border: 1.5px solid #2c2c2c;
    border-radius: 4px;
    color: #2c2c2c;
    cursor: pointer;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.tab:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.tab.is-active {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.tab.is-active:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.tab:focus-visible {
    outline: 2px solid #2c2c2c;
    outline-offset: 2px;
}


/* --- Card grid --- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.2rem 1.4rem;
    text-align: left;

    background-color: #faf9f6;
    border: 1.5px solid #d4d0c8;
    border-radius: 4px;
    color: #2c2c2c;
    cursor: pointer;

    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
}

.card:focus-visible {
    outline: 2px solid #2c2c2c;
    outline-offset: 2px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-teaser {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.85;
}

.card-meta {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: auto;
}


/* =============================================
   PREVIEW PANEL
   ============================================= */

.preview-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(44, 44, 44, 0.35);
    z-index: 100;
}

.preview-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 45%;
    max-width: 520px;
    height: 100vh;
    z-index: 101;

    background-color: #faf9f6;
    border-left: 1.5px solid #d4d0c8;
    box-shadow: -4px 0 24px rgba(44, 44, 44, 0.08);

    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.preview-panel.is-open {
    transform: translateX(0);
}

.preview-panel-inner {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    min-height: 100%;
}

.preview-close {
    align-self: flex-end;
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;

    width: 40px;
    height: 40px;
    margin-bottom: 1rem;

    background: transparent;
    border: 1.5px solid #2c2c2c;
    border-radius: 4px;
    color: #2c2c2c;
    cursor: pointer;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.preview-close:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.preview-close:focus-visible {
    outline: 2px solid #2c2c2c;
    outline-offset: 2px;
}

.preview-image-wrap {
    width: 100%;
    margin-bottom: 1.5rem;
    border: 1.5px solid #d4d0c8;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0efe9;
}

.preview-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-meta {
    font-size: 1.1rem;
    color: #4a4a4a;
}

.preview-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
}

.preview-description {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #2c2c2c;
}

.preview-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    margin-top: 0.5rem;
    padding: 0.5rem 1.2rem;

    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;

    border: 1.5px solid #2c2c2c;
    border-radius: 4px;
    color: #2c2c2c;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.preview-link:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}


/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 640px) {
    .page {
        padding: 2rem 0 3rem;
    }

    .hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
        min-height: auto;
        padding-bottom: 2rem;
    }

    .portrait {
        width: 200px;
        height: 200px;
    }

    .name {
        font-size: 2.8rem;
    }

    .links {
        justify-content: center;
    }

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

    .preview-panel {
        width: 100%;
        max-width: none;
        border-left: none;
    }

    .preview-panel-inner {
        padding: 1.5rem;
    }
}
