:root {
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --soft: #a1a1a6;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --violet: #6e5cff;
  --orange: #ff7a45;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.12);
  --radius-xl: 42px;
  --radius-lg: 30px;
}

* {
  box-sizing: border-box;
}

a,
button {
  touch-action: manipulation;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    "SF Pro Display",
    "PingFang SC",
    "Microsoft YaHei",
    "Helvetica Neue",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 113, 227, 0.18), transparent 34rem),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 58%, #ffffff 100%);
}

body.is-mobile-preview {
  background:
    radial-gradient(circle at 50% -6%, rgba(0, 113, 227, 0.2), transparent 24rem),
    linear-gradient(90deg, #dfe4ec 0%, #f6f6f8 18%, #f6f6f8 82%, #dfe4ec 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.48;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

code {
  padding: 0.18em 0.42em;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  color: #3a3a3c;
  font-size: 0.88em;
}

.aurora {
  position: fixed;
  z-index: -2;
  width: 44vw;
  height: 44vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 999px;
  filter: blur(55px);
  opacity: 0.42;
  pointer-events: none;
}

.aurora-a {
  top: 18%;
  left: -14%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.58), transparent 64%);
}

.aurora-b {
  right: -16%;
  bottom: 4%;
  background: radial-gradient(circle, rgba(255, 122, 69, 0.48), transparent 62%);
}

.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(980px, calc(100% - 28px));
  min-height: 54px;
  gap: 10px;
  padding: 8px 10px 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px) saturate(180%);
  transform: translateX(-50%);
}

.nav-indicator {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: var(--nav-indicator-width, 74px);
  height: var(--nav-indicator-height, 38px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.16), transparent 46%),
    #111;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: none;
  transform: translate3d(var(--nav-indicator-x, 18px), var(--nav-indicator-y, 8px), 0);
  transition:
    transform 480ms cubic-bezier(0.2, 0.92, 0.24, 1),
    width 480ms cubic-bezier(0.2, 0.92, 0.24, 1),
    height 480ms cubic-bezier(0.2, 0.92, 0.24, 1),
    opacity 220ms ease;
  will-change: transform, width, height;
}

.brand {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 74px;
  height: 38px;
  border-radius: 999px;
  color: rgba(29, 29, 31, 0.74);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: color 180ms ease, transform 180ms ease;
}

.brand:hover {
  color: var(--text);
}

.nav {
  display: flex;
  position: relative;
  z-index: 1;
  gap: 4px;
}

.nav a {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(29, 29, 31, 0.74);
  font-size: 0.9rem;
  transition: color 180ms ease, transform 180ms ease;
}

.nav a:hover {
  color: var(--text);
}

.brand.is-nav-active,
.nav a.is-nav-active {
  color: #fff;
}

.brand.is-nav-active:hover,
.nav a.is-nav-active:hover {
  color: #fff;
}

.resume-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: #7f1026;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  box-shadow: 0 14px 30px rgba(127, 16, 38, 0.22);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.resume-download:hover {
  background: #681020;
  color: #fff;
  box-shadow: 0 18px 38px rgba(127, 16, 38, 0.3);
  transform: translateY(-1px);
}

.viewport-switch {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(22px) saturate(180%);
}

.viewport-switch button {
  min-width: 64px;
  padding: 9px 12px;
  border-radius: 999px;
  background: transparent;
  color: rgba(29, 29, 31, 0.66);
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.viewport-switch button:hover {
  transform: translateY(-1px);
}

.viewport-switch button.is-active {
  background: #111;
  color: #fff;
}

.phone-preview-shell {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.phone-preview-shell.is-open {
  opacity: 1;
  pointer-events: auto;
}

.phone-preview-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 18%, rgba(0, 113, 227, 0.24), transparent 26rem),
    rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.phone-preview-panel {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(430px, calc(100vw - 32px));
  transform: translateY(16px) scale(0.96);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-preview-shell.is-open .phone-preview-panel {
  transform: translateY(0) scale(1);
}

.phone-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px) saturate(180%);
}

.phone-preview-toolbar span,
.phone-preview-toolbar strong {
  display: block;
}

.phone-preview-toolbar span {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.phone-preview-toolbar strong {
  margin-top: 3px;
  font-size: 1rem;
}

.phone-preview-toolbar button {
  padding: 8px 13px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 850;
}

.phone-device-shell {
  position: relative;
  height: min(844px, calc(100vh - 132px));
  min-height: 620px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 46px;
  background:
    linear-gradient(145deg, #111 0%, #2a2a2f 46%, #050506 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 38px 120px rgba(0, 0, 0, 0.42);
}

.phone-speaker {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 2;
  width: 76px;
  height: 20px;
  border-radius: 999px;
  background: #0a0a0c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
}

.phone-device-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 34px;
  background: transparent;
  scrollbar-width: none;
}

.phone-device-shell iframe::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.is-phone-frame .viewport-switch,
body.is-phone-frame .phone-preview-shell {
  display: none;
}

html.is-phone-frame {
  scrollbar-width: none;
}

html.is-phone-frame::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.is-phone-frame {
  background:
    radial-gradient(circle at 50% -4%, rgba(0, 113, 227, 0.18), transparent 22rem),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 64%, #fff 100%);
  scrollbar-width: none;
}

body.is-phone-frame::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.is-phone-frame::-webkit-scrollbar-track {
  background: transparent;
}

body.is-phone-frame::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
}

body.is-phone-frame main {
  width: 100%;
  padding-inline: 12px;
  overflow: hidden;
}

body.has-phone-preview-open {
  overflow: hidden;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

body.is-mobile-preview main {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  padding: 0 10px;
  border-inline: 0;
  background: transparent;
  box-shadow: none;
}

body.is-mobile-preview .topbar {
  width: min(840px, calc(100% - 28px));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 380px;
  gap: clamp(26px, 5vw, 72px);
  align-items: center;
  min-height: 100vh;
  padding: 132px 0 82px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 26px;
  font-size: clamp(4.6rem, 10.5vw, 9.6rem);
  line-height: 0.88;
  letter-spacing: -0.09em;
  background: linear-gradient(115deg, #111 0%, #3a3a3c 42%, #8f8f95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 5vw, 5.35rem);
  line-height: 1.02;
  letter-spacing: -0.075em;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.32rem, 2.3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 760px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.22rem, 2.5vw, 1.88rem);
  line-height: 1.48;
  letter-spacing: -0.02em;
}

.lead strong {
  color: var(--ink);
  font-weight: 800;
}

.hero-name {
  width: fit-content;
  margin: 0 0 18px;
  padding: 10px 16px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #1d1d1f;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  backdrop-filter: blur(18px) saturate(180%);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-dark {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 16px 34px rgba(0, 113, 227, 0.28);
}

.button-light {
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  border: 1px solid rgba(0, 113, 227, 0.16);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.device-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  width: min(380px, 100%);
  justify-self: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 56px;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.78), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(232, 232, 237, 0.66));
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(170%);
  transform-style: preserve-3d;
}

.device-glow {
  position: absolute;
  inset: -45px;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.45), transparent 36%),
    radial-gradient(circle at 80% 80%, rgba(255, 122, 69, 0.42), transparent 38%);
  filter: blur(22px);
  opacity: 0.72;
}

.device-card img {
  display: block;
  width: 100%;
  height: clamp(430px, 54vh, 520px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 36%;
  border-radius: 44px;
  filter: saturate(1.08) contrast(1.02);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: -38px 0 64px;
}

.stats article,
.education-hero-card,
.profile-points article,
.experience-card,
.contact-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px) saturate(180%);
}

.stats article {
  padding: 26px;
  border-radius: 28px;
}

.stats strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.06em;
}

.stats span {
  color: var(--muted);
  line-height: 1.45;
}

.section {
  padding: 78px 0;
  scroll-margin-top: 90px;
}

.section-title {
  max-width: 840px;
}

.section-title p,
.profile-points p,
.education-feature p,
.contact-card p,
.experience-detail p,
.work-card em {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.section-title.centered {
  max-width: 880px;
  margin: 0 auto 42px;
  text-align: center;
}

.education-feature .section-title {
  max-width: min(980px, 100%);
  margin-bottom: clamp(26px, 4vw, 42px);
}

.education-headline {
  max-width: 980px;
  font-size: clamp(2.8rem, 5.7vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: -0.065em;
}

.education-headline span {
  display: block;
}

.education-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.education-hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 54px);
  border-radius: var(--radius-xl);
}

.education-hero-card {
  min-height: 420px;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 122, 69, 0.14), transparent 22rem),
    radial-gradient(circle at 78% 16%, rgba(0, 113, 227, 0.2), transparent 26rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(245, 245, 247, 0.72));
}

.education-hero-card::after {
  content: "BFA";
  position: absolute;
  right: -0.08em;
  bottom: -0.22em;
  color: rgba(0, 0, 0, 0.045);
  font-size: clamp(9rem, 19vw, 16rem);
  font-weight: 900;
  letter-spacing: -0.12em;
}

.degree {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  max-width: 620px;
  color: #3a3a3c !important;
  font-size: clamp(1.22rem, 2vw, 1.48rem) !important;
  font-weight: 760;
}

.degree span {
  display: inline-flex;
  align-items: center;
}

.degree span + span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 14px;
  border-radius: 50%;
  background: currentColor;
}

.course-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.course-strip span {
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #3a3a3c;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.education-card-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  margin-top: clamp(34px, 5vw, 58px);
}

.education-card-grid > div {
  min-height: 156px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(18px) saturate(160%);
}

.education-card-label {
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.credential-inline {
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 122, 69, 0.16), transparent 16rem),
    rgba(255, 255, 255, 0.58) !important;
}

.credential-inline h4 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.credential-inline p {
  margin-top: 0;
}

.credential-inline p:last-child {
  margin-bottom: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(26px, 5vw, 58px);
  align-items: start;
}

.profile-points {
  display: grid;
  gap: 14px;
}

.profile-points article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 18px;
  padding: 24px;
  border-radius: 28px;
}

.profile-points span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #111;
  color: #fff;
  font-weight: 850;
}

.profile-points h3,
.profile-points p {
  grid-column: 2;
}

.profile-points p {
  margin-bottom: 0;
}

.work-showcase {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.work-categories {
  display: grid;
  gap: 52px;
}

.work-category {
  position: relative;
  display: grid;
  gap: 18px;
}

.work-category-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px;
}

.work-category-title > p {
  margin-left: auto;
}

.work-category-title h3 {
  margin: 0;
  font-size: clamp(1.7rem, 3.5vw, 3.25rem);
}

.work-category-title p {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.work-track-controls {
  position: absolute;
  inset: 50% 10px auto;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(12px);
}

.track-arrow {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: rgba(29, 29, 31, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  font-size: 1.8rem;
  line-height: 1;
  backdrop-filter: blur(18px) saturate(180%);
  pointer-events: auto;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.track-arrow:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(17, 17, 17, 0.62);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.track-arrow:active {
  transform: translateY(0) scale(0.96);
}

.work-track {
  display: grid;
  grid-auto-columns: minmax(300px, 32%);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  padding: 10px 4px 18px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.work-track.is-programmatic-scroll {
  scroll-snap-type: none;
}

.work-track::-webkit-scrollbar {
  display: none;
}

.work-scrollbar {
  position: relative;
  height: 8px;
  margin: -4px 4px 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  cursor: pointer;
}

.work-scrollbar-thumb {
  position: absolute;
  inset: 0 auto 0 0;
  width: 22%;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transform: translate3d(0, 0, 0);
  will-change: transform, width;
  transition: background 180ms ease;
  cursor: grab;
  touch-action: none;
}

.work-scrollbar:hover .work-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.58);
}

.work-scrollbar-thumb:active {
  cursor: grabbing;
}

.work-scrollbar.is-dragging .work-scrollbar-thumb {
  transition: none;
}

.work-track .work-card {
  min-height: 430px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.work-showcase-single {
  grid-template-columns: 1fr;
}

.work-showcase-single .work-card {
  min-height: 520px;
}

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

.work-showcase-triple .work-card {
  min-height: 430px;
}

.work-card {
  --mx: 50%;
  --my: 50%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7), transparent 16rem),
    linear-gradient(135deg, #141416 0%, #30343d 48%, #6b87b5 100%);
  box-shadow: var(--shadow);
  transform: perspective(1100px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0);
  transform-style: preserve-3d;
  transition: transform 260ms ease, box-shadow 260ms ease, filter 260ms ease;
  isolation: isolate;
  user-select: none;
}

.work-card:hover {
  box-shadow: 0 42px 120px rgba(0, 0, 0, 0.22);
  filter: saturate(1.12) contrast(1.04);
}

.work-card:nth-child(2) {
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.42), transparent 13rem),
    linear-gradient(135deg, #0f172a 0%, #254061 56%, #7aa1c4 100%);
}

.work-card:nth-child(3) {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.36), transparent 12rem),
    linear-gradient(135deg, #271317 0%, #733321 52%, #ff9f5a 100%);
}

.work-card.has-cover {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.74) 100%),
    var(--cover-image) center / cover no-repeat;
}

.work-card-large {
  grid-row: span 2;
  min-height: 660px;
}

.work-showcase-single .work-card-large {
  grid-row: auto;
}

.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: inherit;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.42), transparent 17rem),
    linear-gradient(120deg, transparent 12%, rgba(255, 255, 255, 0.22) 24%, transparent 36%);
  background-size: auto, 220% 100%;
  background-position: center, 120% 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, background-position 600ms ease;
}

.work-card:hover::before {
  opacity: 1;
  background-position: center, -40% 0;
}

.work-card::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -18%;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(8px);
  transition: transform 500ms ease, opacity 300ms ease;
}

.work-card:hover::after {
  opacity: 0.78;
  transform: translate(-8%, -8%) scale(1.18);
}

.magic-orb {
  position: absolute;
  left: var(--mx);
  top: var(--my);
  z-index: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 8%, rgba(122, 194, 255, 0.34) 18%, rgba(110, 92, 255, 0.12) 44%, transparent 68%);
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.72);
  transition: opacity 220ms ease, transform 300ms ease;
}

.work-card:hover .magic-orb {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.magic-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.magic-particles span {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--s, 6px);
  height: var(--s, 6px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.95),
    0 0 34px rgba(0, 149, 255, 0.58);
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.3);
}

.work-card:hover .magic-particles span {
  animation: floatParticle var(--d, 3.8s) ease-in-out infinite;
  opacity: 0.88;
}

.magic-particles span:nth-child(1) {
  --x: 18%;
  --y: 22%;
  --s: 5px;
  --d: 3.5s;
}

.magic-particles span:nth-child(2) {
  --x: 78%;
  --y: 18%;
  --s: 7px;
  --d: 4.3s;
}

.magic-particles span:nth-child(3) {
  --x: 34%;
  --y: 62%;
  --s: 4px;
  --d: 3.1s;
}

.magic-particles span:nth-child(4) {
  --x: 84%;
  --y: 68%;
  --s: 6px;
  --d: 4s;
}

.magic-particles span:nth-child(5) {
  --x: 56%;
  --y: 32%;
  --s: 4px;
  --d: 3.7s;
}

.magic-particles span:nth-child(6) {
  --x: 26%;
  --y: 82%;
  --s: 8px;
  --d: 4.6s;
}

.work-play {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: clamp(24px, 3vw, 38px);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
  color: #fff;
  text-align: left;
  transform: translateZ(34px);
  isolation: isolate;
}

.work-card small {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-card strong {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
  min-height: 2.28em;
  margin-bottom: 0;
  overflow: hidden;
  font-size: clamp(1.32rem, 1.62vw, 1.72rem);
  line-height: 1.14;
  letter-spacing: -0.045em;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.work-card strong.has-title-suffix {
  display: flex;
  min-height: 2.38em;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.04em;
}

[data-work-track="ai"] .work-card strong {
  min-height: 1.14em;
  font-size: clamp(1.08rem, 1.45vw, 1.48rem);
}

[data-work-track="ai"] .work-card strong.has-title-suffix {
  display: -webkit-box;
}

[data-work-track="ai"] .work-card strong.has-title-suffix span {
  display: inline;
  white-space: normal;
}

[data-work-track="ai"] .work-title-suffix {
  margin-inline-start: 0.22em;
}

.work-title-main,
.work-title-suffix {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-title-suffix {
  letter-spacing: -0.02em;
}

.work-card em {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.76);
  font-style: normal;
}

.experience-stack {
  display: grid;
  gap: 16px;
}

.experience-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.experience-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  width: 100%;
  padding: 26px 30px;
  background: transparent;
  text-align: left;
}

.experience-toggle span {
  display: grid;
  gap: 8px;
}

.experience-toggle small {
  color: var(--blue);
  font-weight: 750;
}

.experience-toggle strong {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  letter-spacing: -0.04em;
}

.experience-toggle em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.experience-toggle::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  grid-column: 3;
  grid-row: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 220ms ease;
}

.experience-card.is-open .experience-toggle::after {
  transform: rotate(45deg);
}

.experience-detail {
  display: grid;
  max-height: 0;
  overflow: hidden;
  padding: 0 30px;
  transition: max-height 280ms ease, padding 280ms ease;
}

.experience-card.is-open .experience-detail {
  max-height: 720px;
  padding: 0 30px 30px;
}

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

.detail-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-grid div {
  min-height: 168px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.detail-grid b {
  display: inline-flex;
  margin-bottom: 12px;
  color: #111;
  font-size: 0.9rem;
}

.detail-grid p {
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.72;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.filter {
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-weight: 760;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.filter:hover,
.filter.is-active {
  background: #111;
  color: #fff;
  transform: translateY(-1px);
}

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

.skill-grid span {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(0, 113, 227, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.72);
  color: #303034;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.skill-grid span.is-dimmed {
  opacity: 0.22;
  filter: grayscale(1);
  transform: scale(0.96);
}

.contact {
  padding: 70px 0 110px;
}

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 7vw, 72px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 70% 15%, rgba(0, 113, 227, 0.26), transparent 34rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 247, 0.76));
  text-align: center;
}

.contact-card h2 {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.contact-card p {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.contact-actions {
  justify-content: center;
  margin-top: 26px;
}

.contact-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 760px;
  margin: 30px auto 0;
}

.contact-mini-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  text-align: left;
  backdrop-filter: blur(18px) saturate(180%);
}

.contact-mini-card span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-mini-card a {
  color: #1d1d1f;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  word-break: break-all;
}

.contact-phone {
  display: inline-grid;
  gap: 4px;
  width: fit-content;
  text-decoration: none;
}

.contact-phone small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.contact-mini-card .button {
  width: fit-content;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.88);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes floatParticle {
  0% {
    transform: translate3d(0, 18px, 0) scale(0.25);
    opacity: 0;
  }
  24% {
    opacity: 0.95;
  }
  58% {
    transform: translate3d(18px, -28px, 0) scale(1);
  }
  100% {
    transform: translate3d(-18px, -68px, 0) scale(0.25);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .hero,
  .education-layout,
  .education-card-grid,
  .profile-grid,
  .work-showcase {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 120px;
  }

  .device-card {
    width: min(380px, 100%);
    justify-self: center;
  }

  .stats,
  .skill-grid,
  .detail-grid,
  .detail-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card-large {
    grid-row: auto;
    min-height: 460px;
  }

  .work-showcase-triple {
    grid-template-columns: 1fr;
  }
}

body.is-phone-frame .hero {
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 12px;
  align-items: start;
  min-height: auto;
  padding: 118px 0 48px;
}

body.is-phone-frame .education-layout,
body.is-phone-frame .profile-grid,
body.is-phone-frame .work-showcase {
  grid-template-columns: 1fr;
}

body.is-phone-frame .hero-copy {
  min-width: 0;
}

body.is-phone-frame .device-card {
  width: 124px;
  padding: 8px;
  justify-self: end;
  align-self: start;
  margin-top: 92px;
  border-radius: 24px;
}

body.is-phone-frame .device-card img {
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
}

body.is-phone-frame .device-glow {
  inset: -18px;
  filter: blur(16px);
  opacity: 0.56;
}

body.is-phone-frame .stats,
body.is-phone-frame .detail-grid,
body.is-phone-frame .detail-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.is-phone-frame .skill-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.is-phone-frame #skills {
  display: none;
}

body.is-phone-frame .work-showcase-triple {
  grid-template-columns: 1fr;
}

body.is-phone-frame .topbar {
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  width: max-content;
  max-width: calc(100% - 22px);
  min-height: 48px;
  overflow-x: auto;
  justify-content: center;
  gap: 8px;
  padding: 6px 8px;
}

body.is-phone-frame .nav {
  min-width: max-content;
  gap: 0;
}

body.is-phone-frame .nav a {
  padding: 9px 9px;
  font-size: 0.82rem;
}

body.is-phone-frame .nav a[href="#skills"] {
  display: none;
}

body.is-phone-frame h1 {
  margin-bottom: 18px;
  font-size: clamp(3.28rem, 18vw, 4.2rem);
  line-height: 0.9;
  letter-spacing: -0.085em;
}

body.is-phone-frame h2 {
  font-size: clamp(2.12rem, 11.5vw, 2.72rem);
  line-height: 1.02;
  letter-spacing: -0.07em;
}

body.is-phone-frame .lead {
  margin-bottom: 18px;
  font-size: 0.9rem;
  line-height: 1.46;
}

body.is-phone-frame .lead::first-line {
  color: #3a3a3c;
  font-weight: 400;
}

body.is-phone-frame .lead strong {
  color: var(--ink);
  font-weight: 800;
}

body.is-phone-frame .eyebrow {
  margin-bottom: 10px;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
}

body.is-phone-frame .hero-name {
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

body.is-phone-frame h1 {
  margin-bottom: 12px;
  font-size: clamp(2.42rem, 13.4vw, 3rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

body.is-phone-frame .section {
  padding: 34px 0;
  scroll-margin-top: 78px;
}

body.is-phone-frame .hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  grid-column: 1 / -1;
  width: min(230px, 68%);
  margin-top: 0;
}

body.is-phone-frame .hero-actions > :not(:first-child) {
  display: none;
}

body.is-phone-frame .hero-actions > :first-child {
  grid-column: auto;
}

body.is-phone-frame .stats {
  gap: 7px;
  margin-top: -24px;
  margin-bottom: 30px;
}

body.is-phone-frame .stats article {
  min-height: 86px;
  padding: 12px 13px;
  border-radius: 16px;
}

body.is-phone-frame .stats strong {
  margin-bottom: 5px;
  font-size: 1.42rem;
  line-height: 1;
}

body.is-phone-frame .stats span {
  font-size: 0.72rem;
  line-height: 1.28;
}

body.is-phone-frame .profile-points article,
body.is-phone-frame .experience-toggle {
  grid-template-columns: 1fr;
}

body.is-phone-frame .profile-points h3,
body.is-phone-frame .profile-points p {
  grid-column: 1;
}

body.is-phone-frame .experience-card {
  position: relative;
  border-radius: 26px;
}

body.is-phone-frame .experience-card.is-open .experience-detail {
  max-height: 1180px;
  padding: 0 16px 16px;
}

body.is-phone-frame .experience-toggle {
  position: relative;
  gap: 8px;
  min-height: 112px;
  padding: 16px 60px 14px 18px;
}

body.is-phone-frame .experience-toggle span {
  gap: 5px;
}

body.is-phone-frame .experience-toggle small {
  font-size: 0.82rem;
}

body.is-phone-frame .experience-toggle strong {
  font-size: 1.12rem;
  line-height: 1.12;
}

body.is-phone-frame .experience-toggle em {
  font-size: 0.8rem;
  line-height: 1.32;
}

body.is-phone-frame .experience-toggle::after {
  position: absolute;
  right: 18px;
  top: 50%;
  left: auto;
  bottom: auto;
  width: 30px;
  height: 30px;
  grid-column: auto;
  grid-row: auto;
  transform: translateY(-50%);
}

body.is-phone-frame .experience-card.is-open .experience-toggle::after {
  transform: translateY(-50%) rotate(45deg);
}

body.is-phone-frame #experience {
  padding-top: 34px;
  padding-bottom: 34px;
}

body.is-phone-frame #experience .section-title.centered {
  margin-bottom: 18px;
}

body.is-phone-frame #experience h2 {
  font-size: 2.05rem;
  line-height: 0.95;
}

body.is-phone-frame #experience .experience-stack {
  gap: 10px;
}

body.is-phone-frame .detail-grid,
body.is-phone-frame .detail-grid.compact {
  grid-template-columns: 1fr;
  gap: 9px;
}

body.is-phone-frame .detail-grid div {
  min-height: auto;
  padding: 14px;
  border-radius: 18px;
}

body.is-phone-frame .detail-grid b {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

body.is-phone-frame .detail-grid p {
  font-size: 0.86rem;
  line-height: 1.58;
}

body.is-phone-frame .education-headline {
  max-width: 360px;
  font-size: clamp(1.86rem, 9.4vw, 2.18rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

body.is-phone-frame .education-hero-card {
  min-height: auto;
  padding: 16px;
  border-radius: 24px;
}

body.is-phone-frame .education-hero-card h3 {
  margin-bottom: 10px;
  font-size: 1.24rem;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

body.is-phone-frame .degree {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(100px, 0.75fr);
  gap: 7px;
  align-items: stretch;
  max-width: none;
  margin-bottom: 0;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
  font-size: 0.86rem !important;
  line-height: 1.22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
}

body.is-phone-frame .degree span {
  min-height: 30px;
  padding: 7px 8px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
}

body.is-phone-frame .degree span + span::before {
  display: none;
}

body.is-phone-frame .education-card-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(112px, 0.92fr);
  gap: 8px;
  margin-top: 12px;
}

body.is-phone-frame .education-card-grid > div,
body.is-phone-frame .contact-mini-card {
  min-height: auto;
  padding: 12px;
  border-radius: 18px;
}

body.is-phone-frame .education-card-label {
  margin-bottom: 8px;
  font-size: 0.56rem;
}

body.is-phone-frame .course-strip {
  gap: 6px;
}

body.is-phone-frame .course-strip span {
  padding: 7px 9px;
  font-size: 0.76rem;
  line-height: 1.16;
}

body.is-phone-frame .course-strip span:nth-child(n + 4) {
  display: none;
}

body.is-phone-frame .credential-inline h4 {
  font-size: 0.92rem;
  line-height: 1.1;
}

body.is-phone-frame .credential-inline p {
  font-size: 0.78rem;
  line-height: 1.45;
}

body.is-phone-frame .work-track {
  grid-auto-columns: minmax(206px, 66%);
  gap: 10px;
  padding-bottom: 8px;
}

body.is-phone-frame #works {
  padding-top: 34px;
}

body.is-phone-frame #works .section-title.centered {
  margin-bottom: 18px;
}

body.is-phone-frame #works h2 {
  font-size: 2.35rem;
  line-height: 0.98;
}

body.is-phone-frame .work-category {
  margin-top: 28px;
}

body.is-phone-frame .work-categories {
  gap: 22px;
}

body.is-phone-frame .work-card,
body.is-phone-frame .work-card-large,
body.is-phone-frame .work-showcase-single .work-card,
body.is-phone-frame .work-track .work-card {
  min-height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
}

body.is-phone-frame .work-category-title {
  display: grid;
  gap: 4px;
  padding: 0 2px;
}

body.is-phone-frame .work-category-title h3 {
  font-size: 1.85rem;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

body.is-phone-frame .work-category-title > p {
  margin-left: 0;
}

body.is-phone-frame .work-category-title p {
  margin-bottom: 0;
  font-size: 0.68rem;
}

body.is-phone-frame .work-track-controls {
  inset: 52% 4px auto;
}

body.is-phone-frame .work-scrollbar {
  height: 6px;
  margin-top: -2px;
}

body.is-phone-frame .work-play {
  padding: 16px;
}

body.is-phone-frame .work-card strong {
  min-height: 2.06em;
  font-size: clamp(0.98rem, 4.1vw, 1.08rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

body.is-phone-frame .work-card strong.has-title-suffix {
  min-height: 2.08em;
  gap: 0.02em;
}

body.is-phone-frame [data-work-track="ai"] .work-card strong {
  min-height: 1.14em;
  font-size: clamp(0.9rem, 3.7vw, 1rem);
}

body.is-phone-frame .button,
body.is-phone-frame .contact-mini-card .button {
  width: 100%;
}

body.is-phone-frame .contact-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.is-phone-frame .contact-mini-card {
  gap: 10px;
}

body.is-phone-frame .contact-mini-card a {
  font-size: 0.92rem;
  line-height: 1.4;
}

body.is-phone-frame .contact-mini-card .button {
  min-height: 42px;
  padding: 11px 14px;
  font-size: 0.92rem;
}

body.is-phone-frame .contact-card h2 {
  white-space: nowrap;
  font-size: clamp(1.72rem, 8.8vw, 2.15rem);
  letter-spacing: -0.075em;
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 520px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    top: calc(env(safe-area-inset-top, 0px) + 18px);
    overflow-x: auto;
    justify-content: flex-start;
  }

  .nav {
    min-width: max-content;
  }

  .nav a {
    padding: 9px 10px;
    font-size: 0.84rem;
  }

  h1 {
    font-size: 4.2rem;
  }

  h2 {
    font-size: 2.55rem;
  }

  .stats,
  .skill-grid,
  .detail-grid,
  .detail-grid.compact {
    grid-template-columns: 1fr;
  }

  .profile-points article {
    grid-template-columns: 1fr;
  }

  .profile-points h3,
  .profile-points p {
    grid-column: 1;
  }

  .experience-card {
    position: relative;
    border-radius: 26px;
  }

  .experience-toggle {
    position: relative;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 112px;
    padding: 16px 60px 14px 18px;
  }

  .experience-toggle::after {
    position: absolute;
    right: 18px;
    top: 50%;
    left: auto;
    bottom: auto;
    width: 30px;
    height: 30px;
    grid-column: auto;
    grid-row: auto;
    transform: translateY(-50%);
  }

  .experience-card.is-open .experience-toggle::after {
    transform: translateY(-50%) rotate(45deg);
  }

  .experience-card.is-open .experience-detail {
    max-height: 1180px;
    padding: 0 16px 16px;
  }

  .experience-toggle span {
    gap: 5px;
  }

  .experience-toggle small {
    font-size: 0.82rem;
  }

  .experience-toggle strong {
    font-size: 1.12rem;
    line-height: 1.12;
  }

  .experience-toggle em {
    font-size: 0.8rem;
    line-height: 1.32;
  }

  .experience-toggle::after {
    width: 30px;
    height: 30px;
  }

  #experience {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  #experience .section-title.centered {
    margin-bottom: 18px;
  }

  #experience h2 {
    font-size: 2.05rem;
    line-height: 0.95;
  }

  #experience .experience-stack {
    gap: 10px;
  }

  .detail-grid,
  .detail-grid.compact {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-grid div {
    min-height: auto;
    padding: 16px;
    border-radius: 18px;
  }

  .detail-grid b {
    margin-bottom: 8px;
    font-size: 0.78rem;
  }

  .detail-grid p {
    font-size: 0.86rem;
    line-height: 1.58;
  }

  .work-card,
  .work-card-large,
  .work-showcase-single .work-card,
  .work-track .work-card {
    min-height: auto;
    aspect-ratio: 1 / 1;
  }

  .work-track {
    grid-auto-columns: minmax(214px, 68%);
  }

  .work-category-title {
    display: grid;
  }

  .work-category-title > p {
    margin-left: 0;
  }

  .work-category-title p {
    margin-bottom: 0;
  }

  .work-track-controls {
    inset: 54% 4px auto;
  }

  .button {
    width: 100%;
  }

  .contact-mini-grid {
    grid-template-columns: 1fr;
  }

  .contact-mini-card .button {
    width: 100%;
  }
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 520px) {
  body {
    background:
      radial-gradient(circle at 50% -4%, rgba(0, 113, 227, 0.18), transparent 22rem),
      linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 64%, #fff 100%);
  }
}

@media (max-width: 520px), (pointer: coarse) and (max-height: 520px) {
  .viewport-switch {
    display: none;
  }

  #skills {
    display: none;
  }

  main {
    width: min(100% - 18px, 1180px);
  }

  .topbar {
    top: calc(env(safe-area-inset-top, 0px) + 18px);
    width: max-content;
    max-width: calc(100% - 22px);
    min-height: 48px;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
  }

  .brand {
    width: 64px;
    height: 34px;
  }

  .nav a[href="#skills"] {
    display: none;
  }

  .nav {
    gap: 0;
  }

  .nav a {
    padding: 9px 8px;
    font-size: 0.8rem;
  }

  .resume-download {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .resume-download::before {
    content: "简历下载";
  }

  .resume-download {
    font-size: 0;
  }

  .resume-download::before {
    font-size: 0.8rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 12px;
    align-items: start;
    padding: 118px 0 48px;
  }

  .hero-copy {
    min-width: 0;
  }

  h1 {
    margin-bottom: 12px;
    font-size: clamp(2.42rem, 13.4vw, 3rem);
    line-height: 0.9;
    letter-spacing: -0.065em;
  }

  h2 {
    font-size: clamp(2.12rem, 11.5vw, 2.72rem);
    line-height: 1.02;
    letter-spacing: -0.07em;
  }

  .lead {
    margin-bottom: 18px;
    font-size: 0.9rem;
    line-height: 1.46;
  }

  .lead::first-line {
    color: #3a3a3c;
    font-weight: 400;
  }

  .lead strong {
    color: var(--ink);
    font-weight: 800;
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
  }

  .hero-name {
    margin-bottom: 12px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    grid-column: 1 / -1;
    width: min(230px, 68%);
    margin-top: 0;
  }

  .hero-actions > :not(:first-child) {
    display: none;
  }

  .device-card {
    width: 124px;
    padding: 8px;
    justify-self: end;
    align-self: start;
    margin-top: 92px;
    border-radius: 24px;
  }

  .device-card img {
    height: auto;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
  }

  .device-glow {
    inset: -18px;
    filter: blur(16px);
    opacity: 0.56;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: -24px;
    margin-bottom: 30px;
  }

  .stats article {
    min-height: 86px;
    padding: 12px 13px;
    border-radius: 16px;
  }

  .stats strong {
    margin-bottom: 5px;
    font-size: 1.42rem;
    line-height: 1;
  }

  .stats span {
    font-size: 0.72rem;
    line-height: 1.28;
  }

  .section {
    padding: 34px 0;
    scroll-margin-top: 78px;
  }

  .section-title.centered {
    margin-bottom: 28px;
  }

  .education-headline {
    max-width: 360px;
    font-size: clamp(1.86rem, 9.4vw, 2.18rem);
    line-height: 1.06;
    letter-spacing: -0.055em;
  }

  .education-hero-card {
    min-height: auto;
    padding: 16px;
    border-radius: 24px;
  }

  .education-hero-card h3 {
    margin-bottom: 10px;
    font-size: 1.24rem;
    line-height: 1.12;
    letter-spacing: -0.04em;
  }

  .degree {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(100px, 0.75fr);
    gap: 7px;
    align-items: stretch;
    max-width: none;
    margin-bottom: 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.36);
    font-size: 0.86rem !important;
    line-height: 1.22;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
  }

  .degree span {
    min-height: 30px;
    padding: 7px 8px;
    border: 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: none;
  }

  .degree span + span::before {
    display: none;
  }

  .education-hero-card::after {
    font-size: 7rem;
  }

  .education-card-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(112px, 0.92fr);
    gap: 8px;
    margin-top: 12px;
  }

  .education-card-grid > div,
  .contact-mini-card {
    min-height: auto;
    padding: 12px;
    border-radius: 18px;
  }

  .education-card-label {
    margin-bottom: 8px;
    font-size: 0.56rem;
  }

  .course-strip span,
  .filter {
    font-size: 0.76rem;
  }

  .course-strip {
    gap: 6px;
  }

  .course-strip span {
    padding: 7px 9px;
    line-height: 1.16;
  }

  .course-strip span:nth-child(n + 4) {
    display: none;
  }

  .credential-inline h4 {
    font-size: 0.92rem;
    line-height: 1.1;
  }

  .credential-inline p {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  #works {
    padding-top: 34px;
  }

  #works .section-title.centered {
    margin-bottom: 18px;
  }

  #works h2 {
    font-size: 2.35rem;
    line-height: 0.98;
  }

  .work-category {
    margin-top: 28px;
  }

  .work-categories {
    gap: 22px;
  }

  .work-category-title {
    gap: 4px;
    padding: 0 2px;
  }

  .work-category-title h3 {
    font-size: 1.85rem;
    line-height: 1.02;
    letter-spacing: -0.055em;
  }

  .work-category-title p {
    font-size: 0.68rem;
  }

  .work-track {
    grid-auto-columns: minmax(206px, 66%);
    gap: 10px;
    padding: 8px 2px 8px;
  }

  .work-track .work-card {
    min-height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
  }

  .work-play {
    padding: 16px;
  }

  .work-card strong {
    font-size: clamp(0.98rem, 4.1vw, 1.08rem);
    line-height: 1.05;
  }

  [data-work-track="ai"] .work-card strong {
    font-size: clamp(0.9rem, 3.7vw, 1rem);
  }

  .track-arrow {
    width: 40px;
    height: 40px;
  }

  .work-scrollbar {
    height: 6px;
    margin-top: -2px;
  }

  .contact {
    padding: 56px 0 92px;
  }

  .contact-card {
    padding: 30px 18px;
    border-radius: 30px;
  }

  .contact-card h2 {
    white-space: nowrap;
    font-size: clamp(1.72rem, 8.8vw, 2.15rem);
    letter-spacing: -0.075em;
  }

  .contact-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .contact-mini-card {
    gap: 10px;
  }

  .contact-mini-card a {
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .contact-mini-card .button {
    min-height: 42px;
    padding: 11px 14px;
    font-size: 0.92rem;
  }

  .viewport-switch {
    right: 50%;
    bottom: 12px;
    transform: translateX(50%);
  }

  body::before {
    background-size: 44px 44px;
    opacity: 0.36;
  }

  .aurora {
    min-width: 280px;
    min-height: 280px;
    filter: blur(42px);
  }
}

@media (max-width: 340px) {
  .topbar {
    width: calc(100% - 12px);
    max-width: none;
  }

  .nav a[href="#contact"] {
    display: none;
  }
}

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

/* Video playback and contact improvements. */
[hidden] { display: none !important; }

body.has-video-open {
  position: fixed;
  top: var(--video-scroll-offset, 0);
  width: 100%;
  overflow: hidden;
}

.contact-button-group { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-mini-card .button { min-height: 44px; font-size: 0.92rem; letter-spacing: 0; }
.contact-mini-card .button-dark { color: #fff; }
.mobile-contact-bar { display: none; }
#contact { scroll-margin-top: 100px; }
a:focus-visible, button:focus-visible, video:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

/* Fit the video to the viewport without cropping its source frame. */
#portfolio-player {
  --video-aspect: 1.777778;
  --player-inline-gap: max(clamp(10px, 3vw, 32px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --player-block-gap: max(clamp(12px, 3dvh, 28px), env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px));
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 2 * var(--player-inline-gap)), calc((100dvh - 2 * var(--player-block-gap)) * var(--video-aspect)));
  height: fit-content;
  max-width: none;
  max-height: calc(100dvh - 2 * var(--player-block-gap));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: clamp(12px, 2vw, 22px);
  color: #f7f6f4;
  background: #08090a;
  box-shadow: 0 24px 88px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
  overscroll-behavior: contain;
}

#portfolio-player[open].is-opening {
  opacity: 1;
  transform: none;
}

#portfolio-player::backdrop {
  background: radial-gradient(ellipse at 50% 44%, rgba(12, 13, 15, 0.72), rgba(5, 6, 8, 0.92) 90%);
  backdrop-filter: blur(16px) saturate(0.65);
}

.video-dialog-heading {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(10px, 2vw, 20px) clamp(12px, 2.4vw, 28px);
  isolation: isolate;
  pointer-events: none;
}

.video-dialog-heading::before {
  content: "";
  position: absolute;
  inset: 0 0 -26px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.77), rgba(0, 0, 0, 0.45) 49%, transparent);
}

.video-dialog-heading h3 {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: clamp(0.88rem, 1.35vw, 1.08rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.85);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-dialog-title-group {
  min-width: 0;
}

.video-rights-note {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.69rem, 1.05vw, 0.78rem);
  line-height: 1.35;
  text-shadow: 0 1px 8px #000;
}

.video-dialog-heading .dialog-close {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  color: #fff;
  background: rgba(16, 17, 20, 0.5);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.dialog-close::before,
.dialog-close::after {
  content: "";
  grid-area: 1 / 1;
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.dialog-close::after {
  transform: rotate(-45deg);
}

.video-dialog-heading .dialog-close:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(48, 49, 52, 0.8);
}

.video-dialog-heading .dialog-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--video-aspect);
  background: #000;
}

.video-frame video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#portfolio-player .video-note {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.video-status {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(88%, 360px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(16, 17, 20, 0.94);
  color: #fff;
  text-align: center;
  transform: translate(-50%, -50%);
}
.video-status p { margin: 0; font-size: 0.88rem; line-height: 1.65; }
.video-status .button { width: auto; min-height: 44px; padding: 10px 20px; color: #111; background: #fff; }
.video-frame[data-state="loading"] .video-status::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.has-video-open .mobile-contact-bar,
.has-phone-preview-open .mobile-contact-bar { display: none; }

@media (max-width: 720px), (pointer: coarse) and (max-height: 520px) {
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .viewport-switch { display: none; }
  .mobile-contact-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 24;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(250, 250, 252, 0.96);
    backdrop-filter: blur(18px);
  }
  .mobile-contact-bar .button { min-height: 46px; padding: 12px; font-size: 0.88rem; }
  .contact-button-group { display: grid; grid-template-columns: 1fr 1fr; }
  .contact-mini-grid { grid-template-columns: 1fr; }
  .contact-mini-card { padding: 18px; gap: 12px; }
  .contact-button-group .button { width: 100%; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 24px); text-align: center; }
}

body.is-phone-frame .contact-mini-grid { grid-template-columns: 1fr; }


@media (any-pointer: coarse) and (max-width: 950px), (any-pointer: coarse) and (max-height: 520px) {
  .work-track,
  .work-track .work-card,
  .work-track .work-play {
    touch-action: pan-y pinch-zoom;
  }

  .work-track.is-touch-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }
}

.video-dialog-heading {
  padding: 8px 12px;
}

.video-dialog-heading::before {
  content: none;
}

.video-dialog-heading h3 {
  color: rgb(255 255 255 / 78%);
  font-size: clamp(0.72rem, 1.2vw, 0.9rem);
}

.video-dialog-heading .video-rights-note {
  color: rgb(255 255 255 / 67%);
}

.video-fullscreen {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(52px, env(safe-area-inset-bottom));
  z-index: 2;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 999px;
  background: rgb(0 0 0 / 14%);
  color: #fff;
  font-size: 0.72rem;
  text-shadow: 0 1px 4px #000;
  cursor: pointer;
}

.video-fullscreen:hover,
.video-fullscreen:focus-visible {
  background: rgb(0 0 0 / 35%);
}


/* Keep the same video element when native fullscreen is unavailable. */
#portfolio-player.is-viewport-fullscreen {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
}

#portfolio-player.is-viewport-fullscreen .video-frame {
  height: 100%;
  aspect-ratio: auto;
}

/* Keep the document within the viewport while tracks scroll independently. */
body { overflow-x: clip; }
.work-category, .work-track { min-width: 0; }

@media (max-width: 720px), (pointer: coarse) and (max-height: 520px) {
  .topbar {
    left: 0;
    right: 0;
    margin-inline: auto;
    transform: none;
  }

  .mobile-contact-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Keep the close target easy to tap while shrinking the visible icon. */
.video-dialog-heading .dialog-close {
  border-color: transparent;
  background: transparent;
  backdrop-filter: none;
}

.dialog-close::before,
.dialog-close::after {
  width: 11px;
  filter: drop-shadow(0 0 2px #000);
}

#portfolio-player.is-viewport-fullscreen .video-frame video {
  inset: 0;
  margin: auto;
  width: min(100%, calc(100dvh * var(--video-aspect)));
  height: auto;
  max-height: 100%;
  aspect-ratio: var(--video-aspect);
}
