/* ==========================================================================
   Mark Molesworth Resume - Accessible Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts Import
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;1,400&family=Inter:wght@400;500;600&family=Montserrat:wght@500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette */
    --color-deep-indigo: #2D3E50;
    --color-cloud-blue: #41A4DD;
    --color-bright-orange: #FF9900;
    --color-mint-green: #5CD3B5;
    --color-cool-white: #F9FAFB;
    --color-slate-gray: #6B7280;
    
    /* Semantic Color Assignments */
    --color-primary: var(--color-deep-indigo);
    --color-accent: var(--color-cloud-blue);
    --color-emphasis: var(--color-bright-orange);
    --color-secondary-accent: var(--color-mint-green);
    --color-background: var(--color-cool-white);
    --color-text: var(--color-deep-indigo);
    --color-text-muted: var(--color-slate-gray);
    
    /* Accessible link color (darker for better contrast) */
    --color-link: #2B7CAD;
    --color-link-hover: var(--color-deep-indigo);
    
    /* Focus ring */
    --color-focus: var(--color-cloud-blue);
    
    /* Typography */
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'IBM Plex Serif', Georgia, serif;
    --font-mono: 'Roboto Mono', 'Consolas', monospace;
    
    /* Font Sizes (using rem for accessibility) */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Layout */
    --max-width: 52rem;
    --border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Base Styles & Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%; /* Respect user's browser font size setting */
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    padding: var(--space-6);
    font-family: var(--font-body), serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Accessibility: Skip Link
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 1000;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body). serif;
    font-weight: 600;
    color: var(--color-cool-white);
    background-color: var(--color-primary);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: var(--space-4);
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Accessibility: Focus Styles
   -------------------------------------------------------------------------- */
:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

/* --------------------------------------------------------------------------
   Accessibility: Visually Hidden (for screen readers)
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Layout Container
   -------------------------------------------------------------------------- */
body > header,
main {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header Styles
   -------------------------------------------------------------------------- */
body > header {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    margin-bottom: var(--space-6);
    background-color: var(--color-primary);
    border-radius: var(--border-radius);
    color: var(--color-cool-white);
}

body > header h1 {
    margin: 0 0 var(--space-4) 0;
    font-family: var(--font-heading), sans-serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-cool-white);
}

/* Contact Info */
address {
    font-style: normal;
    font-size: var(--text-base);
    color: rgba(249, 250, 251, 0.9);
}

address a {
    color: var(--color-cool-white);
    text-decoration: none;
    padding-bottom: 1px;
    border-bottom: 1px solid rgba(249, 250, 251, 0.4);
    transition: border-color 0.2s ease;
}

address a:hover,
address a:focus {
    border-bottom-color: var(--color-cool-white);
}

/* --------------------------------------------------------------------------
   Section Styles
   -------------------------------------------------------------------------- */
section {
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid #E5E7EB;
}

section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Section Headings */
section > h2 {
    margin: 0 0 var(--space-6) 0;
    font-family: var(--font-heading), sans-serif;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: var(--space-2);
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Professional Statement
   -------------------------------------------------------------------------- */
#professional-statement p {
    font-family: var(--font-serif), serif;
    font-size: var(--text-lg);
    line-height: 1.7;
    color: var(--color-text);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Experience Section
   -------------------------------------------------------------------------- */
#experience article {
    margin-bottom: var(--space-8);
}

#experience article:last-child {
    margin-bottom: 0;
}

/* Job Title */
#experience article h3 {
    margin: 0 0 var(--space-1) 0;
    font-family: var(--font-heading), sans-serif;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-primary);
}

/* Company & Location */
#experience article header > p:first-of-type {
    margin: 0 0 var(--space-1) 0;
    font-weight: 500;
    color: var(--color-text);
}

/* Date Range */
#experience article header > p:last-of-type {
    margin: 0 0 var(--space-4) 0;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* Job responsibilities list */
#experience ul {
    margin: 0;
    padding-left: var(--space-6);
    list-style-type: none;
}

#experience li {
    position: relative;
    margin-bottom: var(--space-3);
    padding-left: var(--space-2);
    line-height: 1.6;
}

#experience li::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--space-4));
    top: 0.6em;
    width: 6px;
    height: 6px;
    background-color: var(--color-accent);
    border-radius: 50%;
}

#experience li:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Certifications Section
   -------------------------------------------------------------------------- */
#certifications ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--space-3);
}

#certifications li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-3) var(--space-4);
    background-color: white;
    border-left: 3px solid var(--color-emphasis);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#certifications li time {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    margin-left: var(--space-4);
}

/* --------------------------------------------------------------------------
   Skills Section
   -------------------------------------------------------------------------- */
#skills ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

#skills li {
    display: inline-block;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono), monospace;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-primary);
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#skills li:hover {
    border-color: var(--color-secondary-accent);
    box-shadow: 0 2px 4px rgba(92, 211, 181, 0.15);
}

/* --------------------------------------------------------------------------
   Education Section
   -------------------------------------------------------------------------- */
#education article {
    padding: var(--space-4);
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#education h3 {
    margin: 0 0 var(--space-1) 0;
    font-family: var(--font-heading), sans-serif;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-primary);
}

#education p {
    margin: 0;
    color: var(--color-text-muted);
}

#education p:nth-of-type(2) {
    margin-top: var(--space-2);
    color: var(--color-text);
    font-weight: 500;
}

#education p:last-of-type {
    font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   Links (General)
   -------------------------------------------------------------------------- */
a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-link-hover);
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    body {
        padding: var(--space-4);
    }
    
    body > header {
        padding: var(--space-6) var(--space-4);
    }
    
    body > header h1 {
        font-size: var(--text-2xl);
    }
    
    address {
        font-size: var(--text-sm);
    }
    
    #certifications li {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }
    
    #certifications li time {
        margin-left: 0;
    }
}

/* --------------------------------------------------------------------------
   High Contrast Mode Support
   -------------------------------------------------------------------------- */
@media (prefers-contrast: more) {
    :root {
        --color-text: #000000;
        --color-link: #0000EE;
    }
    
    body > header {
        border: 2px solid var(--color-primary);
    }
    
    section > h2 {
        border-bottom-width: 4px;
    }
    
    #certifications li,
    #skills li,
    #education article {
        border: 2px solid var(--color-primary);
    }
}
