/* =========================================================
   Design Tokens
   ========================================================= */
:root {
  --color-bg: #F7F5F0;
  --color-surface: #FFFFFF;
  --color-text: #1B1F24;
  --color-text-muted: #4B5563;
  --color-text-subtle: #5C6473; /* darkened from #6B7280 to meet WCAG AA 4.5:1 on --color-bg */
  --color-primary: #0F766E;
  --color-primary-hover: #0D9488;
  --color-accent: #B45309;
  --color-border: #E5E0D4;
  --color-border-strong: #C4B8A5;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  --space-container: 1.25rem;
  --space-section-gap: 2.5rem;
  --max-width: 48rem;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
}

/* =========================================================
   Skip Link
   ========================================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-surface);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* =========================================================
   Links
   ========================================================= */
a {
  color: var(--color-primary);
  text-decoration: none;
}

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

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

/* =========================================================
   Layout
   ========================================================= */
.page-wrapper {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-container);
  padding-block: 2rem 3rem;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  padding-block-end: var(--space-section-gap);
  border-bottom: 1px solid var(--color-border);
  margin-block-end: var(--space-section-gap);
}

.site-header__name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-block-end: 0.25rem;
}

.site-header__title {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-block-end: 1.25rem;
}

/* =========================================================
   Contact List
   ========================================================= */
.contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.contact__item {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.contact__item a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.contact__sep {
  display: none;
}

/* =========================================================
   Main Content
   ========================================================= */
main {
  display: flex;
  flex-direction: column;
  gap: var(--space-section-gap);
}

/* =========================================================
   Sections
   ========================================================= */
.resume-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resume-section__heading {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--color-text);
  padding-block-end: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

/* =========================================================
   Bio
   ========================================================= */
.bio {
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.75;
}

/* =========================================================
   Work Experience / Timeline
   ========================================================= */
.jobs {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}

.jobs::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--color-border);
}

.job {
  position: relative;
  padding-left: 1.5rem;
  break-inside: avoid;
}

.job::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.job__title {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin-block-end: 0.2rem;
}

.job__meta {
  font-size: 0.9375rem;
  color: var(--color-text-subtle);
  margin-block-end: 0.75rem;
}

.job__meta strong {
  color: var(--color-text-muted);
  font-weight: 500;
}

.job__description {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-block-end: 0.625rem;
  font-style: italic;
}

.job__bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-block-end: 0.75rem;
}

.job__bullets li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
}

.job__bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-text-subtle);
}

.job__tech {
  font-size: 0.875rem;
  color: var(--color-text-subtle);
}

.job__tech-label {
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-right: 0.25rem;
}

/* =========================================================
   Projects
   ========================================================= */
.projects {
  display: flex;
  flex-direction: column;
}

.project {
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--color-border);
  break-inside: avoid;
}

.project:first-child {
  padding-block-start: 0;
}

.project:last-child {
  border-bottom: none;
  padding-block-end: 0;
}

.project__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem 0.625rem;
  margin-block-end: 0.375rem;
}

.project__title {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
}

.project__title a {
  color: var(--color-text);
}

.project__title a:hover {
  color: var(--color-primary-hover);
}

.project__date {
  font-size: 0.875rem;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.project__desc {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* =========================================================
   Skills
   ========================================================= */
.skills {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skills__row {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  align-items: baseline;
}

.skills__category {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.skills__items {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* =========================================================
   Education
   ========================================================= */
.education {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.edu-entry__institution {
  font-weight: 600;
  color: var(--color-text);
}

.edu-entry__degree {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-block-start: 0.125rem;
}

.edu-entry__year {
  font-size: 0.875rem;
  color: var(--color-text-subtle);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-block-start: 3rem;
  padding-block-start: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  text-align: center;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* =========================================================
   Tablet (≥ 40rem / 640px)
   ========================================================= */
@media (min-width: 40rem) {
  :root {
    --space-container: 2rem;
  }

  .contact {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
  }

  .contact__item {
    min-height: auto;
  }

  .contact__sep {
    display: inline;
    margin-inline: 0.5rem;
    color: var(--color-border-strong);
    aria-hidden: true;
    user-select: none;
  }

  .site-header__title {
    font-size: 1.25rem;
  }
}

/* =========================================================
   Desktop (≥ 64rem / 1024px)
   ========================================================= */
@media (min-width: 64rem) {
  :root {
    --space-section-gap: 3.5rem;
  }

  body {
    font-size: 1.0625rem;
  }

  .site-header__name {
    font-size: 2.5rem;
  }

  .resume-section__heading {
    font-size: 1.625rem;
  }

  .job__title {
    font-size: 1.125rem;
  }

  .page-wrapper {
    padding-block: 3rem 4rem;
  }
}

/* =========================================================
   Reduced Motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .skip-link {
    transition: none;
  }
}

/* =========================================================
   Print
   ========================================================= */
@media print {
  @page {
    margin: 12mm;
  }

  :root {
    --color-bg: #fff;
    --color-surface: #fff;
    --color-text: #111;
    --color-text-muted: #333;
    --color-text-subtle: #555;
    --color-border: #ccc;
    --color-primary: #0a5c56;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 9.5pt;
    line-height: 1.5;
  }

  .skip-link,
  .site-footer {
    display: none;
  }

  .page-wrapper {
    max-width: 100%;
    padding: 0;
  }

  .site-header {
    border-bottom-color: #999;
  }

  h2 {
    break-after: avoid;
  }

  .job,
  .project {
    break-inside: avoid;
  }

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

  a[href^="http"]::after,
  a[href^="https"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  .jobs::before {
    display: none;
  }

  .job::before {
    display: none;
  }

  .job {
    padding-left: 0;
  }
}
