:root {
  --page: #f7f7f6;
  --paper: #ffffff;
  --ink: #323232;
  --text: #565656;
  --muted: #777777;
  --faint: #d9d9d9;
  --line: #dedede;
  --soft-line: #ededed;
  --green: #42ff4b;
  --shadow: 0 18px 46px rgba(50, 50, 50, 0.04);
  --radius: 8px;
  --content: 1180px;
  --header-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0;
}

::selection {
  background: var(--ink);
  color: #fff;
}

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

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 50;
  transform: translateY(-140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 8px 12px;
  font-size: 12px;
  transition: transform 180ms ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 clamp(28px, 4.5vw, 56px);
  border-bottom: 1px solid var(--soft-line);
  background: rgba(247, 247, 246, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 32px;
  border-radius: 999px;
  color: var(--text);
  padding: 0 18px;
  font-size: 12px;
  font-weight: 560;
  line-height: 1;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.site-nav a:not(.active):hover,
.site-nav a:not(.active):focus-visible {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(50, 50, 50, 0.04);
}

.site-nav .active {
  background: var(--ink);
  color: #fff;
}

.site-nav .active:hover,
.site-nav .active:focus-visible {
  background: var(--ink);
  color: #fff;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  background: var(--paper);
  padding: 0;
  scroll-margin-top: var(--header-height);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 396px);
  align-items: center;
  gap: clamp(68px, 11vw, 154px);
  width: min(var(--content), calc(100% - 96px));
  margin: 0 auto;
}

.intro,
.tagline {
  margin: 0;
  color: #b6b6b6;
  font-size: 16px;
  line-height: 1.4;
}

.intro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.intro-wave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.12em;
  line-height: 1;
  transform-origin: 70% 78%;
  animation: wave-hello 1.65s ease-in-out infinite;
  will-change: transform;
}

.hero-copy h1 {
  margin: 24px 0 12px;
  color: var(--ink);
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-notes {
  display: grid;
  gap: 8px;
  margin-top: clamp(104px, 12vw, 156px);
  border-left: 5px solid #f1f1f1;
  padding-left: 24px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.28;
}

.hero-media {
  justify-self: end;
  width: min(100%, 420px);
  overflow: visible;
}

.hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: contain;
}

.scroll-wrapper {
  position: absolute;
  left: 50%;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  min-width: 64px;
  min-height: 68px;
  transform: translateX(-50%);
  color: #dfdfdf;
  opacity: 1;
  transition:
    opacity 420ms ease,
    transform 420ms ease;
}

.scroll-wrapper:hover,
.scroll-wrapper:focus-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.scroll-wrapper.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.scroll-label {
  color: currentColor;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  text-transform: uppercase;
}

.scroll-mouse {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: 24px;
  height: 36px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.scroll-mouse span {
  width: 3px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: currentColor;
  animation: scroll-wheel 1600ms ease-in-out infinite;
}

@keyframes scroll-wheel {
  0% {
    opacity: 0;
    transform: translateY(0);
  }

  28% {
    opacity: 1;
  }

  72% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes wave-hello {
  0%,
  58%,
  100% {
    transform: rotate(0deg);
  }

  8% {
    transform: rotate(16deg);
  }

  16% {
    transform: rotate(-9deg);
  }

  24% {
    transform: rotate(14deg);
  }

  32% {
    transform: rotate(-5deg);
  }

  42% {
    transform: rotate(9deg);
  }
}

.work-section,
.about-section {
  background: var(--paper);
}

.work-section {
  padding: 40px 0;
}

.about-section {
  padding: clamp(54px, 6.5vw, 84px) 0;
}

.section-heading {
  width: min(var(--content), calc(100% - 96px));
  margin: 0 auto clamp(38px, 5vw, 56px);
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 3.35vw, 37px);
  font-weight: 650;
  line-height: 1.05;
}

.work-list {
  display: grid;
  gap: 44px;
  width: min(var(--content), calc(100% - 96px));
  margin: 0 auto;
}

.work-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.88fr);
  gap: clamp(48px, 7vw, 72px);
  align-items: center;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: clamp(42px, 5vw, 52px);
  transform-origin: center;
  transition:
    border-color 260ms ease,
    box-shadow 260ms ease,
    transform 260ms ease;
}

.work-card::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(50, 50, 50, 0.035),
    rgba(255, 255, 255, 0)
  );
  opacity: 0;
  pointer-events: none;
  content: "";
  transition: opacity 260ms ease;
}

.work-card > * {
  position: relative;
  z-index: 1;
}

.work-card:hover,
.work-card:focus-visible {
  border-color: #c7c7c7;
  box-shadow: 0 24px 58px rgba(50, 50, 50, 0.08);
  transform: scale(1.018);
}

.work-card:hover::after,
.work-card:focus-visible::after {
  opacity: 1;
}

.work-image {
  overflow: hidden;
  border-radius: var(--radius);
}

.work-image img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  transition: transform 320ms ease;
}

.work-card:hover .work-image img,
.work-card:focus-visible .work-image img {
  transform: scale(1.025);
}

.work-copy {
  display: flex;
  min-height: 318px;
  flex-direction: column;
}

.eyebrow {
  margin: 0 0 12px;
  color: #c9c9c9;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
}

.work-copy h3,
.info-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  font-weight: 760;
  line-height: 1.35;
}

.work-copy p {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.78;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
  padding-top: 42px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  font-size: 12px;
  font-weight: 650;
}

.more-note {
  margin: 58px 0 0;
  color: #dddddd;
  font-size: 15px;
  text-align: center;
}

.about-section {
  --about-card-width: 374px;
  --about-gap: 30px;
  --about-contact-height: 86px;
  --about-feature-height: 252px;
  --about-top-rest-height: calc(
    var(--about-feature-height) - var(--about-contact-height) -
      var(--about-gap)
  );
  --about-mid-height: 252px;
  --about-bottom-height: 214px;
  padding-top: clamp(56px, 7vw, 88px);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--about-card-width));
  grid-template-rows:
    var(--about-contact-height) var(--about-top-rest-height)
    var(--about-mid-height) var(--about-bottom-height);
  justify-content: center;
  align-items: stretch;
  gap: var(--about-gap);
  width: min(
    calc(var(--about-card-width) * 3 + var(--about-gap) * 2),
    calc(100% - 96px)
  );
  margin: 0 auto;
}

.about-column {
  display: contents;
}

.about-photo,
.info-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.about-photo {
  position: relative;
  grid-area: 1 / 1 / 3 / 2;
  height: var(--about-feature-height);
  aspect-ratio: 1122 / 755;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  overflow: hidden;
}

.about-photo-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
  display: block;
}

.info-card {
  height: 100%;
  padding: 28px;
}

.info-card h3 {
  margin-bottom: 18px;
  font-size: 22px;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.82;
}

.contact-card {
  grid-area: 1 / 3 / 2 / 4;
  display: flex;
  align-items: center;
  min-height: var(--about-contact-height);
  padding: 18px;
}

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.contact-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-actions a,
.contact-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.contact-actions button {
  cursor: pointer;
}

.contact-actions svg,
.qr-dialog svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.contact-actions .contact-icon {
  flex: 0 0 44px;
  width: 44px;
  padding: 0;
}

.contact-actions a:hover,
.contact-actions a:focus-visible,
.contact-actions button:hover,
.contact-actions button:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.contact-actions .resume-button {
  gap: 10px;
  min-width: 132px;
}

.background-card {
  grid-area: 1 / 2 / 3 / 3;
  min-height: 0;
}

.skills-card {
  grid-area: 3 / 1 / 5 / 2;
  min-height: 0;
}

.experience-card {
  grid-area: 2 / 3 / 4 / 4;
  min-height: 0;
}

.education-card {
  grid-area: 3 / 2 / 4 / 3;
  min-height: 0;
}

.tools-card {
  grid-area: 4 / 2 / 5 / 3;
  min-height: 0;
}

.projects-card {
  grid-area: 4 / 3 / 5 / 4;
  min-height: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  margin-top: 22px;
}

.pill-list span {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  width: auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.info-card dl {
  display: grid;
  gap: 22px;
  margin: 0;
}

.info-card dl div {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
}

.info-card dt {
  color: #c9c9c9;
  font-size: 12px;
  line-height: 1.5;
}

.info-card dd {
  margin: 0;
}

.info-card dd strong,
.info-card dd span {
  display: block;
}

.info-card dd strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.info-card dd span {
  margin-top: 4px;
  color: #b4b4b4;
  font-size: 12px;
  line-height: 1.35;
}

.info-card dd .company {
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.info-card dd .experience-note {
  color: #b4b4b4;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tool-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  color: #b6b6b6;
  font-size: 11px;
  font-weight: 650;
}

.qr-open {
  overflow: hidden;
  padding-right: var(--scrollbar-compensation, 0px);
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
}

.qr-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(50, 50, 50, 0.24);
  cursor: pointer;
}

.qr-dialog {
  position: relative;
  width: min(360px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 26px;
  box-shadow: 0 24px 70px rgba(50, 50, 50, 0.16);
}

.qr-dialog h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
}

.qr-dialog p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.qr-dialog img {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  align-items: center;
  min-height: 118px;
  padding: 0 clamp(28px, 4.5vw, 56px);
  background: var(--ink);
  color: #f5f5f5;
  font-size: 12px;
}

.site-footer a,
.site-footer span {
  color: #f5f5f5;
}

@media (max-width: 1280px) {
  .about-section {
    --about-gap: 24px;
    --about-feature-height: 228px;
    --about-ipad-photo-top-offset: clamp(26px, 3vw, 36px);
  }

  .about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    align-items: start;
    width: min(780px, calc(100% - 56px));
  }

  .about-column {
    display: grid;
    align-content: start;
    gap: var(--about-gap);
    width: 100%;
  }

  .about-column-right {
    padding-top: var(--about-ipad-photo-top-offset);
  }

  .about-photo,
  .background-card,
  .contact-card,
  .skills-card,
  .education-card,
  .experience-card,
  .tools-card,
  .projects-card {
    grid-area: auto;
  }

  .about-photo {
    height: auto;
    margin-top: var(--about-ipad-photo-top-offset);
  }

  .background-card,
  .education-card {
    min-height: var(--about-feature-height);
  }

  .skills-card {
    min-height: 496px;
  }

  .experience-card {
    min-height: 408px;
  }

  .tools-card,
  .projects-card {
    min-height: 214px;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    min-height: 64px;
  }

  .site-nav {
    gap: 14px;
  }

  .hero {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    padding: 0;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 56px;
    width: min(680px, calc(100% - 56px));
  }

  .hero-media {
    justify-self: start;
    width: min(100%, 430px);
  }

  .hero-notes {
    margin-top: 72px;
  }

  .scroll-wrapper {
    bottom: 18px;
  }

  .section-heading,
  .work-list,
  .about-grid {
    width: min(680px, calc(100% - 56px));
  }

  .work-card {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: auto;
  }

  .work-copy {
    min-height: 0;
  }

  .tag-row {
    margin-top: 34px;
    padding-top: 0;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-card,
  .experience-card {
    grid-column: auto;
  }

  .info-card dl div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .info-card dt,
  .info-card dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
    gap: 14px 32px;
    min-height: 132px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 116px;
  }

  .site-header {
    align-items: flex-start;
    min-height: auto;
    flex-direction: column;
    gap: 14px;
    padding: 18px 22px;
  }

  .site-nav {
    width: 100%;
    gap: 8px;
    justify-content: space-between;
  }

  .site-nav a {
    min-width: 0;
    padding: 0 8px;
  }

  .site-nav .active {
    min-width: 58px;
    padding: 0 12px;
  }

  .hero {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    padding: 38px 0 82px;
  }

  .hero-inner,
  .section-heading,
  .work-list,
  .about-grid {
    width: min(100% - 34px, 430px);
  }

  .hero-copy h1 {
    margin-top: 18px;
    font-size: 42px;
    line-height: 1.02;
  }

  .intro,
  .tagline {
    font-size: 14px;
  }

  .hero-notes {
    margin-top: 58px;
    padding-left: 18px;
    font-size: 14px;
  }

  .scroll-wrapper {
    bottom: 16px;
    min-height: 58px;
    gap: 8px;
  }

  .scroll-mouse {
    width: 22px;
    height: 32px;
  }

  .work-section,
  .about-section {
    padding: 56px 0;
  }

  .section-heading {
    margin-bottom: 34px;
  }

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

  .work-list {
    gap: 28px;
  }

  .work-card {
    gap: 26px;
    padding: 22px;
  }

  .work-copy h3 {
    font-size: 20px;
  }

  .work-copy p {
    margin-top: 16px;
    font-size: 14px;
  }

  .tag-row {
    gap: 10px;
    margin-top: 26px;
  }

  .tag-row span {
    min-height: 38px;
    padding: 0 14px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-column {
    display: contents;
  }

  .about-column-right {
    padding-top: 0;
  }

  .about-photo {
    height: auto;
    margin-top: 32px;
  }

  .contact-card,
  .experience-card {
    grid-column: auto;
  }

  .about-photo {
    order: 1;
  }

  .contact-card {
    order: 2;
  }

  .background-card {
    order: 3;
  }

  .education-card {
    order: 4;
  }

  .experience-card {
    order: 5;
  }

  .projects-card {
    order: 6;
  }

  .skills-card {
    order: 7;
  }

  .tools-card {
    order: 8;
  }

  .background-card,
  .skills-card,
  .education-card,
  .experience-card,
  .tools-card,
  .projects-card {
    min-height: auto;
  }

  .info-card {
    padding: 22px;
  }

  .contact-actions {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .contact-icons {
    gap: 10px;
  }

  .contact-actions .resume-button {
    min-width: 118px;
    padding: 0 14px;
  }

  .info-card dl div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer {
    grid-template-columns: 1fr;
    min-height: 180px;
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
