@font-face {
  font-family: "Tsanger JinKai";
  src: url("./assets/fonts/TsangerJinKai02-W05.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: oklch(91% 0.014 88);
  --paper: oklch(98.4% 0.011 88);
  --ink: oklch(24% 0.018 255);
  --ink-soft: oklch(42% 0.018 255);
  --muted: oklch(56% 0.014 255);
  --hairline: oklch(84% 0.012 88);
  --accent: oklch(34% 0.09 255);
  --accent-strong: oklch(27% 0.085 255);
  --accent-soft: oklch(93.5% 0.028 255);
  --mark: oklch(90% 0.08 87);
  --shadow: 0 28px 70px color-mix(in oklch, var(--accent-strong) 15%, transparent),
    0 2px 8px rgb(20 28 40 / 9%);
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-sheet: 2px;
  --page-pad-inline: 12mm;
  --page-pad-block: 10mm;
  --section-gap: 4mm;
  font-family: "Tsanger JinKai", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 18px max(18px, env(safe-area-inset-right)) 56px max(18px, env(safe-area-inset-left));
  color: var(--ink);
  background: var(--canvas);
  font-size: 12.2px;
  line-height: 1.5;
  touch-action: manipulation;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklch, currentColor 38%, transparent);
  text-underline-offset: 0.18em;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  color: var(--paper);
  background: var(--accent-strong);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}

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

.resume-sheet {
  position: relative;
  width: min(210mm, 100%);
  min-height: 297mm;
  margin: 0 auto;
  padding: var(--page-pad-block) var(--page-pad-inline) 9mm;
  overflow: hidden;
  background: var(--paper);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow);
}

.sheet-register {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4mm;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "identity"
    "contact";
  gap: 2.7mm;
  padding-bottom: 4mm;
  border-bottom: 2px solid var(--accent);
}

.hero__identity {
  grid-area: identity;
}

.eyebrow {
  margin: 0 0 1mm;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.6mm;
  color: var(--accent-strong);
  font-size: clamp(35px, 6vw, 47px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.92;
}

.hero__role {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  margin-bottom: 0;
  font-size: 13.4px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: balance;
}

.hero__role span {
  color: var(--accent);
}

.contact-list {
  display: flex;
  grid-area: contact;
  flex-wrap: wrap;
  gap: 1mm 3mm;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-style: normal;
}

.contact-list a,
.contact-list span {
  position: relative;
}

.contact-list a:not(:last-child)::after,
.contact-list span::after {
  position: absolute;
  right: -1.8mm;
  color: var(--hairline);
  content: "·";
}

.resume-section {
  margin-top: var(--section-gap);
}

.section-heading {
  display: grid;
  grid-template-columns: 7mm auto 1fr auto;
  align-items: center;
  gap: 2.2mm;
  margin-bottom: 1.8mm;
}

.section-heading::after {
  grid-column: 3;
  height: 1px;
  background: var(--hairline);
  content: "";
}

.section-heading__index {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.section-heading h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1;
  white-space: nowrap;
}

.section-heading__aside {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.summary {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.58;
  text-wrap: pretty;
}

.career-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4mm;
  padding: 2mm 0 2.5mm 9.2mm;
}

.career-step {
  position: relative;
}

.career-step::before {
  position: absolute;
  top: 2px;
  left: -3.6mm;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
  content: "";
}

.career-step__year {
  margin-bottom: 0.5mm;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.career-step h3 {
  margin-bottom: 0.4mm;
  font-size: 11.5px;
  font-weight: 500;
}

.career-step p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-wrap: pretty;
}

.experience,
.project {
  break-inside: avoid;
  border-top: 1px solid var(--hairline);
}

.experience {
  padding: 1.8mm 0 1.6mm 9.2mm;
}

.experience header {
  display: flex;
  align-items: baseline;
  gap: 2mm;
  margin-bottom: 0.6mm;
}

.experience h3,
.project h3,
.education h3,
.skill h3 {
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 500;
}

.experience__role {
  margin: 0;
  color: var(--accent);
  font-size: 10.2px;
  font-weight: 500;
}

.experience time,
.education time {
  margin-left: auto;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.experience > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.8px;
  line-height: 1.44;
  text-wrap: pretty;
}

.project {
  padding: 2mm 0 1.8mm;
}

.project:first-child {
  border-top-color: var(--accent);
}

.project__header {
  display: flex;
  align-items: baseline;
  gap: 1.7mm;
  margin-bottom: 1mm;
}

.project__kind {
  color: var(--muted);
  font-size: 10px;
}

.project__kind::before {
  margin-right: 1.7mm;
  color: var(--hairline);
  content: "/";
}

.project__role {
  margin-left: auto;
  padding: 0.35mm 1.4mm;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.project__facts {
  display: grid;
  gap: 0.35mm;
  margin: 0;
}

.project__fact {
  display: grid;
  grid-template-columns: 9mm 1fr;
  gap: 1mm;
}

.project__fact dt {
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
}

.project__fact dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.6px;
  line-height: 1.42;
  text-wrap: pretty;
}

code {
  padding: 0 2px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 2px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

mark {
  padding: 0 2px;
  color: var(--accent-strong);
  background: linear-gradient(transparent 35%, var(--mark) 35% 94%, transparent 94%);
  font-weight: 700;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 5mm;
  border-top: 1px solid var(--accent);
}

.skill {
  display: grid;
  grid-template-columns: 25mm 1fr;
  gap: 2mm;
  padding: 1.7mm 0;
  border-bottom: 1px dotted var(--hairline);
  break-inside: avoid;
}

.skill h3 {
  color: var(--accent);
  font-size: 10.4px;
  line-height: 1.35;
}

.skill p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.4px;
  line-height: 1.4;
  text-wrap: pretty;
}

.closing-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 7mm;
}

.education {
  display: flex;
  align-items: baseline;
  gap: 2mm;
  padding-top: 1.8mm;
  border-top: 1px solid var(--accent);
}

.education p {
  margin: 0.5mm 0 0;
  color: var(--muted);
  font-size: 10px;
}

.award-list {
  display: grid;
  gap: 1mm;
  margin: 0;
  padding: 1.8mm 0 0 4mm;
  border-top: 1px solid var(--accent);
}

.award-list li {
  padding-left: 0.5mm;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.award-list li::marker {
  color: var(--accent);
}

.resume-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6mm;
  margin-top: 4mm;
  padding-top: 2mm;
  border-top: 1px solid var(--hairline);
}

.resume-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.resume-footer p span {
  margin-right: 2mm;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.resume-footer__meta {
  align-self: end;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: nowrap;
}

.web-tools {
  position: fixed;
  z-index: 10;
  top: 50%;
  right: max(14px, calc((100vw - 210mm) / 2 - 78px));
  display: flex;
  width: 54px;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  transform: translateY(-50%);
}

.web-tools__label {
  margin: 0 auto 4px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-align: center;
  writing-mode: vertical-rl;
}

.tool-link {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  padding: 0 7px;
  place-items: center;
  color: var(--accent-strong);
  background: color-mix(in oklch, var(--paper) 92%, transparent);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgb(22 33 47 / 10%);
  cursor: pointer;
  font-size: 9px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition-property: transform, background-color, color;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-link--primary {
  color: var(--paper);
  background: var(--accent);
}

.tool-link:active {
  transform: scale(0.96);
}

.loading-state,
.noscript-state {
  color: var(--muted);
  text-align: center;
}

.reveal-block {
  opacity: 0;
  transform: translateY(10px);
}

.is-ready .reveal-block {
  opacity: 1;
  transform: translateY(0);
  transition-property: opacity, transform;
  transition-duration: 520ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.is-ready .reveal-block:nth-of-type(2) { transition-delay: 50ms; }
.is-ready .reveal-block:nth-of-type(3) { transition-delay: 100ms; }
.is-ready .reveal-block:nth-of-type(4) { transition-delay: 150ms; }
.is-ready .reveal-block:nth-of-type(5) { transition-delay: 200ms; }

@media (hover: hover) {
  a:hover {
    color: var(--accent);
  }

  .tool-link:hover {
    color: var(--paper);
    background: var(--accent-strong);
    transform: translateY(-2px);
  }
}

@media screen and (min-width: 701px) {
  h1 {
    font-size: clamp(35px, 3.4vw, 40px);
  }
}

@media (max-width: 980px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .web-tools {
    top: auto;
    right: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    flex-direction: row;
    padding: 5px;
    background: color-mix(in oklch, var(--paper) 95%, transparent);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgb(22 33 47 / 18%);
    transform: translateX(50%);
  }

  .web-tools__label {
    display: none;
  }

  .tool-link {
    min-width: 58px;
    min-height: 42px;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
  :root {
    --page-pad-inline: 16px;
    --page-pad-block: 16px;
    --section-gap: 22px;
  }

  body {
    padding: 0 0 calc(82px + env(safe-area-inset-bottom));
    background: var(--paper);
    font-size: 13px;
  }

  .resume-sheet {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

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

  .sheet-register {
    margin-bottom: 18px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 18px;
  }

  h1 {
    font-size: clamp(38px, 11.8vw, 48px);
  }

  .hero__role {
    font-size: 13px;
  }

  .contact-list {
    gap: 4px 14px;
    font-size: 12px;
  }

  .section-heading {
    grid-template-columns: 24px auto 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-heading h2 {
    font-size: 17px;
  }

  .section-heading__aside {
    display: none;
  }

  .summary {
    font-size: 14px;
    line-height: 1.62;
  }

  .career-track,
  .skills-grid,
  .closing-grid {
    grid-template-columns: 1fr;
  }

  .career-track {
    gap: 11px;
    padding: 7px 0 13px 25px;
  }

  .career-step__year {
    font-size: 11px;
  }

  .career-step h3 {
    font-size: 14px;
  }

  .career-step p:last-child {
    font-size: 12.5px;
  }

  .experience {
    padding: 12px 0;
  }

  .experience header,
  .project__header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .experience h3,
  .project h3,
  .education h3 {
    font-size: 15px;
  }

  .experience__role {
    font-size: 12px;
  }

  .experience time {
    width: 100%;
    margin-left: 0;
    font-size: 10px;
  }

  .experience > p,
  .project__fact dd,
  .skill p {
    font-size: 13.2px;
    line-height: 1.55;
  }

  .project {
    padding: 13px 0;
  }

  .project__kind {
    font-size: 12px;
  }

  .project__role {
    font-size: 10px;
  }

  .project__fact {
    grid-template-columns: 34px 1fr;
    gap: 7px;
    margin-bottom: 2px;
  }

  .project__fact dt {
    font-size: 12px;
  }

  .skill {
    grid-template-columns: 96px 1fr;
    gap: 10px;
    padding: 11px 0;
  }

  .skill h3 {
    font-size: 12.5px;
  }

  .education {
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
  }

  .education time {
    margin-left: 0;
    font-size: 10px;
  }

  .education p,
  .award-list li {
    font-size: 12.5px;
  }

  .resume-footer {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
    padding-top: 12px;
  }

  .resume-footer p {
    font-size: 10px;
  }
}

@media (max-width: 410px) {
  .hero {
    grid-template-areas:
      "identity"
      "contact";
  }

  .skill {
    grid-template-columns: 86px 1fr;
    gap: 9px;
  }
}

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

  .reveal-block,
  .is-ready .reveal-block {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
    background: #faf9f5;
  }

  :root {
    --page-pad-inline: 12mm;
    --page-pad-block: 10mm;
    --section-gap: 3.2mm;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 0;
    background: var(--paper);
  }

  body {
    position: relative;
    color-adjust: exact;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body::before {
    position: fixed;
    z-index: 0;
    background: var(--paper);
    content: "";
    inset: 0;
  }

  .web-tools,
  .skip-link {
    display: none;
  }

  .resume-sheet {
    z-index: 1;
    width: 210mm;
    min-height: 297mm;
    padding: var(--page-pad-block) var(--page-pad-inline);
    overflow: visible;
    background: var(--paper);
    box-shadow: none;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  .reveal-block,
  .is-ready .reveal-block {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero,
  .experience,
  .project,
  .skill,
  .education,
  .award-list,
  .resume-footer {
    break-inside: avoid;
  }

  a {
    text-decoration: none;
  }
}
