/* Global Styles */
:root {
    --text-color: #333;
    --bg-color: #fff;
    --accent-color: #000;
    /* Senior/Minimalist aesthetic */
    --hover-color: #555;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --spacing: 2rem;
    --max-width: 800px;
    /* Optimal reading width */
}

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.01em;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

a:hover {
    border-bottom: 1px solid var(--accent-color);
}

/* Layout */
header {
    background: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: #000;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav ul li a {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

nav ul li a:hover,
nav ul li a.active {
    color: #000;
}

main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 0 2rem;
}

section {
    margin-bottom: 4rem;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #f9f9f9;
    font-size: 0.9rem;
    color: #666;
    margin-top: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--hover-color);
    border-bottom: none;
    /* Override default link generic style if applied */
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero .sub-headline {
    font-size: 1.25rem;
    color: #555;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero .intro {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    color: #444;
}

/* Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    main {
        margin: 2rem auto;
    }
}

/* Portfolio Specific Styles */
.hero-portfolio {
    text-align: center;
    margin-bottom: 3rem;
}

.timeline-section {
    margin-bottom: 4rem;
    overflow-x: auto;
    /* Handle wide timelines gracefully */
}

/* Mermaid customization */
.mermaid {
    display: flex;
    justify-content: center;
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
}

.experience-section {
    margin-bottom: 4rem;
}

.experience-item {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

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

.role-header {
    margin-bottom: 1rem;
}

.role-header h3 {
    margin-bottom: 0.25rem;
    color: var(--accent-color);
}

.role-header .company {
    font-weight: 600;
    color: #444;
    display: block;
}

.role-header .date {
    font-size: 0.9rem;
    color: #777;
    display: block;
    margin-top: 0.25rem;
}

.role-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: #555;
}

.role-content li {
    margin-bottom: 0.5rem;
}

.featured-work {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .role-header {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
    }

    .role-header h3 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .role-header .company {
        font-size: 1.1rem;
    }
}

/* Project Styles */
.projects-list {
    margin-top: 2rem;
    padding-left: 1rem;
    border-left: 3px solid #f0f0f0;
}

.projects-list h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-item {
    margin-bottom: 2rem;
}

.project-header h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--accent-color);
}

.project-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
    display: block;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.tech-stack span {
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
}

.domain-tag {
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
}