:root {
    --primary: #121212;
    --secondary: #1f1f1f;
    --accent: #34d399;
    --accent-dark: #218380;
    --text: #f5f5f5;
    --text-secondary: #a0a0a0;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 6px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background-color: #121212;
    scroll-behavior: smooth;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.iframe-mode::-webkit-scrollbar {
    display: none;
}

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

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

@keyframes scaleUp {
    from { transform: scale(0.95); }
    to { transform: scale(1); }
}

.animate-fade { animation: fadeIn 0.8s var(--ease) forwards; }
.animate-up { animation: fadeInUp 0.8s var(--ease) forwards; animation-delay: 0.2s; }
.animate-scale { animation: scaleUp 0.8s var(--ease) forwards; }

.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--secondary);
    z-index: 999;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent);
    width: 0;
    transition: width 0.3s var(--ease);
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 3rem 1rem;
    text-align: center;
    background: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.95));
    overflow: hidden;
}

.header-content { max-width: 800px; margin: 0 auto; }

.portrait-frame {
    width: 250px;
    height: 350px;
    border-radius: var(--border-radius);
    border: 3px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    animation: scaleUp 0.8s var(--ease) forwards;
    margin-left: auto;
    margin-right: auto;
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.8s var(--ease) forwards;
}

.header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeIn 0.8s var(--ease) forwards;
    animation-delay: 0.2s;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    background-color: var(--primary);
    z-index: 998;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); */
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    margin: 0 auto;
}

.nav-item a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s var(--ease), transform 0.3s var(--ease);
    display: block;
}

.nav-item a:hover,
.nav-item a:focus {
    color: var(--accent);
    transform: translateY(-2px);
    outline: none;
}

.nav-item a.active {
    color: var(--accent);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
}

.content-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
}

.content-section.active {
    opacity: 1;
    animation: fadeIn 0.8s var(--ease) forwards;
}

.section-header {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    text-align: center;
}

.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 100%;
}

.academic-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    grid-template-areas: 
        "goals samples"
        "reflection samples";
}

.card {
    padding: 2rem;
    background-color: var(--secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease) forwards;
    min-height: 250px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

.academic-grid .card:nth-child(1) { 
    grid-area: goals;
    min-height: 120px;
    margin: 0;
}

.academic-grid .card:nth-child(2) { 
    grid-area: samples;
    margin: 0;
    min-height: auto;
}

.academic-grid .reflection { 
    grid-area: reflection;
    margin: 0;
    min-height: 120px;
}

.personal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    grid-template-areas: "narrative narrative narrative" "goals activities community" "reflection reflection reflection";
}

.personal-grid .card:nth-child(1) { grid-area: narrative; }
.personal-grid .card:nth-child(2) { grid-area: goals; }
.personal-grid .card:nth-child(3) { grid-area: activities; }
.personal-grid .card:nth-child(4) { grid-area: community; }
.personal-grid .reflection { grid-area: reflection; }

.timeline {
    position: relative;
    margin: 4rem 0;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent), var(--accent));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.timeline-item {
    position: relative;
    padding: 2rem;
    margin-bottom: 3rem;
    background-color: var(--secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease) forwards;
    border: 1px solid rgba(52, 211, 153, 0.1);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3rem;
    top: 2rem;
    width: 1rem;
    height: 1rem;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -2rem;
    top: 2.4rem;
    width: 2rem;
    height: 2px;
    background-color: var(--accent);
}

.timeline-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 30px rgba(46, 204, 113, 0.2);
}

.timeline-item h3 {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.timeline-item p {
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.timeline-item .reflection {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: rgba(52, 211, 153, 0.05);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent);
}

.timeline-item .reflection h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.timeline-item .reflection p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }

@media (max-width: 768px) {
    .timeline {
        padding-left: 2rem;
    }
    
    .timeline-item::before {
        left: -2rem;
    }
    
    .timeline-item::after {
        left: -1rem;
        width: 1rem;
    }
}

@media (max-width: 480px) {
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-item {
        padding: 1.5rem;
    }
    
    .timeline-item::before {
        left: -1.5rem;
        width: 0.8rem;
        height: 0.8rem;
    }
    
    .timeline-item::after {
        display: none;
    }
}

.image-container {
    position: relative;
    width: 150px;
    height: 100px;
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: transform 0.3s var(--ease);
}

.image-container:hover { transform: scale(1.05); }

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-container.expanded {
    width: 80vw;
    max-width: 800px;
    height: auto;
    max-height: 80vh;
    display: flex;
    align-items: flex-start;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.image-container.expanded img { width: 100%; height: auto; }

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    z-index: 1001;
    transition: background-color 0.3s ease;
}

.close-button:hover { background-color: rgba(0, 0, 0, 0.9); }

/* Apply button styles to both <button> elements and elements with the class .button */
.button, button {
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s var(--ease);
    text-decoration: none; /* Remove underline from anchor tags */
    display: inline-block; /* Ensure padding and width work correctly for anchor tags */
}

.button:hover, button:hover {
    background-color: #27ae60;
}

.work-sample-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.work-sample-item > * {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.work-sample-item span { flex-grow: 1; }

.footer {
    position: relative;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    text-align: center;
    background-color: var(--secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.reflection {
    padding: 2rem;
    background-color: var(--secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease) forwards;
}

.reflection:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

.document-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.fullscreen-button {
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s var(--ease);
    margin-top: 1rem;
    width: 100%;
}

.fullscreen-button:hover { background-color: #27ae60; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 800px;
    max-height: 90vh;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: hidden;
}

.modal-content {
    width: 100%;
    background-color: #fefefe;
    border: none;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    position: relative;
}

.pdf-container {
    position: fixed;
    width: 100%;
    height: auto;
    overflow: visible;
    display: none;
    justify-content: center;
    align-items: center;
}

#pdfCanvas {
    width: 100%;
    height: auto;
    max-width: 120%;
    display: block;
}

.close {
    color: #aaa;
    position: fixed;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

#pdfContainer {
    /* Existing styles applied via JS will be moved here */
}

.pdf-container-modal {
    display: none; /* Will be block when active */
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50px; /* Adjust as needed */
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    padding: 0px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90vw;
    max-width: 1000px; /* Adjust as needed */
    border-radius: var(--border-radius);
}

.pdf-container-modal canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.pdf-container-modal .close-button {
    position: sticky; /* Keeps the close button visible when scrolling */
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    z-index: 1001;
    transition: background-color 0.3s ease;
}

.pdf-container-modal .close-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.resume-container {
    max-width: 900px;
    margin: 1rem auto;
    padding: 1rem;
    background-color: var(--primary);
    animation: fadeIn 0.8s var(--ease) forwards;
    border-radius: var(--border-radius);
}

/* Ensure there's enough vertical space for columns to distribute their sections */
.resume-container {
    min-height: 60vh; /* gives room for space-between to work */
}

.resume-header {
    position: relative;
    margin-bottom: 1rem;
}

.header-text {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
}

.resume-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    align-self: flex-start;
}

.resume-header .first-name { color: var(--text); }
.resume-header .last-name { color: var(--text-secondary); }

.resume-header .title {
    font-size: 1rem;
    color: var(--accent);
    margin: 0.25rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    align-self: flex-start;
}

.resume-header .contact-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.8rem;
    text-align: center;
    width: 100%;
    align-self: center;
}

.profile-picture-container {
    position: absolute;
    top: 0;
    right: 0;
}

.profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    animation: scaleUp 0.8s var(--ease) forwards;
}
.title-container {
    display: flex;
    align-items: center;
    position: relative;
    margin: 0.25rem 0;
}

.resume-header .title {
    font-size: 1rem;
    color: var(--primary);
    background-color: var(--accent);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    margin: 0;
    border-bottom: none;
    display: inline-block;
}

.title-line {
    height: 2px;
    background-color: var(--accent);
    flex-grow: 1;
}

.profile-picture-container {
    position: absolute;
    top: 60%;
    right: 0;
    transform: translateY(-50%);
}

.profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    animation: scaleUp 0.8s var(--ease) forwards;
}

.header-text {
    padding-right: 120px;
}


@media print {
    .hidden-print,
    .navbar,
    .footer {
        display: none;
    }

    body {
        background-color: #fff;
        color: #000;
        padding: 0;
    }

    .resume-container {
        background-color: #fff;
        padding: 0.5rem;
        margin: 0;
    }

    .left-column {
        background-color: var(--accent);
    }

    .resume-header h1,
    .resume-header .first-name,
    .resume-header .last-name,
    section h2,
    .work-item h3,
    section p,
    section ul li {
        color: #000;
    }

    .left-column section h2,
    .left-column section p,
    .left-column section ul li {
        color: var(--primary);
    }

    .resume-header .title {
        color: var(--primary);
        background-color: var(--accent);
        border-bottom: none;
    }
    .title-line {
        background-color: var(--primary);
    }

    .resume-header .contact-info {
        color: #000;
        text-align: center;
    }

    section h2 {
        border-bottom: 2px solid var(--accent);
    }

    section ul li::before {
        color: var(--accent);
    }

    .left-column section ul li::before {
        color: var(--primary);
    }

    .references {
        display: none;
    }

    .profile-picture {
        width: 100px;
        height: 100px;
        border: 2px solid var(--accent);
    }
}

@media (max-width: 600px) {
    .title-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .title-line {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .header-text {
        padding-right: 0;
    }

    .profile-picture-container {
        position: static;
        margin-top: 1rem;
        transform: none;
    }
}

.resume-grid {
    /* Use flex to guarantee equal-height columns across browsers */
    display: flex;
    gap: 1.5rem;
    align-items: stretch; /* ensure columns stretch to same height */
}

.resume-grid > * { height: 100%; }

.left-column { flex: 1; }
.right-column { flex: 2; }

.left-column {
    padding: 1rem;
    /* Use a subtle card background instead of a full bright accent */
    /* Muted teal based on accent but softer for readability */
    background-color: rgba(52, 211, 153, 0.08); /* light tint of accent */
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.right-column {
    /* match left column padding so top lines start at same level */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    /* slightly reduce top margin for a tighter, consistent layout */
    margin: 0.5rem 0 0.5rem;
    text-transform: uppercase;
}

/* Ensure the very first section inside each resume column starts flush with the column padding */
.resume-grid > * section:first-child {
    margin-top: 0;
}

/* Remove extra top spacing from the first heading or paragraph inside a column */
.resume-grid > * > section:first-child h2,
.resume-grid > * > section:first-child p {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Also ensure list starts flush if it's the very first child */
.resume-grid > * > section:first-child ul {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Left column headings/text: black */
.left-column section h2 {
    color: #000000;
}
.left-column section p,
.left-column section ul {
    color: #000000;
}

/* Right column headings/text: white */
.right-column section h2 {
    color: #ffffff;
}
.right-column section p,
.right-column section ul {
    color: #ffffff;
}

section p,
section ul {
    font-size: 0.9rem;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.left-column section p,
.left-column section ul {
    /* Ensure readable text on the softer left column */
    color: #000000;
}

section ul {
    list-style: none;
    padding: 0;
}

section ul li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.25rem;
}

section ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    font-size: 1rem;
}

.left-column section ul li::before {
    color: #0b7a4a; /* darker accent for contrast */
}

@media (max-width: 768px) {
    .left-column { background-color: rgba(52, 211, 153, 0.06); }
}

.right-column section ul li::before {
    color: var(--accent);
}

.work-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.5rem 0 0.25rem;
}

.work-item .workplace {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-style: italic;
}

.references {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 1rem;
}

.reference-item {
    width: 30%;
    padding: 1rem;
    background-color: var(--secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    animation: fadeInUp 0.8s var(--ease) forwards;
    position: relative;
    bottom: 1rem;
}

.reference-item h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.reference-item p {
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.reference-item p:last-child {
    font-style: italic;
    color: var(--text);
}

.right-column section div[style*="color: #cccccc"] {
    color: var(--text-secondary);
    opacity: 0.7;
}

@media (display-mode: fullscreen) {
    .navbar,
    .hidden-print,
    .footer {
        display: none;
    }
}


@media (max-width: 768px) {
    .resume-grid {
        grid-template-columns: 1fr 2fr;
    }
}

@media (max-width: 600px) {
    .resume-container {
        padding: 0.5rem;
    }

    .resume-header {
        position: relative;
    }

    .header-text {
        align-items: center;
    }

    .resume-header h1 {
        font-size: 1.5rem;
        align-self: center;
    }

    .resume-header .title {
        align-self: center;
    }

    .profile-picture-container {
        position: static;
        margin-top: 1rem;
    }

    .profile-picture {
        width: 80px;
        height: 80px;
    }

    .references {
        flex-direction: column;
        align-items: center;
    }

    .reference-item {
        width: 90%;
    }
}

.first-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    grid-column: 1 / -1;
}

.card.full-width {
    grid-column: 1 / -1;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
}

.document-item {
    background-color: var(--primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    background-color: rgba(52, 211, 153, 0.05);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.document-item:hover {
    transform: translateY(-5px);
}

.document-item h4 {
    color: var(--text);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.document-item .fullscreen-button {
    margin-top: auto;
    background-color: var(--accent);
    color: var(--primary);
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s var(--ease);
}

.document-item .fullscreen-button:hover {
    background-color: #27ae60;
}

@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .document-item {
        min-height: auto;
        padding: 1.25rem;
    }
}

body.scroll-lock {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 600;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    background-color: #0f0f0f;
    color: var(--text);
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form button[type="submit"] {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s var(--ease);
}

.contact-form button[type="submit"]:hover {
    background-color: #27ae60; /* Darker shade of accent */
}

/* Responsive adjustments for contact form */
@media (max-width: 600px) {
    .contact-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
     .contact-container h1 {
        font-size: 2rem;
    }
     .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form textarea {
         padding: 0.6rem;
         margin-bottom: 1rem;
    }
     .contact-form button[type="submit"] {
         padding: 0.8rem;
         font-size: 1rem;
     }
}

/* ===== New portfolio layout overrides ===== */
.nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; }
.brand { color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.nav-list { list-style: none; display: flex; gap: 0.5rem; margin: 0; padding: 0; align-items: center; }
.nav-list li { margin: 0; }
.nav-list a { color: var(--text); text-decoration: none; padding: 0.5rem 0.75rem; border-radius: 6px; }
.nav-list a:hover, .nav-list a:focus { background: rgba(255,255,255,0.03); }

.hero { padding: 6rem 1rem 4rem; background: linear-gradient(180deg, rgba(18,18,18,0.95), rgba(18,18,18,0.98)); }
.hero-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: center; }
.name { font-size: 2.8rem; margin: 0 0 0.5rem; }
.subtitle { color: var(--text-secondary); margin: 0 0 1rem; }
.lead { color: var(--text-secondary); max-width: 60ch; }
.portrait { width: 280px; height: 360px; border: 4px solid var(--accent); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.6); margin-left: auto; }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.button { display: inline-block; background: var(--accent); color: var(--primary); padding: 0.6rem 1rem; border-radius: 6px; text-decoration: none; border: none; cursor: pointer; }
.button.small { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
.button.ghost, .button.ghost:visited { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.06); }

.section { padding: 3rem 1rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section h2 { margin-top: 0; font-size: 1.6rem; }
.section p.section-intro { color: var(--text-secondary); margin-bottom: 1rem; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.project-card { background: var(--secondary); border-radius: 8px; overflow: hidden; box-shadow: 0 8px 18px rgba(0,0,0,0.5); display: flex; flex-direction: column; }
.project-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.project-body { padding: 1rem; display:flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.project-actions { margin-top: auto; display:flex; gap: 0.5rem; }

.skills-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill { background: rgba(255,255,255,0.03); padding: 0.5rem 0.75rem; border-radius: 6px; color: var(--text); }

.contact-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; align-items: start; }
.contact-form { background: var(--secondary); padding: 1rem; border-radius: 8px; display:flex; flex-direction:column; gap:0.5rem; }
.contact-form label { font-weight:600; }
.contact-form input, .contact-form textarea { background: #0f0f0f; border: 1px solid rgba(255,255,255,0.04); color: var(--text); padding: 0.6rem; border-radius:6px; }
.contact-info-card { background: var(--secondary); padding: 1rem; border-radius: 8px; }

.footer {border-top: 1px solid rgba(255,255,255,0.03); }

/* Responsive adjustments */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr 240px; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .nav-list { display: none; }
    .hero-inner { grid-template-columns: 1fr; }
    .portrait { width: 220px; height: 280px; margin: 1rem auto 0; }
    .projects-grid { grid-template-columns: 1fr; }
}

/* Progress bar behavior */
.progress-container { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--secondary); z-index: 999; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); width: 0; transition: width 200ms linear; }

/* Small utilities */
.sr-only { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ===== Polished visuals & animations ===== */
/* Animated gradient for hero */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero {
    background: linear-gradient(120deg, rgba(16,24,32,0.95) 10%, rgba(20,40,60,0.9) 40%, rgba(18,18,18,0.95) 100%);
    background-size: 300% 300%;
    animation: gradientShift 12s ease infinite;
}

/* Glassy navbar */
.navbar { backdrop-filter: blur(6px); background: rgba(18,18,18,0.6); box-shadow: 0 6px 20px rgba(0,0,0,0.6); }

/* Floating portrait */
@keyframes floatY {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}
.portrait { transform-origin: center; animation: floatY 6s ease-in-out infinite; }

/* Reveal (fade-up) utility */
.reveal { opacity: 0; transform: translateY(18px) scale(0.995); transition: opacity 600ms var(--ease), transform 600ms var(--ease); will-change: opacity, transform; }
.reveal.in-view { opacity: 1; transform: translateY(0) scale(1); }

/* Staggered project cards */
.project-card { transform: translateY(12px) scale(0.995); opacity: 0; transition: transform 500ms var(--ease), opacity 500ms var(--ease), box-shadow 200ms var(--ease); }
.project-card.in-view { transform: translateY(0) scale(1); opacity: 1; }
.project-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }

/* Button micro-interactions */
.button { transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.button:active { transform: translateY(1px) scale(0.995); }
.button:hover { box-shadow: 0 10px 30px rgba(34,197,94,0.14); }

/* Skill badges animation */
.skill { transform: translateY(6px); opacity: 0; transition: transform 480ms var(--ease), opacity 480ms var(--ease); }
.skill.in-view { transform: translateY(0); opacity: 1; }

/* Subtle underline for headings */
.section h2 { position: relative; padding-bottom: 0.6rem; }
.section h2::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 60px; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); border-radius: 2px; }

/* Improve container spacing */
.container { padding-left: 1rem; padding-right: 1rem; }

/* Make images slightly desaturated until hover */
.project-card img { filter: saturate(0.98) contrast(1.02); transition: filter 300ms var(--ease), transform 300ms var(--ease); }
.project-card:hover img { filter: saturate(1.05) contrast(1.04); transform: scale(1.03); }

/* Accessibility: focus outlines */
a:focus, button:focus, .button:focus { outline: 3px solid rgba(52,211,153,0.14); outline-offset: 2px; }

/* ===== Typography polish ===== */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; color: var(--text); }
h1, h2, h3 { letter-spacing: -0.02em; }
h1 { font-weight: 700; font-size: 2.8rem; }
h2 { font-weight: 600; font-size: 1.4rem; }
h3 { font-weight: 600; font-size: 1.05rem; }
p, li { color: var(--text-secondary); }

/* ===== Animation keyframes ===== */
@keyframes popIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideLeft {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-18px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInShort {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Animation helper classes ===== */
.anim-pop { animation: popIn 560ms var(--ease) both; }
.anim-left { animation: slideLeft 560ms var(--ease) both; }
.anim-right { animation: slideRight 560ms var(--ease) both; }
.anim-fade { animation: fadeInShort 420ms var(--ease) both; }

/* Use utility to set animation delay via inline style or JS */
.anim-delay { animation-delay: var(--delay, 0ms); }

/* Apply default reveal transform if element doesn't have a specific anim class */
.reveal { opacity: 0; transform: translateY(12px) scale(0.995); }
.reveal.in-view { opacity: 1; transform: translateY(0) scale(1); }

/* Keep cards crisp on high-DPI */
.project-card, .portrait, .contact-info-card { backface-visibility: hidden; transform-style: preserve-3d; }

/* Final override for resume left-column: light card with black text */
.resume-container .resume-grid > .left-column {
    background-color: #34d399; /* very light mint */
    color: #000;
}
.resume-container .resume-grid > .left-column h2,
.resume-container .resume-grid > .left-column p,
.resume-container .resume-grid > .left-column li,
.resume-container .resume-grid > .left-column a {
    color: #000 !important;
}
.resume-container .resume-grid > .left-column ul li::before { color: rgba(0,0,0,0.6) !important; }

/* Ensure resume columns visually match height */
.resume-container .resume-grid { align-items: stretch; }
.resume-container .resume-grid > * {
    display: flex;
    flex-direction: column;
    /* Fill the column height so space-between can distribute sections */
    height: 100%;
    /* Distribute sections evenly so column bottoms align visually */
    justify-content: space-between;
    gap: 1rem; /* consistent vertical spacing between sections */
}

/* Normalize section spacing inside each column to avoid extra gaps */
.resume-grid > * > section { margin: 0; padding: 0; }
.resume-grid > * > section h2 { margin: 0 0 0.5rem; }
.resume-grid > * > section p,
.resume-grid > * > section ul { margin: 0 0 0.5rem; }

/* Add consistent inner padding-bottom so columns don't touch the container edge */
.left-column, .right-column { padding-bottom: 1rem; }


