* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #f5f0e8;
    color: #3d3529;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
nav {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #660000;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-divider {
    width: 1px;
    height: 16px;
    background: #d4cbbe;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: #b8aa96;
    transition: color 0.2s ease;
    display: flex;
}

.nav-link:hover {
    color: #5a4f3f;
}

/* Header */
header {
    padding: 4rem 0 3rem;
}

.label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a89880;
    margin-bottom: 1.25rem;
}

header h1 {
    font-size: 2.75rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #2a2318;
    margin-bottom: 1.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #7a6e5d;
    max-width: 520px;
    line-height: 1.7;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #5a4f3f;
    background: none;
    border: 1px solid #d4cbbe;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn:hover {
    border-color: #8c7e6a;
    color: #2a2318;
}

.btn-primary {
    color: #f5f0e8;
    background: #2a2318;
    border-color: #2a2318;
}

.btn-primary:hover {
    background: #3d3529;
    border-color: #3d3529;
}

/* Portfolio */
.portfolio {
    padding: 2rem 0 3rem;
}

/* Work Layout */
.work-layout {
    display: flex;
    gap: 1.25rem;
    height: 700px;
}

.work-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 200px;
}

.work-item {
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    color: #8c7e6a;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0 6px 6px 0;
}

.work-item:hover {
    color: #5a4f3f;
    background: #ece7dd;
}

.work-item.active {
    color: #2a2318;
    font-weight: 600;
    border-left-color: #2a2318;
    background: #ece7dd;
}

.work-viewer {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #ece7dd;
}

.work-iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a89880;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2dace;
}

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

.card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    background: #ece7dd;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.card:hover {
    background: #e4ded2;
}

.card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #ddd5c8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a6e5d;
    transition: background 0.2s ease, color 0.2s ease;
}

.card:hover .card-icon {
    background: #d4cbbe;
    color: #5a4f3f;
}

.card-body {
    flex: 1;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2a2318;
}

.arrow {
    font-size: 1.1rem;
    color: #b8aa96;
    transition: color 0.2s ease, transform 0.2s ease;
}

.card:hover .arrow {
    color: #7a6e5d;
    transform: translateX(3px);
}

.card p {
    font-size: 0.9rem;
    color: #8c7e6a;
    line-height: 1.6;
}

.tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #a89880;
    background: #ddd5c8;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Skills */
.skills {
    padding: 2rem 0 3rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.skills-heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a89880;
    margin-bottom: 1rem;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tool-tag {
    font-size: 0.78rem;
    font-weight: 500;
    color: #5a4f3f;
    background: #ece7dd;
    padding: 0.3rem 0.65rem;
    border-radius: 5px;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.skill-list li {
    padding-left: 0.85rem;
    border-left: 2px solid #d4cbbe;
}

.skill-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2a2318;
    margin-bottom: 0.15rem;
}

.skill-detail {
    display: block;
    font-size: 0.8rem;
    color: #8c7e6a;
    line-height: 1.5;
}

/* Contact */
.contact {
    padding: 2rem 0 4rem;
}

.contact p {
    font-size: 1.05rem;
    color: #7a6e5d;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.contact-link {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2a2318;
    text-decoration: none;
    border-bottom: 1px solid #c8bfb0;
    padding-bottom: 2px;
    transition: border-color 0.2s ease;
}

.contact-link:hover {
    border-color: #2a2318;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 3rem 0 2rem;
    border-top: 1px solid #e2dace;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 0.8rem;
    color: #b8aa96;
}

.footer-email {
    font-size: 0.8rem;
    color: #b8aa96;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-email:hover {
    color: #7a6e5d;
}

/* PDF Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 35, 24, 0.6);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #f5f0e8;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2dace;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2a2318;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #8c7e6a;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #2a2318;
}

.modal-iframe {
    flex: 1;
    border: none;
    width: 100%;
}

/* Responsive */
@media (max-width: 600px) {
    .page {
        padding: 0 1rem;
        max-width: 100%;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem 0;
    }

    .nav-right {
        width: 100%;
        justify-content: flex-start;
    }

    header {
        padding: 2rem 0 1.5rem;
    }

    header h1 {
        font-size: 1.85rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .portfolio,
    .skills,
    .contact {
        max-width: 100%;
        overflow: hidden;
    }

    .work-layout {
        flex-direction: column;
        height: auto;
        max-width: 100%;
    }

    .work-list {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
        gap: 0.3rem;
    }

    .work-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 6px;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .work-item.active {
        border-left-color: transparent;
        border-bottom-color: #2a2318;
    }

    .work-viewer {
        display: none;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }

    .tool-tags {
        max-width: 100%;
    }

    .skill-list {
        max-width: 100%;
    }

    .skill-detail {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .modal-overlay {
        padding: 1rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
    }

    .modal {
        height: 85vh;
        border-radius: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .modal-iframe {
        max-width: 100%;
    }

    footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}
