:root {
  --canvas: #faf9f5;
  --surface: #f5f0e8;
  --surface-strong: #efe9de;
  --ink: #141413;
  --body: #3d3d3a;
  --muted: #6c6a64;
  --accent: #cc785c;
  --accent-active: #a9583e;
  --hairline: #e6dfd8;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 16px/1.75 var(--sans);
  letter-spacing: 0.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p {
  margin-block: 0 1em;
  text-wrap: pretty;
}

ul,
ol {
  overflow-wrap: anywhere;
}

a {
  color: var(--accent-active);
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

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

a:active {
  color: var(--accent-active);
}

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

strong {
  color: var(--ink);
  font-weight: 600;
}

.blog-page {
  min-height: 100svh;
}

.social-home {
  display: flex;
  min-height: 100svh;
  padding: 24px;
  align-items: center;
  justify-content: center;
}

.social-links {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.social-link {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.social-link svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.social-link:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent-active);
  transform: translateY(-3px);
}

.social-link:active {
  transform: translateY(-1px);
}

.social-link:focus-visible {
  border-color: var(--accent);
  border-radius: 50%;
}

@media (max-width: 420px) {
  .social-home {
    padding-inline: 12px;
  }

  .social-links {
    gap: 10px;
  }

  .social-link {
    width: 48px;
    height: 48px;
  }

  .social-link svg {
    width: 19px;
    height: 19px;
  }
}

.resume-shell {
  width: min(calc(100% - 64px), 960px);
  max-width: 960px;
  margin: 0 auto;
  padding: 88px 0 120px;
}

.resume-header {
  position: relative;
  display: flex;
  min-height: 52vh;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--hairline);
  animation: enter 650ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.resume-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: clamp(72px, 14vw, 136px);
  height: 3px;
  background: var(--accent);
  content: "";
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--accent-active);
  font: 600 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--serif);
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(56px, 10vw, 112px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.role {
  margin: 24px 0 36px;
  color: var(--ink);
  font-size: clamp(18px, 2.5vw, 26px);
  line-height: 1.45;
}

.role span {
  padding-inline: 0.22em;
  color: var(--accent);
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
  font-style: normal;
}

.contact-list a {
  font-size: 14px;
}

.resume-section {
  padding-top: 88px;
  scroll-margin-top: 24px;
}

.compact-section {
  padding-top: 64px;
}

.section-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.section-heading span {
  color: var(--accent-active);
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.skill-list,
.open-source-list {
  margin: 0;
  padding-left: 1.25em;
}

.skill-list li,
.open-source-list li {
  padding-left: 0.35em;
}

.skill-list li::marker,
.open-source-list li::marker {
  color: var(--accent);
}

.skill-list li + li,
.open-source-list li + li {
  margin-top: 12px;
}

.date-range {
  color: var(--muted);
  font: 500 13px/1.6 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#education > p {
  margin-bottom: 0;
  font-size: 18px;
}

.timeline-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.timeline-list > li {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--hairline);
}

.timeline-list p {
  margin: 0;
}

.project-list {
  display: grid;
  gap: 76px;
  counter-reset: project;
}

.project-entry {
  position: relative;
  min-width: 0;
  padding-left: 54px;
  scroll-margin-top: 24px;
  counter-increment: project;
}

.project-entry::before {
  position: absolute;
  top: 0.76em;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.project-entry::after {
  position: absolute;
  top: 2.1em;
  left: 0;
  color: var(--muted);
  content: "0" counter(project);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
}

.project-entry h3 {
  margin: 0 0 14px;
  font-size: clamp(25px, 4vw, 36px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.project-entry > p:not(.project-meta) {
  max-width: 54em;
}

.project-entry h4 {
  margin: 28px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.tech {
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 12px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.responsibilities {
  margin: 24px 0 0;
  padding-left: 1.4em;
}

.responsibilities li {
  padding-left: 0.45em;
}

.responsibilities li::marker {
  color: var(--accent-active);
  font: 600 12px var(--mono);
}

.responsibilities li + li {
  margin-top: 16px;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (max-width: 640px) {
  .resume-shell {
    width: min(calc(100% - 36px), 960px);
    padding: 56px 0 80px;
  }

  .resume-header {
    min-height: auto;
    padding: 44px 0 52px;
  }

  .resume-header::after {
    width: 64px;
  }

  h1 {
    font-size: clamp(50px, 18vw, 72px);
  }

  .role {
    margin: 20px 0 28px;
  }

  .contact-list {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .contact-list a {
    max-width: 100%;
  }

  .resume-section,
  .compact-section {
    padding-top: 56px;
  }

  .section-heading {
    grid-template-columns: 38px minmax(0, 1fr);
    margin-bottom: 24px;
  }

  .timeline-list > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 20px 0;
  }

  .project-list {
    gap: 56px;
  }

  .project-entry {
    padding-left: 0;
    padding-top: 24px;
  }

  .project-entry::before {
    top: 0;
    width: 28px;
  }

  .project-entry::after {
    top: 0;
    left: 38px;
  }

  .project-meta {
    gap: 6px;
  }

  .responsibilities {
    padding-left: 1.25em;
  }
}

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

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

@media print {
  @page {
    size: A4;
    margin: 16mm 15mm 18mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    line-height: 1.55;
  }

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

  .resume-header {
    min-height: auto;
    padding: 0 0 14mm;
    border-bottom-color: #bbb;
    animation: none;
  }

  .resume-header::after {
    display: none;
  }

  h1 {
    font-size: 34pt;
    letter-spacing: -0.04em;
  }

  .role {
    margin: 4mm 0 5mm;
    font-size: 16pt;
  }

  .contact-list {
    gap: 2mm 6mm;
  }

  .contact-list a {
    font-size: 10pt;
  }

  .resume-section,
  .compact-section {
    padding-top: 10mm;
  }

  .section-heading {
    margin-bottom: 6mm;
    padding-bottom: 3mm;
    border-bottom-color: #bbb;
  }

  .section-heading h2 {
    font-size: 24pt;
  }

  .project-list {
    gap: 10mm;
  }

  .project-entry {
    padding-left: 10mm;
  }

  .project-entry::before {
    width: 6mm;
    background: #777;
  }

  .project-entry::after {
    color: #555;
  }

  .project-entry h3 {
    font-size: 18pt;
  }

  .timeline-list > li {
    break-inside: avoid;
  }

  .section-heading,
  h2,
  h3,
  h4 {
    break-after: avoid;
  }

  .project-entry h3 {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .tech {
    border-color: #bbb;
    background: transparent;
  }
}
