/*
 * Tim Lange Resume - Stylesheet
 * 
 * Design Philosophy:
 * - Inspired by Daring Fireball's clean, typography-first approach
 * - Dark theme with excellent readability
 * - Minimal decoration, maximum clarity
 * - Mobile-first responsive design
 * - System font stack for performance and native feel
 */

/* ============================================================================
   CSS CUSTOM PROPERTIES (CSS Variables)
   ============================================================================
   Define all colors, spacing, and typography values here for easy theming
   and consistency throughout the stylesheet.
*/

:root {
  /* Color palette */
  --bg-primary: #0e1117;        /* Main background color - deep dark blue-gray */
  --bg-secondary: #1a1d24;      /* Slightly lighter for subtle contrast */
  --text-primary: #f0f0f0;      /* Main text color - soft white */
  --text-secondary: #b0b0b0;    /* Secondary text - muted gray */
  --text-muted: #808080;        /* Muted text for dates and metadata */
  --accent: #00e676;            /* Accent color for links and highlights - bright green */
  --accent-hover: #00ff88;      /* Lighter green for hover states */
  --border: #2a2a2a;            /* Border color for subtle separators */
  
  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  
  /* Font sizes - modular scale based on 16px with 1.25 ratio */
  --text-xs: 0.8rem;      /* 12.8px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.563rem;    /* 25px */
  --text-2xl: 1.953rem;   /* 31.25px */
  --text-3xl: 2.441rem;   /* 39px */
  
  /* Spacing - consistent rhythm */
  --space-xs: 0.5rem;     /* 8px */
  --space-sm: 1rem;       /* 16px */
  --space-md: 1.5rem;     /* 24px */
  --space-lg: 2rem;       /* 32px */
  --space-xl: 3rem;       /* 48px */
  --space-2xl: 4rem;      /* 64px */
  
  /* Layout */
  --content-width: 650px;  /* Optimal reading width */
  --line-height-base: 1.6; /* Comfortable line height for body text */
  --line-height-heading: 1.2; /* Tighter line height for headings */
}

/* ============================================================================
   RESET AND BASE STYLES
   ============================================================================
   Normalize browser defaults and set foundational styles.
*/

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

html {
  /* Enable smooth scrolling for anchor links */
  scroll-behavior: smooth;
  
  /* Prevent font size inflation on mobile */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  
  /* Improve font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Ensure text remains visible during webfont load */
  font-display: swap;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================
   Establish a clear typographic hierarchy with consistent spacing.
*/

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-heading);
  font-weight: 600;
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
}

h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
  margin-top: var(--space-2xl);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

/* First section should not have excessive top margin */
.section:first-of-type h2 {
  margin-top: var(--space-lg);
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

p {
  margin-bottom: var(--space-md);
}

/* Last paragraph in a section should have no bottom margin */
p:last-child {
  margin-bottom: 0;
}

/* ============================================================================
   LINKS
   ============================================================================
   Simple, accessible link styles with clear hover states.
*/

a {
  color: var(--accent);
  text-decoration: none;
  
  /* Smooth transition for hover effects */
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--accent-hover);
}

/* Add underline on hover for better affordance */
a:hover {
  text-decoration: underline;
}

/* Focus styles for keyboard navigation accessibility */
a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Special styling for email links */
.email-link {
  font-size: var(--text-lg);
  font-weight: 500;
}

/* ============================================================================
   LISTS
   ============================================================================
   Clean, readable list styles with proper spacing.
*/

ul {
  list-style: disc;
  margin-left: var(--space-md);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-base);
}

/* Last list item should have no bottom margin */
li:last-child {
  margin-bottom: 0;
}

/* Awards list - inline year styling */
.awards-list {
  list-style: none;
  margin-left: 0;
}

.awards-list li {
  margin-bottom: var(--space-md);
}

.awards-list .year {
  color: var(--text-muted);
  font-weight: normal;
}

/* Contributions list - more spacing for readability */
.contributions-list li {
  margin-bottom: var(--space-md);
}

/* ============================================================================
   LAYOUT - HEADER
   ============================================================================
   Site header with name and tagline.
*/

.site-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
  text-align: left;
}

.site-header h1 {
  margin-bottom: var(--space-xs);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em; /* Slight negative tracking for large text */
}

.tagline {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ============================================================================
   LAYOUT - MAIN CONTENT
   ============================================================================
   Container for all resume sections with optimal reading width.
*/

.content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-2xl);
}

/* ============================================================================
   SECTIONS
   ============================================================================
   Individual resume sections with consistent spacing.
*/

.section {
  margin-bottom: var(--space-2xl);
}

/* Last section should have less bottom margin */
.section:last-of-type {
  margin-bottom: var(--space-xl);
}

/* ============================================================================
   EXPERIENCE - JOB ENTRIES
   ============================================================================
   Styling for job history with company, role, and responsibilities.
*/

.job {
  margin-bottom: var(--space-xl);
}

/* Last job entry should have no bottom margin */
.job:last-of-type {
  margin-bottom: 0;
}

.job h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.job-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.job-responsibilities {
  margin-top: var(--space-md);
}

/* ============================================================================
   EDUCATION
   ============================================================================
   Styling for education entries.
*/

.education {
  margin-bottom: var(--space-md);
}

.education h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.education-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================================================
   FOOTER
   ============================================================================
   Simple footer with copyright information.
*/

.site-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================
   Adjustments for different screen sizes - mobile first approach.
*/

/* Tablets and larger (768px+) */
@media (min-width: 768px) {
  :root {
    --text-base: 1.125rem; /* 18px for better readability on larger screens */
  }
  
  .site-header {
    padding-top: var(--space-2xl);
  }
  
  .site-header h1 {
    font-size: var(--text-3xl);
  }
}

/* Large screens (1024px+) */
@media (min-width: 1024px) {
  .site-header {
    padding-top: 5rem;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================
   Optimized styles for printing or saving as PDF.
*/

@media print {
  :root {
    --bg-primary: #ffffff;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --accent: #0066cc;
    --border: #cccccc;
  }
  
  body {
    font-size: 11pt;
    line-height: 1.5;
  }
  
  .site-header,
  .content,
  .site-footer {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  
  /* Avoid page breaks inside important elements */
  .job,
  .section {
    page-break-inside: avoid;
  }
  
  h2 {
    page-break-after: avoid;
  }
  
  /* Remove interactive elements for print */
  a {
    color: var(--text-primary);
    text-decoration: none;
  }
  
  /* Show URLs after links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: var(--text-muted);
  }
  
  .email-link[href^="mailto"]:after {
    content: " (" attr(href) ")";
  }
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================
   Additional styles for better accessibility.
*/

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --bg-primary: #000000;
    --accent: #00ff00;
    --border: #ffffff;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================
   Helper classes for common styling needs.
*/

/* Screen reader only - visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
