.profile-scene {
  --profile-bg: var(--vi-ink);
  --profile-ink: var(--vi-inverse-text);
  --profile-muted: var(--vi-inverse-secondary);
  --profile-accent: var(--vi-processing);
  --profile-gap: clamp(24px, 2vw, 32px);
  --profile-gutter: clamp(24px, 3vw, 58px);
  --profile-font: var(--vi-font-ui);
  --profile-body-size: 14px;
  --profile-leading: 20px;
  --profile-block-gap: 24px;
  --profile-item-gap: 16px;
  position: relative;
  height: 570vh;
  height: 570svh;
  color: var(--profile-ink);
  background: var(--profile-bg);
}
.profile-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 32px var(--profile-gutter) 26px;
  display: flex;
  flex-direction: column;
  overflow: clip;
}
.profile-scene:focus { outline: none; }
.profile-columns, .profile-statements {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: calc(var(--profile-gap) / 2);
}
.profile-columns {
  position: absolute;
  left: var(--profile-gutter);
  right: var(--profile-gutter);
  bottom: clamp(24px, 4svh, 48px);
  grid-template-columns: repeat(24, minmax(0, 1fr));
  column-gap: calc(var(--profile-gap) / 2);
}
.profile-column { min-width: 0; transform: translate(var(--profile-column-x, 0px), var(--profile-column-y, 0px)); }
.profile-column--connect { grid-column: 1 / span 4; }
.profile-column--background { grid-column: 9 / span 6; }
.profile-column--recognition { grid-column: 17 / span 8; }
.profile-heading {
  position: relative;
  margin: 0 0 var(--profile-block-gap);
  padding-left: 20px;
  text-align: left;
  font: 500 12px/16px var(--profile-font);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.profile-heading::before {
  content: '';
  position: absolute;
  top: calc(50% - 3.5px);
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--profile-accent);
}
.profile-heading-label { display: inline-block; }
.profile-details {
  font-family: var(--profile-font);
  font-size: var(--profile-body-size);
  line-height: var(--profile-leading);
  letter-spacing: 0;
}
.profile-details p { margin: 0; }
.profile-details .profile-name { color: var(--vi-surface); font-size: 20px; line-height: 24px; font-weight: 500; letter-spacing: -.02em; }
.profile-role, .profile-year { color: var(--profile-muted); }
.profile-details .profile-year { margin-top: 8px; }
.profile-location { margin-top: var(--profile-block-gap) !important; }
.profile-clock { white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-education { display: grid; gap: var(--profile-item-gap); margin-top: var(--profile-block-gap); }
.profile-education p { font-weight: 500; }
.profile-school-link, .profile-school-link:hover, .profile-school-link:visited {
  color: inherit;
  font: inherit;
  text-decoration: none;
}
.profile-school-link:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.profile-education span { display: block; color: var(--profile-muted); }
.profile-education span, .profile-awards span { font-weight: 400; }
.profile-awards { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--profile-item-gap); }
.profile-awards li { min-width: 0; }
.profile-awards strong { font-weight: 500; }
.profile-awards span { display: block; color: var(--profile-muted); }
.profile-links { list-style: none; padding: 0; margin: 0; }
.profile-links li { display: flex; }
.profile-links a, .profile-links button {
  display: inline-block;
  position: relative;
  padding: 0;
  min-height: 24px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  text-decoration: none;
}
.profile-links a::after, .profile-links button::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 0;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.profile-links :is(a, button):hover::after { transform: scaleX(1); }
.profile-details .profile-timezone { margin-top: var(--profile-block-gap); color: var(--profile-muted); }
.profile-statements {
  position: absolute;
  top: clamp(32px, 8svh, 96px);
  left: var(--profile-gutter);
  right: var(--profile-gutter);
  align-items: start;
  padding: 0;
}
.profile-statement {
  grid-column: span 4;
  margin: 0;
  font: 400 clamp(23px, 2.03vw, 39px)/1.2 var(--profile-font);
  letter-spacing: -.045em;
  text-wrap: pretty;
  align-self: start;
}
.profile-statement :is(strong, em), .profile-word.is-emphasized { font-style: normal; font-weight: 600; color: var(--vi-inverse-text); }
@media (min-width:701px), (min-aspect-ratio:3/4) {
  html[data-device="desktop"] .profile-column { display: flex; flex-direction: column; }
  html[data-device="desktop"] .profile-details { display: flex; flex: 1; flex-direction: column; }
  html[data-device="desktop"] .profile-awards { flex: 1; align-content: space-between; }
  html[data-device="desktop"] .profile-details :is(.profile-timezone, .profile-education) { margin-top: auto; padding-top: var(--profile-block-gap); }
  html[data-device="desktop"] .profile-statement:nth-child(1) { grid-column: 1 / span 6; }
  html[data-device="desktop"] .profile-statement:nth-child(2) { grid-column: 9 / span 7; }
  html[data-device="desktop"] .profile-statement:nth-child(3) { grid-column: 17 / span 8; }
}
.profile-word-mask { display: inline-block; vertical-align: top; overflow: clip; padding-bottom: .12em; margin-bottom: -.12em; }
.profile-word { display: inline-block; }
.profile-opening { display: none; }
.profile-dots { position: absolute; inset: 0; pointer-events: none; }
.profile-dot { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--profile-accent); opacity: 0; will-change: transform; }
.profile-enhanced .profile-heading::before { opacity: 0; }
.profile-enhanced .profile-heading-label, .profile-enhanced .profile-details { opacity: 0; }
.profile-enhanced .profile-statement .profile-word { transform: translateY(-115%); }
.profile-scene:not(.profile-enhanced) { height: auto; }
.profile-scene:not(.profile-enhanced) .profile-stage { height: auto; min-height: 100svh; position: relative; }
.profile-scene:not(.profile-enhanced) .profile-dots { display: none; }
.profile-scene:not(.profile-enhanced) :is(.profile-columns, .profile-statements) { position: relative; inset: auto; }
.profile-scene:not(.profile-enhanced) .profile-statements { margin-top: 64px; }

.wechat-dialog {
  color-scheme: light;
  width: min(410px, calc(100vw - 40px));
  max-height: calc(100svh - 40px);
  padding: 24px;
  border: 0;
  background: var(--vi-surface);
  color: var(--vi-ink);
  overflow-y: auto;
}
.wechat-dialog::backdrop { background: var(--vi-backdrop); backdrop-filter: blur(8px); }
.wechat-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.wechat-dialog h2 { margin: 0; font: 400 22px/1.2 var(--vi-font-ui); letter-spacing: -.035em; }
.wechat-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 7px; border: 0; background: transparent; color: var(--vi-ink); cursor: pointer; }
.wechat-close svg { width: 20px; height: 20px; }
.wechat-qr { display: block; width: 100%; height: auto; background: var(--vi-surface); }
.wechat-handle { margin: 14px 0 4px; text-align: center; font: 400 15px/1.5 var(--vi-font-mono); }

@media (min-width: 1050px) and (min-height: 500px) and (max-height: 759px) {
  .profile-scene { --profile-body-size: 12px; --profile-leading: 16px; --profile-block-gap: 16px; --profile-item-gap: 12px; }
  .profile-stage { padding-top: 20px; padding-bottom: 14px; }
  .profile-heading { font-size: 11px; }
  .profile-details .profile-name { font-size: 16px; line-height: 20px; }
  .profile-details .profile-year { margin-top: 4px; }
  .profile-links :is(a, button) { min-height: 20px; }
  .profile-statements { top: 24px; padding: 0; }
  .profile-statement { font-size: clamp(17px, 3.4svh, 25px); }
}
@media (max-width:700px) and (max-aspect-ratio:3/4), (max-height:500px) and (min-aspect-ratio:4/3) and (pointer:coarse) {
  .profile-scene { height: auto; }
  .profile-stage { position: relative; height: auto; min-height: 100svh; padding: 0 24px 28px; overflow: clip; }
  .profile-opening { display: block; height: 42svh; min-height: 210px; }
  .profile-columns { position: relative; inset: auto; grid-template-columns: 1fr; gap: 48px; max-width: 600px; width: 100%; margin: 0 auto; }
  .profile-column { grid-column: 1; }
  .profile-enhanced .profile-heading::before { opacity: var(--profile-heading-opacity, 0); }
  .profile-links :is(a, button) { min-height: 40px; padding: 8px 0; }
  .profile-statements { position: relative; inset: auto; flex: none; grid-template-columns: 1fr; grid-template-rows: 1fr; gap: 0; height: 360svh; padding: 0; max-width: 600px; width: 100%; margin: 80px auto 70px; }
  .profile-statement { grid-area: 1 / 1; position: sticky; top: 12svh; align-self: start; font-size: clamp(27px, 4.5vw, 40px); line-height: 1.32; letter-spacing: -.04em; }
  .profile-scene:not(.profile-enhanced) .profile-statements { height: auto; gap: 64px; }
  .profile-scene:not(.profile-enhanced) .profile-statement { position: static; grid-area: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-scene, .profile-enhanced { height: auto; }
  .profile-stage { position: relative; height: auto; min-height: 100svh; padding-top: 36px; }
  .profile-opening, .profile-dots { display: none; }
  .profile-heading::before, .profile-enhanced .profile-heading::before { opacity: 1; }
  .profile-column { transform: none !important; }
  .profile-enhanced .profile-heading-label, .profile-enhanced .profile-details { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .profile-enhanced .profile-statement .profile-word { transform: none !important; }
  .profile-columns, .profile-statements { position: relative; inset: auto; }
  .profile-statements { height: auto; column-gap: calc(var(--profile-gap) / 2); row-gap: 64px; margin-top: 64px; }
  .profile-statement { position: static; grid-area: auto; visibility: visible !important; transform: none !important; }
}

@media (max-width:1049px) and (min-height:500px) {
 html[data-device="desktop"] .profile-scene { --profile-gutter:24px;--profile-body-size:12px;--profile-leading:16px;--profile-block-gap:16px;--profile-item-gap:12px; }
 html[data-device="desktop"] .profile-column--connect { grid-column:1 / span 6; }
 html[data-device="desktop"] .profile-column--background { grid-column:9 / span 7; }
 html[data-device="desktop"] .profile-statement { font-size:clamp(17px,2.4vw,25px); }
}

/* Public recommendations use the existing profile rows and contact dialog. */
.profile-awards a{display:block;color:inherit;text-decoration:none}
.profile-awards a:hover strong,.profile-awards a:focus-visible strong{text-decoration:underline;text-underline-offset:4px}
.profile-repositories{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.profile-repositories a{display:block;padding:14px 0;color:inherit;text-underline-offset:4px}

.profile-intro {
  position:relative;z-index:1;margin:0;font-size:clamp(1.5rem,3vw,2.5rem);
  line-height:1.12;letter-spacing:-.03em;
}
@media (max-width:700px) and (max-aspect-ratio:3/4) {
  .profile-intro { margin-top:28px; }
}

.personal-story, .notes-section { padding:clamp(42px,7vw,96px) clamp(24px,6.25vw,90px); }
.personal-story { background:var(--vi-ink);color:var(--vi-inverse-text); }
.personal-row { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.75fr);gap:clamp(20px,5vw,84px);max-width:1320px;margin:auto; }
.personal-row + .personal-row { margin-top:clamp(44px,6vw,84px); }
.personal-row h2 { margin:0;font-size:clamp(2rem,4vw,3.75rem);line-height:1.05;letter-spacing:-.035em; }
.personal-row .skills-rows,.personal-row .skill-row,.personal-list dt { border-color:var(--vi-inverse-muted); }
.personal-row dd { color:var(--vi-inverse-secondary); }
.personal-list { margin:0; }
.personal-list dt { padding-top:16px;border-top:1px solid var(--vi-inverse-muted);font-weight:600; }
.personal-list dd { margin:6px 0 18px;max-width:65ch;line-height:1.5; }
.personal-list a { text-decoration:underline;text-underline-offset:3px; }
#profile .profile-stage { min-height:0;padding:clamp(40px,6vw,84px) clamp(24px,6.25vw,90px); }
#profile .profile-columns { margin:40px auto 0; }
#profile .profile-statements { height:auto; }
.notes-section { background:var(--vi-surface);color:var(--vi-ink); }
.case-study { padding-block:0; }
.case-study summary { display:flex;gap:1rem;align-items:baseline;padding:18px 0;cursor:pointer; }
.case-study summary::after { content:'+';margin-left:auto; }
.case-study details[open] summary::after { content:'−'; }
.case-study details[open] { padding-bottom:24px; }
.case-study summary:focus-visible { outline:2px solid currentColor;outline-offset:-2px; }
@media(max-width:700px) { .personal-row { grid-template-columns:1fr; } }

.technical-tools { margin-top:16px; }
.technical-tools summary { width:fit-content;padding:10px 0;cursor:pointer;text-decoration:underline;text-underline-offset:4px; }
.technical-tools h3 { margin:18px 0 6px;font-size:1.25rem; }
.technical-tools p { margin:0 0 16px;color:var(--vi-inverse-secondary);line-height:1.5; }
.technical-tools dd { overflow-wrap:anywhere; }
.tool-example { display:block;margin-top:6px;color:var(--vi-inverse-text); }
.tool-example a { text-decoration:underline;text-underline-offset:3px; }

#profile .profile-stage { overflow: visible; }
.profile-reading .profile-statements { margin-top: clamp(28px, 6vh, 65px); }
.profile-reading.is-animated { height: 290dvh; }
.profile-reading.is-animated .profile-reading-stage {
  position: sticky;
  top: 0;
  min-height: 100dvh;
  padding-block: clamp(24px, 5vh, 56px);
}
.profile-reading.is-animated .profile-word { transform: translateY(-115%); }
.profile-reading:not(.is-animated) .profile-word-mask { display: inline; overflow: visible; }
.profile-reading:not(.is-animated) .profile-word { display: inline; transform: none !important; }

@media (max-width: 700px) {
  .profile-reading .profile-statements { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .profile-reading .profile-statement { grid-column: 1; }
  .profile-reading.is-animated .profile-statement { grid-area: 1 / 1; position: static; }
}

.profile-reading.is-animated .profile-reading-stage { overflow: clip; }
.profile-reading.is-animated .profile-statement { position: relative; z-index: 1; }
.profile-black-hole { display: none; }
.profile-reading.is-animated .profile-black-hole {
  display: grid;
  place-items: center;
  position: absolute;
  left: 50%;
  top: 55%;
  width: clamp(76px, 12vw, 156px);
  aspect-ratio: 1;
  translate: -50% -50%;
  opacity: calc(.78 + .22 * var(--hole-strength, 0));
  pointer-events: none;
}
.profile-black-hole::before,
.profile-black-hole::after {
  content: '';
  grid-area: 1 / 1;
  border-radius: 50%;
  transform: scale(calc(.58 + .42 * var(--hole-strength)));
}
.profile-black-hole::before {
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #010103 36%, #44305e 40%, #fde8ad 45%, #d28551 48%, #8a56b560 53%, transparent 69%);
}
.profile-black-hole::after {
  width: 145%;
  height: 38%;
  background: radial-gradient(ellipse, transparent 45%, #f5c587 54%, #71519b90 61%, transparent 73%);
  rotate: -20deg;
}
@media (max-width: 700px) {
  .profile-reading.is-animated .profile-black-hole { top: 64%; }
}

.profile-black-hole canvas {
  position: absolute;
  width: clamp(168px, 25vw, 300px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  scale: calc(.8 + .2 * var(--hole-strength, 0));
  visibility: hidden;
}
.profile-reading.has-lensing .profile-black-hole canvas { visibility: visible; }
.profile-reading.has-lensing .profile-black-hole::before,
.profile-reading.has-lensing .profile-black-hole::after { display: none; }
.profile-reading-stage .profile-intro { z-index: 1; }

.profile-anomaly {
  margin: clamp(28px, 6vh, 64px) 0 0 auto;
  width: fit-content;
  color: #e4c9ac;
  font-family: Georgia, "Noto Serif", serif;
  font-size: clamp(1.4rem, 3.2vw, 3.25rem);
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -.045em;
}
.profile-reading.is-animated .profile-anomaly {
  position: absolute;
  right: 8%;
  bottom: 19%;
  margin: 0;
}
@media (max-width: 700px) {
  .profile-reading.is-animated .profile-anomaly { right: 4%; bottom: 15%; }
}

.core-skills {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin-bottom: .3rem;
}
.core-skill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.core-skill img {
  width: 18px;
  height: 18px;
  filter: invert(.88);
}

.skill-category {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
}
.skill-category svg {
  flex: none;
  margin-top: .12em;
  color: var(--vi-inverse-secondary);
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
}
.secondary-languages + .skill-items,
.ai-skill-context + .skill-items {
  margin-top: .45rem;
}
.core-skill :is(img, svg) {
  flex: none;
}
