/* 
   ERIC MARTIN // SYSTEM ARCHIVE
   Aesthetic: Industrial Academic / High Signal
   Version: 1.2 (Playfair Display)
*/

:root {
    /* Primary Palette */
    --color-paper: #FAF9F6;
    --color-charcoal: #1A1A1A;
    --color-slate: #555555;
    --color-silver: #888888;
    --color-border: #E5E5E5;
    --color-fog: #F5F5F5;
    
    /* Accent: Sage */
    --color-sage: #5A6E62;
    --color-sage-border: #3D4A42;
    --color-sage-highlight: #7A9486;
    --color-sage-light: #E8EDEA;
    
    /* Accent: Ochre */
    --color-ochre: #9C8362;
    --color-ochre-border: #7A6448;
    --color-ochre-highlight: #C4A882;
    --color-ochre-light: #F5F0E8;
    
    /* Accent: Warm Gray */
    --color-warm-gray: #8B8578;
    --color-warm-gray-border: #665F54;
    --color-warm-gray-highlight: #ABA59A;
    
    /* Legacy aliases (for compatibility) */
    --bg-color: var(--color-paper);
    --text-primary: var(--color-charcoal);
    --text-secondary: var(--color-slate);
    --border-color: var(--color-border);
    --accent-color: var(--color-charcoal);
    
    /* Typography */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    
    /* Layout */
    --max-width: 720px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    padding: 3rem 1.5rem; /* Increased top padding for confident whitespace */
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--text-primary);
}

h1 {
    font-size: 2.75rem; /* Slightly larger */
    line-height: 1;
    letter-spacing: -0.01em;  /* CHANGED from -0.03em — Playfair needs less tightening */
    margin-bottom: 0.25rem;
}

p {
    margin-bottom: 1.5rem;
    color: #2a2a2a;
    max-width: 65ch; /* Optimal reading length */
}

strong {
    font-weight: 600;
    color: #000;
}

a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px; /* The "1%" detail: prevents cutting into letters */
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.6;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 4rem 0; /* More breathing room between sections */
}

/* Header - The "Baseline" Fix */
.header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (min-width: 640px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end; /* Aligns Nav bottom with Subtitle bottom */
    }
}

.identity {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.avatar {
    width: 72px; /* Slightly larger presence */
    height: 72px;
    border-radius: 3px; /* Sharp, minimal rounding */
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    display: block;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}

.nav-links {
    font-size: 0.9rem;
    font-weight: 500;
    padding-bottom: 3px; /* Optical alignment adjustment */
    white-space: nowrap; /* Prevent line breaks within nav */
}

/* On smaller screens, allow nav to wrap gracefully as a block */
@media (max-width: 639px) {
    .nav-links {
        white-space: normal;
        line-height: 1.8; /* More breathing room if it does wrap */
    }
}

.separator {
    color: #d1d1d1;
    margin: 0 0.6rem;
    font-weight: 300;
}

/* Sections Grid - The "Stacking" Fix */
.section {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First: Stacked */
    gap: 0.5rem;
    margin-bottom: 5rem;
}

@media (min-width: 640px) {
    .section {
        grid-template-columns: 160px 1fr; /* Desktop: Labels on left */
        gap: 2rem;
    }
}

.label {
    font-size: 0.75rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-silver);
    margin-top: 0.4rem; 
    line-height: 1.6;
}

/* Data Grid - The "Paper" Look */
.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0; /* Remove gap, let borders handle it */
    margin: 2.5rem 0;
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02); /* Almost invisible lift */
}

@media (min-width: 500px) {
    .data-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.data-point {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 1px solid var(--border-color); /* Internal dividers */
    border-bottom: 1px solid var(--border-color);
}

/* Remove borders on right edge for last item in row */
@media (min-width: 500px) {
    .data-point { border-bottom: none; }
    .data-point:last-child { border-right: none; }
}
/* Fix mobile borders */
@media (max-width: 499px) {
    .data-point:nth-child(2n) { border-right: none; }
    .data-point:nth-child(3), .data-point:nth-child(4) { border-bottom: none; }
}

.data-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.data-key {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.footnote {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-left: 2px solid #ddd;
    padding-left: 1rem;
    margin-top: 1.5rem;
}

/* Project List */
.project-list {
    list-style: none;
}

.project-list li {
    margin-bottom: 3rem;
}

.project-list li:last-child {
    margin-bottom: 0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    font-family: var(--font-sans);
}

.project-header strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.year {
    font-size: 0.8rem;
    color: var(--color-silver);
    font-variant-numeric: tabular-nums;
}

.project-desc {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #444; /* Slightly softer than body text */
}

/* Footer */
.footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-silver);
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.footer a {
    color: var(--color-silver);
}

.footer a:hover {
    color: var(--color-charcoal);
    opacity: 1;
}

@media (min-width: 640px) {
    .footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

.system-status {
    font-family: "Courier New", monospace; /* Tech reference */
    opacity: 0.6;
}

/* Print Optimization */
@media print {
    body { background: white; color: black; padding: 0; }
    .nav-links, .system-status { display: none; }
    .container { max-width: 100%; }
    a { text-decoration: none; color: black; }
    .section { display: block; margin-bottom: 2rem; }
    .label { 
        border-bottom: 1px solid #000; 
        display: block; 
        margin-bottom: 1rem;
        color: #000;
    }
    .data-grid { box-shadow: none; border: 1px solid #000; }
    .data-point { border-color: #000; }
}
