:root {
  color-scheme: light;
  --bg-color: #fcfcfb;
  --bg-color-translucent: rgba(252, 252, 251, 0.9);
  --surface-subtle: #f4f4f1;
  --text-main: #171717;
  --text-muted: #2f2f2f;
  --text-light: #5e5e5a;
  --text-meta: #6b6b66;
  --highlight-color: #171717;
  --link-color: #0f5ea8;
  --link-hover: #0a4073;
  --border-color: #e7e7e1;
  --theme-toggle-bg: #f1f3f4;
  --theme-toggle-hover: #e4e8eb;
  --theme-toggle-text: #1f2933;
  --theme-toggle-border: rgba(31, 41, 51, 0.12);
  --control-border: rgba(23, 23, 23, 0.1);
  --download-btn-bg: #c43a3a;
  --download-btn-hover: #a92f2f;
  --selection-bg: rgba(15, 94, 168, 0.2);
  --selection-text: #111;
}

html.dark-theme {
  color-scheme: dark;
  --bg-color: #1b1f1d;
  --bg-color-translucent: rgba(27, 31, 29, 0.9);
  --surface-subtle: #252b27;
  --text-main: #d2d7d1;
  --text-muted: #b6beb7;
  --text-light: #98a198;
  --text-meta: #8f9990;
  --highlight-color: #dde3dc;
  --link-color: #7fb0e6;
  --link-hover: #a4c9f0;
  --border-color: #2d342f;
  --theme-toggle-bg: #2b3230;
  --theme-toggle-hover: #35403c;
  --theme-toggle-text: #dbe5df;
  --theme-toggle-border: rgba(219, 229, 223, 0.12);
  --control-border: rgba(216, 221, 215, 0.1);
  --download-btn-bg: #8e4a4a;
  --download-btn-hover: #a25757;
  --selection-bg: rgba(158, 181, 167, 0.18);
  --selection-text: #eef2ed;
}

html {
  scroll-padding-top: calc(var(--header-height, 140px) + 40px);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  max-width: 860px;
  width: 100%;
  margin: auto;
  padding: 42px 32px;
  color: var(--text-main);
  background: var(--bg-color);
  line-height: 1.55;
}

.skip-link,
.sr-only {
  position: absolute;
}

.skip-link {
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text-main);
  color: var(--bg-color);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.sr-only {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1.15px;
  text-underline-offset: 2px;
  transition: color 0.15s ease-in-out, text-decoration-color 0.15s ease-in-out;
}

a:hover {
  color: var(--link-hover);
}

html:not(.dark-theme) a {
  text-decoration-color: rgba(15, 94, 168, 0.35);
}

html:not(.dark-theme) a:hover {
  text-decoration-color: rgba(10, 64, 115, 0.55);
}

html.dark-theme a {
  text-decoration-color: rgba(127, 176, 230, 0.5);
}

html.dark-theme a:hover {
  text-decoration-color: rgba(164, 201, 240, 0.7);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.header {
  margin-bottom: 22px;
  text-align: left;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background-color: var(--bg-color-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  padding-top: 24px;
  margin-top: -24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

h1 {
  font-size: 30px;
  margin: 0;
  letter-spacing: -0.6px;
  text-wrap: balance;
}

.role {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-light);
  margin-top: 4px;
  margin-bottom: 0;
}

.availability-container {
  margin: 6px 0 14px 0;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
  background-color: #d1fae5;
  border: 1px solid #10b981;
  padding: 4px 10px;
  border-radius: 6px;
}

html.dark-theme .availability-badge {
  color: #a7f3d0;
  background-color: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
}

.availability-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
}

.availability-dot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #10b981;
  will-change: transform, opacity;
  animation: availability-pulse 2.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes availability-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.contact {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.6;
  font-style: normal;
}

.contact-row {
  display: block;
}

.contact-item {
  white-space: nowrap;
}

.contact-item a {
  overflow-wrap: anywhere;
}

.contact-sep {
  color: var(--text-meta);
}

.contact a {
  font-size: inherit;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.theme-toggle-btn,
.download-btn {
  border: 1px solid var(--control-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  padding: 0 10px;
  height: 32px;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.theme-toggle-btn {
  background-color: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  border-color: var(--theme-toggle-border);
}

.download-btn {
  background-color: var(--download-btn-bg);
  color: #fff;
}

.theme-toggle-btn:hover {
  background-color: var(--theme-toggle-hover);
  border-color: var(--theme-toggle-hover);
}

.download-btn:hover {
  background-color: var(--download-btn-hover);
  border-color: var(--download-btn-hover);
  color: #fff;
}

.icon-sun {
  display: none;
}

html.dark-theme .icon-sun {
  display: block;
}

html.dark-theme .icon-moon {
  display: none;
}

.theme-text-dark {
  display: none;
}

html.dark-theme .theme-text-dark {
  display: block;
}

html.dark-theme .theme-text-light {
  display: none;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-meta);
  padding: 4px;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.copy-btn:hover {
  background-color: var(--surface-subtle);
  color: var(--text-main);
}

.copy-btn:disabled {
  cursor: default;
}

.copy-success {
  color: #10b981 !important;
}

.copy-helper-input {
  position: fixed;
  top: -1000px;
  left: -1000px;
  opacity: 0;
  pointer-events: none;
}

.section {
  margin-top: 22px;
}

.section-heading {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--header-height, 140px) - 1px);
  background-color: var(--bg-color-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 95;
  padding-top: 12px;
  margin-top: -12px;
  padding-bottom: 10px;
  transition: background-color 0.3s ease;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 8px;
  text-wrap: balance;
}

.section-line {
  border: none;
  border-top: 1px solid var(--border-color);
  margin-bottom: 0;
}

p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  text-wrap: pretty;
}

.job {
  margin-bottom: 14px;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

.title {
  flex: 1 1 420px;
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.meta {
  font-size: 13px;
  color: var(--text-light);
  overflow-wrap: anywhere;
}

.sub-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

ul {
  margin-top: 6px;
  padding-left: 18px;
  list-style-type: none;
}

li {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  position: relative;
  padding-left: 10px;
  text-wrap: pretty;
}

li::before {
  content: "•";
  position: absolute;
  left: 0;
}

.highlight {
  color: var(--highlight-color);
  font-weight: 550;
}

a .highlight {
  color: inherit;
}

html.dark-theme .highlight {
  font-weight: 500;
}

.font-regular {
  font-weight: 400;
}

.skills-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  align-items: baseline;
}

.skills-grid .highlight {
  color: var(--text-main);
}

.resume-footer {
  text-align: center;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}

.resume-footer p {
  font-size: 12px;
  color: var(--text-meta);
}

@media (max-width: 900px) {
  body {
    padding: 32px 24px;
  }

  .contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
  }

  .contact-row + .contact-row {
    margin-top: 2px;
  }

  .job-header {
    gap: 6px 12px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 24px 16px;
  }

  h1 {
    font-size: 26px;
  }

  .role,
  .contact,
  p,
  li,
  .section-title,
  .title,
  .meta {
    font-size: 14px;
  }

  .job-header {
    display: block;
  }

  .title {
    font-size: 14px;
  }

  .contact-row {
    display: block;
  }

  .contact-item {
    display: block;
    white-space: normal;
  }

  .contact-item + .contact-item {
    margin-top: 2px;
  }

  .contact-sep {
    display: none;
  }

  .meta {
    margin-top: 2px;
  }

  .sub-meta-row {
    display: block;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .skills-grid .highlight:not(:first-child) {
    margin-top: 8px;
  }

  .header {
    margin-top: -16px;
    padding-top: 16px;
  }

  ul {
    padding-left: 16px;
  }

  .theme-text-light,
  .theme-text-dark,
  .download-btn .btn-text {
    display: none !important;
  }

  .theme-toggle-btn,
  .download-btn {
    padding: 0;
    width: 36px;
    height: 36px;
    gap: 0;
  }

  .copy-btn {
    min-width: 28px;
    min-height: 28px;
  }
}

@media (max-width: 420px) {
  body {
    padding: 18px 12px;
    line-height: 1.5;
  }

  h1 {
    font-size: 24px;
    letter-spacing: -0.4px;
  }

  .contact,
  p,
  li,
  .section-title,
  .title,
  .meta {
    font-size: 13px;
  }

  .role {
    font-size: 13px;
  }

  .section {
    margin-top: 18px;
  }

  .header {
    margin-top: -12px;
    padding-top: 12px;
    margin-bottom: 10px;
  }

  ul {
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@page {
  size: A4;
  margin: 0.5in;
}

@media print {
  :root,
  html.dark-theme {
    color-scheme: light !important;
    --bg-color: #fff !important;
    --text-main: #000 !important;
    --text-muted: #000 !important;
    --text-light: #000 !important;
    --text-meta: #000 !important;
    --highlight-color: #000 !important;
    --link-color: #000 !important;
    --border-color: #ccc !important;
  }

  html,
  body {
    max-width: none;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background: #fff !important;
    font-size: 11.5px;
    line-height: 1.28;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .download-btn,
  .theme-toggle-btn,
  .copy-btn,
  .print-hidden {
    display: none !important;
  }

  body {
    width: 100%;
  }

  h1 {
    font-size: 22px;
  }

  .role,
  .contact,
  p,
  li,
  .section-title,
  .title,
  .meta {
    font-size: 11.5px;
  }

  .header {
    margin-bottom: 12px;
    position: static !important;
    padding: 0 !important;
    margin-top: 0 !important;
    border-bottom: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .section {
    margin-top: 12px;
    break-inside: auto;
  }

  .section-heading {
    position: static !important;
    padding: 0 !important;
    margin-top: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .section-title {
    margin-bottom: 4px;
    break-after: avoid;
  }

  .section-line {
    margin-bottom: 6px;
  }

  .job {
    margin-bottom: 8px;
    break-inside: auto;
  }

  .job-header {
    break-inside: avoid;
  }

  .sub-meta-row {
    margin-bottom: 2px;
  }

  ul {
    margin-top: 2px;
    margin-bottom: 0;
    padding-left: 14px;
  }

  li {
    margin-bottom: 3px;
    break-inside: avoid;
  }

  .meta {
    margin-bottom: 2px;
    line-height: 1.25;
  }

  .contact a,
  a {
    color: var(--text-main);
    text-decoration: none;
  }

  main a[href^="http"]::after {
    content: none !important;
  }

  .contact a::after {
    content: "";
  }

  .contact-row {
    display: block;
  }

  .contact-sep {
    display: none;
  }

  .contact-item {
    white-space: normal;
  }

  .resume-footer {
    display: none !important;
  }

  html.dark-theme .highlight {
    font-weight: 550;
  }
}
