:root {
  --page-bg: #e9edf2;
  --surface: #d9e1e8;
  --accent: #1fa8c9;
  --heading: #1c4d63;
  --on-accent: #ffffff;
  --text: #1c2229;
  --muted: #5b6672;
  --border: #c3ccd4;
  --highlight: #ff7a3d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #12161b;
    --surface: #1c222a;
    --accent: #35d0ef;
    --heading: #7fd8ef;
    --on-accent: #0b1116;
    --text: #e4e9ee;
    --muted: #9aa5b1;
    --border: #333c46;
    --highlight: #ff9257;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.resume-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

@media (max-width: 420px) {
  .resume-page {
    padding: 2rem 1rem 3rem;
  }
}

/* --- Header --- */

.resume-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 480px) {
  .resume-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.headshot-icon-button {
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 96px;
  height: 96px;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--border);
}

.headshot-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.headshot-icon-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .headshot-icon-light {
    display: none;
  }

  .headshot-icon-dark {
    display: block;
  }
}

.resume-header-text {
  min-width: 0;
}

.resume-title {
  color: var(--heading);
  font-size: 2rem;
  margin: 0 0 0.25rem;
}

.resume-tagline {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.resume-contact {
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.resume-contact a,
.resume-download a {
  color: var(--heading);
  text-decoration: underline;
}

.resume-summary {
  color: var(--text);
  margin: 0 0 0.75rem;
}

.resume-download {
  margin: 0;
  font-size: 0.9rem;
}

/* --- Headshot modal --- */

.headshot-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 14, 18, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
}

.headshot-modal-overlay.is-hidden {
  display: none;
}

.headshot-modal {
  background-color: var(--surface);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  color: var(--text);
}

.headshot-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.headshot-modal-close:hover {
  color: var(--heading);
}

.headshot-modal-primary {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 0 auto 1rem;
}

.headshot-modal-secondary-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.headshot-modal-secondary {
  max-width: 120px;
  border-radius: 8px;
  flex-shrink: 0;
}

.headshot-modal-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* --- Resume entries (borderless \u2014 divider between entries, no box) --- */

.resume-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.resume-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.resume-entry:first-child {
  padding-top: 0;
}

.resume-entry:last-child {
  border-bottom: none;
}

.resume-entry-education {
  color: var(--muted);
}

.resume-entry-title-block {
  min-width: 0;
  margin-bottom: 0.5rem;
}

.resume-entry-role {
  margin: 0 0 0.15rem;
  font-size: 1.1rem;
  color: var(--heading);
}

.resume-entry-employer {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.resume-entry-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
  margin-bottom: 0.75rem;
}

.tag-chip {
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* The "boring grey" tags stay hidden on a collapsed entry \u2014 they're
   not the interesting part of the tag list at a glance \u2014 and only
   reveal once "Read more" is clicked (mirrors the portfolio's
   collapsed-header tag treatment). */
.tag-chip-collapsed-hidden {
  display: none;
}

.resume-entry.is-expanded .tag-chip-collapsed-hidden {
  display: inline-block;
}

.resume-entry-blurb {
  margin: 0;
  color: var(--text);
}

.resume-entry-expanded {
  display: none;
  margin: 0.75rem 0 0;
  color: var(--text);
}

.resume-entry.is-expanded .resume-entry-expanded {
  display: block;
}

.resume-entry-toggle {
  display: inline-block;
  margin-top: 0.6rem;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.resume-entry-toggle:hover {
  color: var(--heading);
}

/* --- Timeline rail --- */

.timeline-mount {
  min-width: 0;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 1.1rem 1rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.2rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--highlight);
}

.timeline-link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}

.timeline-link:hover {
  color: var(--heading);
  text-decoration: underline;
}

/* --- Page layout (three zones) --- */

.resume-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

@media (min-width: 701px) {
  .resume-layout {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 280px;
    column-gap: 2rem;
    align-items: start;
  }
}

.resume-sidebar {
  min-width: 0;
}

/* --- Tag filter sidebar (same mechanic as the portfolio's) --- */

.tag-filter {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tag-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag-filter-group-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.tag-filter-group-heading {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tag-legend-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.tag-legend-toggle:hover {
  color: var(--heading);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud-chip {
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
  background-color: var(--accent);
  color: var(--on-accent);
}

.tag-cloud-chip.is-active {
  box-shadow: 0 0 0 2px var(--heading);
}

.tag-cloud-chip.is-muted {
  opacity: 0.3;
}

.tag-legend {
  margin: 0;
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.82rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.tag-legend.is-visible {
  display: flex;
}

.tag-legend-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  border-radius: 4px;
  padding: 0.25rem 0.3rem;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.tag-legend-row:hover {
  background-color: var(--page-bg);
}

.tag-legend-row.is-active {
  background-color: var(--page-bg);
  box-shadow: inset 2px 0 0 var(--heading);
}

.tag-legend-row.is-muted {
  display: none;
}

.tag-legend-term {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--heading);
}

.tag-legend-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-legend-description {
  margin: 0 0 0 1.1rem;
  color: var(--muted);
}

/* --- Mobile: timeline stays as a narrow left column beside the entry
   list (explicit requirement \u2014 does NOT stack above/below like the
   sidebar does). Sidebar still stacks below on narrow screens. --- */

@media (max-width: 700px) {
  .resume-layout {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "timeline main"
      "sidebar sidebar";
    column-gap: 1rem;
    row-gap: 1.5rem;
    align-items: start;
  }

  .timeline-mount {
    grid-area: timeline;
  }

  .resume-list {
    grid-area: main;
  }

  .resume-sidebar {
    grid-area: sidebar;
  }

  .timeline-link {
    font-size: 0.72rem;
  }

  .timeline-item {
    padding-left: 0.75rem;
  }
}

/* --- Narrow phone tightening --- */

@media (max-width: 420px) {
  .headshot-icon-button {
    width: 72px;
    height: 72px;
  }
}
