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

*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #f39c12;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --max-width: 900px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Layout with Sidebar */
.main-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.sidebar-nav {
    width: 200px;
    position: sticky;
    top: 20px;
    height: fit-content;
    padding: 20px 0;
    margin-right: 40px;
}

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

.sidebar-nav li {
    margin-bottom: 15px;
}

.sidebar-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
    display: block;
    padding: 8px 12px;
    border-left: 3px solid transparent;
    border-radius: 0 4px 4px 0;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
    outline: none;
}

.sidebar-nav a:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.sidebar-nav a.active {
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
    background-color: var(--bg-light);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0;
    margin-bottom: 50px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background-color: var(--bg-light);
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.contact-info {
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.contact-info a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
    border-radius: 3px;
    padding: 2px 4px;
}

.contact-info a:hover,
.contact-info a:focus {
    opacity: 0.8;
    text-decoration: underline;
}

.contact-info a:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.separator {
    margin: 0 5px;
    opacity: 0.6;
}

/* Main Content */
main {
    padding-bottom: 60px;
}

section {
    margin-bottom: 50px;
}

h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

/* Summary Section */
#summary p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Experience Section */
.experience-item {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 10px;
}

.period {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

.company {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 10px;
    font-style: italic;
}

.description {
    margin-bottom: 15px;
    line-height: 1.7;
}

.experience-item ul {
    margin-left: 20px;
    margin-top: 10px;
}

.experience-item li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.skill-category {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.skill-category h4 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.skill-category p {
    color: var(--text-color);
    line-height: 1.6;
}

/* Portfolio Section */
.portfolio-item {
    margin-bottom: 60px;
    padding-bottom: 50px;
    border-bottom: 1px solid var(--border-color);
}

.portfolio-item:last-child {
    border-bottom: none;
}

.portfolio-content {
    margin-bottom: 30px;
}

.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-description {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.portfolio-screenshots {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.portfolio-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
}

/* Stack Apple Watch screenshots vertically */
.portfolio-images.watch-images {
    grid-template-columns: 1fr;
    max-width: 300px;
    gap: 15px;
}

.image-card {
    background-color: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-card:hover,
.image-card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.image-card a {
    display: block;
    cursor: pointer;
}

.image-card img {
    width: 100%;
    height: 450px;
    object-fit: contain;
    display: block;
    background-color: #e9ecef;
}

/* Square-ish dimensions for Apple Watch */
.watch-images .image-card img {
    height: 210px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.tag {
    background-color: var(--secondary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s;
    display: inline-block;
}

/* Education Section */
.education-item {
    margin-bottom: 20px;
}

.education-item h4 {
    margin-bottom: 5px;
}

.education-item p {
    color: var(--text-light);
    margin-bottom: 10px;
}

/* Footer */
footer {
    background-color: var(--bg-light);
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar-nav {
        position: static;
        width: 100%;
        margin-right: 0;
        margin-bottom: 30px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }

    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sidebar-nav li {
        margin-bottom: 0;
    }

    .sidebar-nav a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 12px;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        border-left-color: transparent;
        border-bottom-color: var(--secondary-color);
    }
}

@media (max-width: 768px) {
    .header-content {
        gap: 20px;
    }

    .profile-picture {
        width: 90px;
        height: 90px;
        border-width: 3px;
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .contact-info {
        font-size: 0.9rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .portfolio-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .portfolio-screenshots {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

    .portfolio-images {
        grid-template-columns: 1fr;
    }

    .portfolio-images.watch-images {
        max-width: 100%;
    }

    .image-card img {
        height: 400px;
    }

    section {
        margin-bottom: 40px;
    }

    .sidebar-nav ul {
        flex-direction: column;
    }

    .sidebar-nav a {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        border-bottom-color: transparent;
        border-left-color: var(--secondary-color);
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

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

    .header-text h1 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 15px;
    }

    header {
        padding: 30px 0;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        justify-content: center;
    }

    .separator {
        display: none;
    }

    .image-card img {
        height: 350px;
    }
}
