/* Resume — a quieter, denser sibling of the homepage.
   Same tokens as styles.css; semantic single-column bones underneath
   so ATS parsers and AI tools read it cleanly. */

:root {
  --bg: #f2f2f7;
  --bubble: #e7e7ec;
  --text: #1c1c1e;
  --text-muted: #6b6b70;
  --link: #007aff;
  --radius-bubble: 22px;
  --gap: 1.25rem;
  --maxw: 680px;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bubble: #1f1f22;
  --text: #f2f2f7;
  --text-muted: #98989f;
  --link: #0a84ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000;
    --bubble: #1f1f22;
    --text: #f2f2f7;
    --text-muted: #98989f;
    --link: #0a84ff;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  padding: 48px 20px 80px;
}

.sheet {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ----- header ----- */

.resume-header {
  text-align: center;
  margin-bottom: 10px;
}

.resume-header__signature {
  display: block;
  margin: 0 auto 8px;
  opacity: 0.4;
}

.resume-header__name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

.resume-header__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.resume-header__contact {
  font-size: 14px;
  margin: 10px 0 0;
  color: var(--text-muted);
}

.dot-sep {
  margin: 0 6px;
  opacity: 0.6;
}

/* ----- bubbles ----- */

.bubble {
  background: var(--bubble);
  border-radius: var(--radius-bubble);
  padding: 18px 22px;
  transition: transform 420ms cubic-bezier(.34, 1.56, .64, 1), box-shadow 350ms ease;
}

.bubble:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px -18px rgba(0, 0, 0, 0.18),
    0 4px 10px -8px rgba(0, 0, 0, 0.12);
}

.bubble p {
  margin: 0;
}

.bubble p + p {
  margin-top: 8px;
}

.section-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* ----- experience timeline (borrowed from the homepage) ----- */

.bubble--timeline {
  background: #dcdce2;
}

:root[data-theme="dark"] .bubble--timeline {
  background: #161618;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .bubble--timeline {
    background: #161618;
  }
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.work {
  position: relative;
  padding: 0 0 18px 26px;
}

.work:last-child {
  padding-bottom: 2px;
}

.work::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: -2px;
  width: 2px;
  background: linear-gradient(#34c759, transparent);
  opacity: 0.4;
}

.work:last-child::before {
  display: none;
}

.work__dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.16);
}

:root[data-theme="dark"] .work__dot {
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .work__dot {
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
  }
}

.work__role {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.work__org {
  font-size: 14px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.work__sep {
  opacity: 0.6;
}

.work__period {
  font-variant-numeric: tabular-nums;
}

.work__bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
}

.work__bullets li {
  margin: 0 0 5px;
}

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

.work__early {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.work__early li {
  margin: 0 0 4px;
}

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

.work__early-role {
  color: var(--text);
  font-weight: 600;
}

/* ----- projects / skills / community ----- */

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}

.projects li {
  margin: 0 0 8px;
}

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

.proj-url {
  color: var(--text-muted);
  font-size: 13px;
}

.bubble .projects__more {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.skills-line {
  font-size: 15px;
}

.skills-line + .skills-line {
  margin-top: 8px;
}

/* Tools ride under each discipline as a quieter, secondary layer. */
.skills-tools {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ----- footer ----- */

.resume-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

.resume-footer p {
  margin: 0;
}

/* ----- todo markers — loud on screen so nothing placeholder ships ----- */

.todo {
  background: rgba(255, 204, 0, 0.25);
  border-radius: 4px;
  padding: 0 4px;
  color: inherit;
}

/* ----- page actions ----- */

.page-actions {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: var(--bubble);
  color: var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover { transform: scale(1.06); }
.theme-toggle:active { transform: scale(0.94); }

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.theme-toggle .icon {
  grid-area: 1 / 1;
  transition: opacity 200ms ease, transform 250ms ease;
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
  :root:not([data-theme]) .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
  }
}

.print-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  background: var(--bubble);
  color: var(--link);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.print-btn:hover { transform: scale(1.04); }
.print-btn:active { transform: scale(0.96); }

.print-btn:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  body {
    padding: 28px 14px 60px;
  }
  :root {
    --radius-bubble: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================================================
   PRINT — this is the resume that actually gets submitted.
   Strips the chrome, forces light, keeps the DOM order intact so the
   PDF's text layer reads top-to-bottom for ATS parsers.
   ===================================================================== */

@media print {
  /* Zero the page margin so the browser has no room to inject its own
     header (the <title>) and footer (the page URL); the real margins move
     onto the body below. */
  @page {
    size: letter;
    margin: 0;
  }

  :root,
  :root[data-theme="dark"] {
    --bg: #ffffff;
    --bubble: transparent;
    --text: #1c1c1e;
    --text-muted: #55555a;
    --link: #1c1c1e;
  }

  html, body {
    background: #ffffff;
    font-size: 10.5pt;
    line-height: 1.38;
  }

  body {
    padding: 0.55in 0.6in;
  }

  .page-actions {
    display: none;
  }

  .sheet {
    max-width: none;
    gap: 0;
  }

  .resume-header {
    margin-bottom: 14px;
  }

  .resume-header__signature {
    width: 34px;
    height: 31px;
    opacity: 0.55;
  }

  .resume-header__name {
    font-size: 19pt;
  }

  .resume-header__title {
    font-size: 10.5pt;
  }

  .resume-header__contact {
    font-size: 9.5pt;
  }

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

  .bubble {
    background: transparent;
    border-radius: 0;
    padding: 12px 0 0;
    transition: none;
  }

  .bubble:hover {
    transform: none;
    box-shadow: none;
  }

  .bubble--timeline {
    background: transparent;
    /* Bubble left padding is 0 in print, which leaves the timeline dots
       flush against the page margin and clips their left edge. Nudge the
       whole timeline inward so the dots clear it. */
    padding-left: 8px;
  }

  .section-heading {
    border-bottom: 1px solid #d4d4d8;
    padding-bottom: 4px;
    margin-bottom: 10px;
  }

  /* Keep the timeline spine — it prints nicely — but print-safe colors. */
  .work {
    padding-bottom: 11px;
    break-inside: avoid;
  }

  .work__dot {
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .work::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .work__role {
    font-size: 11pt;
  }

  .work__org {
    font-size: 9.5pt;
  }

  .work__bullets {
    font-size: 9.5pt;
    margin-top: 4px;
  }

  .work__bullets li {
    margin-bottom: 2px;
  }

  .projects,
  .skills-line {
    font-size: 9.5pt;
  }

  .skills-line + .skills-line {
    margin-top: 4px;
  }

  .skills-tools {
    font-size: 9pt;
  }

  .projects li {
    margin-bottom: 3px;
  }

  .bubble .projects__more {
    margin-top: 12px;
    font-size: 9.5pt;
  }

  .proj-url {
    font-size: 9pt;
  }

  /* Project links read as links in the PDF — colored and underlined,
     overriding the print-wide neutral anchor styling above. */
  a.proj-url {
    color: #0a6cff;
    text-decoration: underline;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .bubble p {
    font-size: 9.5pt;
  }

  /* Summary paragraph slightly larger for the lead-in. */
  .bubble[aria-labelledby="summary-heading"] p {
    font-size: 10pt;
  }

  .resume-footer {
    margin-top: 14px;
    font-size: 8.5pt;
  }

  /* If a TODO survives to print, make it impossible to miss. */
  .todo {
    background: #ffe58a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
