/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties - Light Mode (Default) */
:root {
    --bg-body: #f5f5f5;
    --bg-container: #ffffff;
    --text-primary: #333;
    --text-secondary: #555;
    --text-tertiary: #666;
    --heading-color: #1a1a1a;
    --link-color: #0050a0;
    --link-hover: #0056b3;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-headshot: rgba(0, 0, 0, 0.1);
}

/* Dark Mode - Manual Override */
[data-theme="dark"] {
    --bg-body: #1a1a1a;
    --bg-container: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #999;
    --heading-color: #ffffff;
    --link-color: #5dade2;
    --link-hover: #7dbef5;
    --border-color: #444;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-headshot: rgba(0, 0, 0, 0.4);
}

/* Dark Mode - System Preference Fallback */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-body: #1a1a1a;
        --bg-container: #2d2d2d;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --text-tertiary: #999;
        --heading-color: #ffffff;
        --link-color: #5dade2;
        --link-hover: #7dbef5;
        --border-color: #444;
        --shadow: rgba(0, 0, 0, 0.3);
        --shadow-headshot: rgba(0, 0, 0, 0.4);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Base link styles - WCAG AA compliant */
a,
a:link,
a:visited {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Main container */
.container {
    max-width: 600px;
    width: 100%;
    background-color: var(--bg-container);
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    margin: 0 auto;
    flex: 1 0 auto;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    text-align: center;
    transition: color 0.3s ease;
}

/* Headshot */
.headshot {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    object-fit: cover;
    box-shadow: 0 2px 8px var(--shadow-headshot);
    transition: box-shadow 0.3s ease;
}

.bio {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 2rem;
    padding: 1.5rem;
    transition: color 0.3s ease;
}

.bio ul {
    list-style-position: inside;
    padding-left: 0;
    margin: 0.5rem 0;
}

.bio li {
    margin-bottom: 0.25rem;
}

.bio p {
    margin-bottom: 1rem;
}

.bio a {
    color: var(--link-color);
    text-decoration: underline;
}

.bio a:hover,
.bio a:focus {
    color: var(--link-hover);
}

/* Screen reader only (accessibility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
}

/* Social links section */
.social-links {
    margin-top: 2.5rem;
    padding: 0.75rem;
}

.social-links h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    margin-top: 2rem;
    text-align: left;
    transition: color 0.3s ease;
}

.social-links h2:first-child {
    margin-top: 0;
}

.social-links h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: left;
    transition: color 0.3s ease;
}

.social-note {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
    text-align: left;
    transition: color 0.3s ease;
}

.social-links ul {
    list-style-position: inside;
    padding-left: 0;
    margin: 0.5rem 0 1.5rem;
}

.social-links li {
    margin-bottom: 0.5rem;
}

.social-links a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.social-links a:hover,
.social-links a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

.social-links a:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 0.75rem;
    margin-top: 3rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.footer-contact {
    margin-bottom: 1.5rem;
}

.footer-contact h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.footer-contact ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.footer-contact li {
    margin: 0;
}

.footer-contact a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact a:hover,
.footer-contact a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

.footer-contact a:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
    border-radius: 2px;
}

footer p {
    margin: 0.4rem 0;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: var(--bg-container);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
    gap: 0.5rem;
    padding: 0.5rem;
}

.theme-toggle:hover {
    background-color: var(--text-primary);
    color: var(--bg-container);
    transform: scale(1.1);
}

.theme-toggle:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle-icon {
    display: block;
    line-height: 1;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-text {
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-icon {
    transform: rotate(180deg);
}

/* Navigation */
.main-nav {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
    background-color: var(--bg-container);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-nav a:hover,
.main-nav a:focus {
    background-color: var(--bg-body);
    color: var(--link-color);
    text-decoration: none;
}

.main-nav a.active {
    background-color: var(--link-color);
    color: #ffffff;
    font-weight: 600;
}

.main-nav a.active:hover,
.main-nav a.active:focus {
    background-color: var(--link-hover);
    color: #ffffff;
}

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

/* Home icon in navigation */
.main-nav .home-icon {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.main-nav a:hover .home-icon,
.main-nav a:focus .home-icon {
    opacity: 0.9;
}

.main-nav a.active .home-icon {
    opacity: 1;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.breadcrumb a {
    color: var(--link-color);
    text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-secondary);
}

/* Page Links Section (Homepage) */
.page-links {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--bg-body);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.page-links h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.page-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-links li {
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.page-links li:last-child {
    margin-bottom: 0;
}

.page-links a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.page-links a:hover,
.page-links a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

.page-links a:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.page-links strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Content section */
.content {
    margin-top: 1.5rem;
}

.content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content h2:first-of-type {
    margin-top: 0;
}

.content h2 + p {
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

.content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content h2 + h3 {
    margin-top: 1rem;
}

.content p {
    margin-bottom: 1.5rem;
}

.content ul {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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

.intro {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Education Links */
.education-links {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.education-links li {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.education-links li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1rem;
}

.education-links a {
    display: block;
    font-weight: 600;
    color: var(--link-color);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.education-links a:hover,
.education-links a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

.education-links .blurb {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0;
    font-style: italic;
    line-height: 1.5;
}

/* Work Experience */
.work-experience {
    margin-top: 1.5rem;
}

.work-entry {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.work-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.work-logo-container {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.work-logo {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: contain;
    background-color: var(--bg-body);
    padding: 2px;
    transition: opacity 0.2s ease;
}

.work-logo:hover {
    opacity: 0.9;
}

.work-content {
    flex: 1;
    min-width: 0;
}

.work-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0 0 0.25rem 0;
    transition: color 0.3s ease;
}

.work-company {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    transition: color 0.3s ease;
}

.work-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    transition: color 0.3s ease;
}

.work-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    transition: color 0.3s ease;
}

.work-description {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0.5rem 0 0 0;
    transition: color 0.3s ease;
}

/* Responsive adjustments - Mobile-first approach */
@media (min-width: 481px) {
    .container {
        padding: 40px 30px;
    }
    
    .social-links {
        padding: 1rem;
    }
    
    .social-links h2 {
        font-size: 1.5rem;
    }
    
    .social-links h3 {
        font-size: 1.125rem;
    }
    
    footer {
        font-size: 0.9rem;
        padding: 2rem 1rem;
    }
    
    .footer-contact ul {
        gap: 1rem;
    }
    
    .footer-contact h3 {
        font-size: 1rem;
    }
    
    footer p {
        margin: 0.5rem 0;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .main-nav {
        padding: 1.25rem;
    }
    
    .main-nav a {
        font-size: 0.95rem;
        padding: 0.625rem 1rem;
    }
    
    .page-links {
        padding: 2rem;
    }
    
    .page-links h2 {
        font-size: 1.75rem;
    }
}

@media (min-width: 769px) {
    .container {
        padding: 60px 40px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .bio {
        font-size: 1.125rem;
        margin-bottom: 2.5rem;
    }
    
    .headshot {
        width: 150px;
        height: 150px;
    }
    
    .social-links {
        padding: 1.5rem;
    }
    
    .social-links h2 {
        font-size: 1.75rem;
    }
    
    .social-links h3 {
        font-size: 1.25rem;
    }
    
    .main-nav {
        padding: 1.5rem;
    }
    
    .main-nav a {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }
    
    .page-links {
        padding: 2.5rem;
    }
    
    .breadcrumb {
        font-size: 0.95rem;
    }
    
    .content h2 {
        margin-top: 3rem;
    }
    
    .content h2 + p {
        margin-bottom: 2rem;
    }
    
    .work-entry {
        gap: 1.5rem;
    }
    
    .work-title {
        font-size: 1.125rem;
    }
    
    .work-company,
    .work-meta,
    .work-location {
        font-size: 0.95rem;
    }
    
    .work-description {
        font-size: 0.95rem;
    }
}

/* Wide screen - show text in toggle button */
@media (min-width: 1024px) {
    .theme-toggle {
        width: auto;
        height: auto;
        border-radius: 24px;
        padding: 0.625rem 1rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .theme-toggle-text {
        display: block;
    }
}

