:root {
  color-scheme: light;
  --page: #fff6d8;
  --paper: #fffdf5;
  --ink: #1f2630;
  --muted: #596575;
  --accent: #28798c;
  --gold: #c79d59;
  --line: #252b35;
  --soft-line: #d9c9a4;
  --accent-soft: #edf8f8;
}

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

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

body {
  margin: 0;
  padding: clamp(28px, 5vw, 72px) 24px;
  background: var(--page);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: 0;
}

::selection {
  background: rgba(199, 157, 89, 0.28);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

a:focus-visible {
  outline: 3px solid rgba(79, 120, 129, 0.28);
  outline-offset: 4px;
}

.resume-sheet {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  min-height: 1160px;
  padding: 54px 62px 44px;
  overflow-wrap: anywhere;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
}

.resume-header {
  position: relative;
  padding: 0 0 34px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #18314a;
  font-size: clamp(2.75rem, 7vw, 3.625rem);
  font-weight: 800;
  line-height: 1;
}

h2,
h3 {
  line-height: 1.38;
}

.role {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 1.12rem;
  font-weight: 800;
}

.summary {
  max-width: 660px;
  margin: 18px auto 0;
  color: var(--muted);
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1rem;
  font-style: normal;
}

.contact-list a {
  font-weight: 700;
}

.resume-section {
  margin-top: 34px;
}

.section-title {
  display: flex;
  min-height: auto;
  align-items: center;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0;
}

.section-frame,
.project-card {
  padding: 24px 26px;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.highlight {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 104px;
  flex-direction: column;
  justify-content: center;
  padding: 21px 24px;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
  text-align: left;
}

.highlight + .highlight {
  border-left: 1.5px solid var(--line);
}

.highlight strong {
  color: var(--accent);
  font-size: 1.65rem;
  line-height: 1.15;
  white-space: nowrap;
}

.highlight span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.5;
}

.highlight em {
  position: absolute;
  z-index: 10;
  top: calc(100% + 9px);
  left: 24px;
  width: max-content;
  max-width: min(320px, calc(100vw - 64px));
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 16px 34px rgba(31, 38, 48, 0.14);
  color: #3f4b5a;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.highlight em::before {
  position: absolute;
  top: -7px;
  left: 28px;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid var(--line);
  border-left: 1.5px solid var(--line);
  background: var(--paper);
  content: "";
  transform: rotate(45deg);
}

.highlight-with-note:hover em,
.highlight-with-note:focus-visible em {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.highlight-with-note strong {
  font-size: clamp(1.05rem, 2.3vw, 1.45rem);
}

.timeline > article + article {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--soft-line);
}

.item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.item-heading h3,
.item-heading p {
  margin: 0;
}

.item-heading h3 {
  font-size: 1.12rem;
}

.item-heading > div > p:not(.project-company) {
  margin-top: 3px;
}

.item-heading time,
.project-role {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: right;
  white-space: nowrap;
}

.experience-item > p,
.education-item > p {
  margin: 13px 0 0;
  color: var(--muted);
}

.project-stack {
  display: grid;
  gap: 18px;
}

.project-card {
  position: relative;
  border-radius: 2px;
}

.project-card::before {
  content: none;
}

.project-card h3 {
  font-size: 1.16rem;
}

.project-company {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.5;
  text-transform: uppercase;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0;
}

.tech-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid rgba(79, 120, 129, 0.45);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.35;
}

.project-intro,
.profile-copy p {
  margin: 0;
  color: var(--muted);
}

.achievement-list {
  margin: 14px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.achievement-list li {
  padding-left: 0.16rem;
}

.achievement-list li + li {
  margin-top: 8px;
}

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

.achievement-list strong,
.education-item strong {
  color: var(--ink);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.project-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
}

.project-link::after {
  content: "↗";
  font-size: 0.9em;
}

.project-link:hover {
  background: var(--accent);
  color: #ffffff;
}

.education-meta {
  color: var(--accent);
  font-weight: 800;
}

.profile-copy {
  border-left-width: 3px;
  border-left-color: var(--gold);
}

@media (max-width: 720px) {
  body {
    padding: 14px;
    font-size: 15px;
  }

  .resume-sheet {
    padding: 36px 20px;
    border-width: 1px;
    box-shadow: none;
  }

  .resume-header {
    padding-bottom: 26px;
  }

  h1 {
    font-size: 2.4rem;
  }

  .summary {
    text-align: left;
  }

  .contact-list {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

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

  .section-title {
    min-height: auto;
    padding: 0 0 9px;
    font-size: 0.98rem;
  }

  .section-frame,
  .project-card {
    padding: 18px;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .highlight {
    min-height: 104px;
    padding: 18px;
  }

  .item-heading {
    flex-direction: column;
    gap: 6px;
  }

  .item-heading time,
  .project-role {
    white-space: normal;
    text-align: left;
  }

  .tech-list {
    gap: 6px;
  }

  .project-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-link {
    width: 100%;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  html,
  body {
    background: #ffffff;
  }

  body {
    padding: 0;
    color: #000000;
    font-size: 10pt;
    line-height: 1.5;
  }

  .resume-sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .resume-header {
    padding: 10pt 0 15pt;
  }

  .resume-header::before,
  .project-card::before {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  h1 {
    font-size: 27pt;
  }

  .summary {
    margin-top: 9pt;
  }

  .contact-list {
    gap: 4pt 12pt;
    margin-top: 10pt;
  }

  .resume-section {
    margin-top: 13pt;
  }

  #education,
  #profile {
    break-inside: avoid;
  }

  .section-title {
    min-height: auto;
    padding: 0 0 5pt;
    background: transparent !important;
    color: var(--ink) !important;
    font-size: 10pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .section-frame,
  .project-card {
    padding: 11pt;
  }

  .highlight {
    min-height: 62pt;
    padding: 9pt;
  }

  .highlight strong {
    font-size: 15pt;
  }

  .timeline > article + article {
    margin-top: 10pt;
    padding-top: 10pt;
  }

  .project-stack {
    gap: 9pt;
  }

  .project-card,
  .experience-item,
  .education-item,
  .highlight {
    break-inside: avoid;
  }

  .project-card h3,
  .item-heading h3 {
    font-size: 10.5pt;
  }

  .item-heading time,
  .project-role,
  .project-company {
    font-size: 8.2pt;
  }

  .tech-list {
    gap: 3pt;
    margin: 7pt 0;
  }

  .tech-list span {
    min-height: 17pt;
    padding: 1pt 5pt;
    background: transparent;
    font-size: 7.5pt;
  }

  .achievement-list {
    margin-top: 6pt;
  }

  .achievement-list li + li {
    margin-top: 3pt;
  }

  .project-actions {
    display: none;
  }

  h2,
  h3 {
    break-after: avoid;
  }

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