/* ================================================================
   Senior Engineer Resume — Clean, Architectural Design

   Visual direction: Technical precision and clarity
   Palette: Deep charcoal with muted teal accent
   Typography: System fonts with strong hierarchy
   ================================================================ */

:root {
  /* Color palette */
  --ink: #1a1a1a;
  --ink-muted: #52555a;
  --ink-subtle: #6b6e73;
  --bg: #ffffff;
  --surface: #f8f9fa;
  --rule: #e0e2e5;
  --accent: #2d7a7a;
  --accent-hover: #246262;
  --accent-ink: #ffffff;

  /* Spacing scale (4px base) */
  --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;
  --space-16: 4rem;

  /* Typography scale */
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Measure for body text */
  --measure: 65ch;

  scrollbar-color: var(--rule) transparent;
  caret-color: var(--accent);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed;
    --ink-muted: #a0a4ab;
    --ink-subtle: #71757d;
    --bg: #0f1419;
    --surface: #1a1f26;
    --rule: #2d333d;
    --accent: #4fa8a8;
    --accent-hover: #6bbfbf;
    --accent-ink: #0a0d10;
  }
}

/* ================================================================
   Base Styles
   ================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  font-size: var(--text-base);
}

p {
  text-wrap: pretty;
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

ul {
  margin: 0;
  padding: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease-out;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

/* ================================================================
   Resume Layout
   ================================================================ */

.resume {
  max-width: 52rem;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

@media (max-width: 48rem) {
  .resume {
    padding: var(--space-8) var(--space-4);
  }
}

/* ================================================================
   Header
   ================================================================ */

.resume-header {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--accent);
}

.header-content {
  margin-bottom: var(--space-4);
}

.name {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
  color: var(--ink);
}

.title {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  align-items: center;
  max-width: var(--measure);
}

.contact-link {
  color: var(--accent);
  transition: color 0.15s ease-out;
}

.contact-link:hover {
  color: var(--accent-hover);
}

.separator {
  color: var(--rule);
}

.location {
  color: var(--ink-muted);
}

@media (max-width: 48rem) {
  .name {
    font-size: var(--text-4xl);
  }

  .title {
    font-size: var(--text-lg);
  }
}

/* ================================================================
   Summary
   ================================================================ */

.summary {
  margin-bottom: var(--space-10);
  padding: var(--space-6);
  background: var(--surface);
  border-radius: 4px;
}

.summary-text {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--ink);
  max-width: var(--measure);
}

/* ================================================================
   Sections
   ================================================================ */

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

.section-heading {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

/* ================================================================
   Experience
   ================================================================ */

.experience-item {
  margin-bottom: var(--space-8);
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  align-items: start;
}

.experience-title-group {
  min-width: 0;
}

.experience-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.company {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--accent);
  margin: 0;
}

.experience-meta {
  text-align: right;
  flex-shrink: 0;
}

.date-range {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-1);
}

.location-meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-subtle);
}

.accomplishments {
  list-style: none;
  padding: 0;
  margin: 0;
}

.accomplishments li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
  line-height: 1.65;
  color: var(--ink);
  max-width: var(--measure);
}

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

.accomplishments li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 48rem) {
  .experience-header {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .experience-meta {
    text-align: left;
  }

  .date-range,
  .location-meta {
    display: inline;
  }

  .date-range::after {
    content: " · ";
    color: var(--rule);
  }
}

/* ================================================================
   Technical Skills
   ================================================================ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-6);
}

.skill-category {
  min-width: 0;
}

.skill-category-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}

.skill-list {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--ink);
  max-width: var(--measure);
}

@media (max-width: 48rem) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ================================================================
   Projects
   ================================================================ */

.project-item {
  margin-bottom: var(--space-6);
}

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

.project-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.project-description {
  line-height: 1.65;
  color: var(--ink);
  max-width: var(--measure);
}

/* ================================================================
   Education
   ================================================================ */

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

.education-item:last-child {
  margin-bottom: 0;
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.degree {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
  max-width: var(--measure);
}

.institution {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--accent);
  margin: 0;
}

.education-detail {
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: var(--measure);
}

@media (max-width: 48rem) {
  .education-header {
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* ================================================================
   Certifications
   ================================================================ */

.certifications-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.certification-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
  max-width: var(--measure);
}

.certification-item:last-child {
  border-bottom: none;
}

.certification-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink);
  max-width: var(--measure);
}

.certification-year {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

@media (max-width: 48rem) {
  .certification-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
}

/* ================================================================
   Print Styles
   ================================================================ */

@media print {
  :root {
    --ink: #000000;
    --ink-muted: #404040;
    --ink-subtle: #666666;
    --bg: #ffffff;
    --surface: #f8f9fa;
    --rule: #cccccc;
    --accent: #1a1a1a;
    --accent-hover: #1a1a1a;
    --accent-ink: #ffffff;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .resume {
    max-width: none;
    padding: 0;
  }

  .resume-header {
    break-after: avoid;
  }

  .summary {
    background: transparent;
    border: 1px solid var(--rule);
    break-after: avoid;
  }

  .section {
    break-inside: avoid;
  }

  .section-heading {
    break-after: avoid;
  }

  .experience-item,
  .project-item,
  .education-item {
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: var(--text-xs);
    color: var(--ink-subtle);
  }

  a[href^="mailto"]::after,
  a[href^="tel"]::after {
    content: "";
  }
}

/* ================================================================
   Motion (reduced motion respected)
   ================================================================ */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .contact-link {
    transition: color 0.15s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 480px) {
  /* --impeccable-mobile-pad */
  body { padding-inline: max(1rem, 16px); }
  .container, [class*="container"], section, header, footer, nav, main, article {
    padding-inline: max(1rem, 16px);
  }
}
