:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  --page: #ffffff;
  --ink: #1b1b1b;
  --muted: #5c5c5c;
  --accent: #006f67;
  --action: #20d5c8;
  --action-ink: #07312d;
  --glass: #ffffffb8;
  --rim: #ececec;
  --rim-shade: #00000017;
  --well: #00000008;
  --panel: #fffffff5;
  --shadow: 0 14px 44px #0000000d, inset 0 1px 1px #ffffffed, inset 0 -1px 1px var(--rim-shade);
  --ease: cubic-bezier(.2, .75, .22, 1);
  background: var(--page);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #151515;
    --ink: #f5f5f5;
    --muted: #bdbdbd;
    --accent: #77eadf;
    --glass: #272727b8;
    --rim: #ffffff26;
    --rim-shade: #00000076;
    --well: #ffffff0f;
    --panel: #242424f5;
    --shadow: 0 16px 44px #040c135c, inset 0 1px 1px #ffffff26, inset 0 -1px 1px var(--rim-shade);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font-size: 15px; line-height: 1.7; }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 8px 14px; background: var(--panel); transform: translateY(-160%); }
.skip:focus { transform: none; }

.glass { background: var(--glass); border: 1px solid var(--rim); box-shadow: var(--shadow); }
.site-header { position: sticky; top: 14px; z-index: 5; margin-top: 16px; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 62px; padding: 8px 10px 8px 22px; border-radius: 999px; backdrop-filter: blur(14px) saturate(145%); }
.site-name { display: inline-flex; gap: 10px; align-items: baseline; font-weight: 750; text-decoration: none; white-space: nowrap; }
.site-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.page-nav { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(270px, 60%); padding: 3px; border-radius: 999px; background: var(--well); }
.page-nav a { z-index: 1; padding: 7px 3px; text-align: center; white-space: nowrap; text-decoration: none; font-size: 13px; color: var(--muted); border-radius: 999px; }
.page-nav a:hover, .page-nav a[aria-current] { color: var(--ink); }
.nav-pill { position: absolute; inset: 3px auto 3px 3px; width: calc((100% - 6px) / 3); border-radius: 999px; background: var(--glass); border: 1px solid var(--rim); box-shadow: 0 4px 12px var(--rim-shade), inset 0 1px 1px var(--rim); transform: translateX(calc(var(--nav-index, 0) * 100%)); }

main { padding-top: 33px; }
.profile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 294px;
  padding: clamp(21px, 4vw, 38px);
  border-radius: 30px;
  background: #fff;
  color: #111;
}
.profile-banner {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 75%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(to right, transparent, #000 38%);
}
.profile-content { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.profile h1 { font-size: clamp(36px, 5vw, 59px); letter-spacing: -.065em; }
.profile p { max-width: 26em; color: #1b1b1b; }
.avatar { display: grid; place-items: center; width: 58px; height: 58px; overflow: hidden; border: 1px solid #ddd; border-radius: 20px; background: #f5f5f5; color: #006f67; font-weight: 750; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 15px; border: 1px solid var(--rim); border-radius: 999px; font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; }
.primary { background: var(--action); color: var(--action-ink); box-shadow: inset 0 1px 2px #ffffffa3; }
.primary:hover { background: #56e5d9; }
.secondary { background: var(--glass); color: var(--ink); }

.section { margin-top: 32px; scroll-margin-top: 94px; }
.heading { margin-bottom: 13px; }
.heading h2 { font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -.035em; }
.works { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 26px) / 3); gap: 13px; padding-block: 4px 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.works::-webkit-scrollbar { display: none; }
.work { min-width: 0; overflow: hidden; border-radius: 23px; background: var(--glass); border: 1px solid var(--rim); box-shadow: 0 7px 15px var(--rim-shade); scroll-snap-align: center; transform: scale(.88); }
.work.is-current { transform: none; }
.work-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--well); }
.work-media img, .work-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-media iframe { pointer-events: none; }
.work-play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; border: 0; background: transparent; color: white; cursor: pointer; }
.work-play:focus-visible { outline-offset: -4px; }
.work-play::after { content: "▶"; display: grid; place-items: center; width: 45px; height: 45px; padding-left: 2px; border-radius: 50%; border: 1px solid #ffffffad; background: #17363ea6; backdrop-filter: blur(8px); box-shadow: inset 0 1px 2px #ffffff63; }
.work-play:hover::after { background: #12615cdb; }
.work-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 13px 11px; }
.work h3 { font-size: 14px; overflow-wrap: anywhere; }
.work p, .work-caption a { font-size: 12px; color: var(--muted); }
.work-caption a { white-space: nowrap; text-decoration: none; }
.work-caption a:hover { text-decoration: underline; }
.work > p { padding: 0 13px 10px; }

#video-dialog { position: fixed; inset: 0; margin: auto; width: min(840px, calc(100% - 28px)); height: fit-content; max-height: calc(100dvh - 28px); padding: 17px; border-radius: 27px; background: var(--panel); color: var(--ink); }
#video-dialog::backdrop { background: #14283174; backdrop-filter: blur(5px); }
.video-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.video-heading h3 { overflow-wrap: anywhere; }
.video-player { aspect-ratio: 16 / 9; background: #10181a; border-radius: 14px; overflow: hidden; }
.video-player iframe, .work-media iframe { display: block; width: 100%; height: 100%; border: 0; }
#video-source { display: inline-block; margin-top: 9px; color: var(--accent); font-size: 13px; }

.portfolio-project, .support { display: grid; gap: 14px 30px; padding: clamp(18px, 3vw, 30px); border-radius: 28px; }
.portfolio-project { grid-template-columns: minmax(190px, .75fr) minmax(0, 1.25fr); }
.portfolio-project h3 { font-size: 18px; margin-bottom: 5px; }
.portfolio-project p, .support-copy p { color: var(--muted); }
.portfolio-project .project-stack { color: var(--accent); font-size: 13px; }
.support { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); align-items: center; }
.support-copy p { max-width: 34em; }
.support-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.support-codes figure { margin: 0; text-align: center; }
.support-codes img { width: 100%; height: auto; aspect-ratio: 1366 / 2048; object-fit: contain; object-position: center top; background: #fff; border-radius: 13px; }
.support-codes figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 15px; padding-block: 23px; color: var(--muted); font-size: 13px; }
.site-footer a { text-decoration: none; }

@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  main { padding-top: 20px; }
  .masthead { min-height: 52px; padding-left: 13px; }
  .site-label { display: none; }
  .profile { border-radius: 24px; }
  .profile-banner {
    width: 100%;
    height: 62%;
    mask-image: linear-gradient(to right, transparent, #000 58%);
    opacity: .42;
  }
  .works { grid-auto-columns: 100%; padding-inline: 13%; }
  .portfolio-project, .support { grid-template-columns: 1fr; }
  .support-codes { width: min(100%, 360px); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  main { animation: appear .42s var(--ease) both; }
  .nav-pill { transition: transform .32s var(--ease); }
  .work { transition: transform .24s var(--ease); }
  .works.is-wrapping .work { transition: none; }
  .button, .work-play::after { transition: background-color .2s ease; }
}
@keyframes appear {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
