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

html {
    background-color: var(--bg-color);
}

body {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: var(--accent-text-color);
    padding: 8px 16px;
    text-decoration: none;
    border: none;
    z-index: 100;
}

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

/* Container */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 3.5rem 2rem 4rem;
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--heading-color);
    letter-spacing: -0.01em;
}

h2 {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    color: var(--section-heading-color);
}

p {
    margin-bottom: 1rem;
    line-height: 1.65;
}

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

a:hover {
    opacity: 0.7;
}

/* Header */
header {
    margin-bottom: 2.5rem;
}

.subtitle {
    font-size: 0.8125rem;
    color: var(--subtitle-color);
    margin-bottom: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
}

.resume-link {
    display: inline-block;
    color: var(--link-color);
    border-bottom: 1px solid var(--link-color);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: opacity 0.2s ease;
}

.resume-link:hover {
    opacity: 0.7;
}

/* Sections */
section {
    margin-bottom: 2.5rem;
}

/* Work Experience */
.work-item {
    margin-bottom: 1.125rem;
}

.work-header {
    margin-bottom: 0.1875rem;
}

.company-title {
    font-weight: 400;
    color: var(--heading-color);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.work-period {
    color: var(--subtitle-color);
    font-size: 0.6875rem;
    line-height: 1.6;
    font-weight: 400;
}

.work-accomplishments {
    display: none;
}

/* Publications */
.publication-item,
.patent-item,
.project-item {
    margin-bottom: 1.125rem;
}

.item-title {
    font-weight: 500;
    color: var(--heading-color);
    margin-bottom: 0.25rem;
    line-height: 1.5;
    font-size: 0.8125rem;
}

.item-meta {
    color: var(--subtitle-color);
    font-size: 0.6875rem;
    line-height: 1.6;
    font-weight: 400;
}

.item-description {
    margin-top: 0;
    color: var(--subtitle-color);
    line-height: 1.65;
    font-size: 0.75rem;
}

/* Footer/Contact */
footer {
    margin-top: 3rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-color);
}

#contact-info {
    color: var(--text-color);
    font-size: 0.8125rem;
    line-height: 1.6;
}

#about-text {
    font-size: 0.8125rem;
    line-height: 1.65;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 2.5rem 1.25rem 3rem;
    }

    h1 {
        font-size: 1.375rem;
    }

    h2 {
        margin-top: 2rem;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        color: black;
        font-size: 11pt;
        line-height: 1.4;
    }

    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Hide skip link and resume button when printing */
    .skip-link,
    .resume-link {
        display: none !important;
    }

    /* Ensure links show their URLs */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }

    /* Don't show URLs for internal links */
    a[href^="#"]:after,
    a[href^="mailto:"]:after {
        content: "";
    }

    /* Optimize spacing for print */
    h1 {
        font-size: 18pt;
        margin-bottom: 0.25rem;
    }

    h2 {
        font-size: 12pt;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
        page-break-after: avoid;
    }

    section {
        margin-bottom: 1.5rem;
        page-break-inside: avoid;
    }

    .work-item,
    .publication-item,
    .patent-item,
    .project-item {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    /* Force all text to black for better print contrast */
    h1, h2, .company-title, .item-title {
        color: black !important;
    }

    p, li, .item-description, .work-period, .item-meta {
        color: #333 !important;
    }

    /* Remove borders and background colors */
    footer {
        border-top: 1px solid #ccc;
    }

    /* Ensure links are visible */
    a {
        color: #000 !important;
        text-decoration: underline;
    }
}
