:root {
  color-scheme: light;
  background: #f6f3ed;
  color: #292523;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 0;
}

html {
  overscroll-behavior-y: none;
}

.profile {
  --avatar-size: clamp(160px, min(25vw, 40svh), 360px);
  --name-size: calc(var(--avatar-size) * 0.2);
  --scroll-distance: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  text-align: center;
}

.profile.has-scroll-effect {
  min-height: calc(100svh + var(--scroll-distance));
}

.scene {
  isolation: isolate;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding: max(24px, calc(34svh - var(--avatar-size) / 2)) 24px 48px;
}

.avatar-anchor {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: min(var(--avatar-size), 100%);
  transform-origin: center;
  will-change: transform;
}

.avatar {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}

.intro {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  margin-top: clamp(12px, 2svh, 20px);
}

.name-orbit,
.tagline-orbit {
  flex-shrink: 0;
  max-width: 100%;
  will-change: transform, opacity;
}

.tagline-orbit {
  margin-top: clamp(12px, 2svh, 20px);
}

.nameplate {
  width: max-content;
  max-width: 100%;
  opacity: 0;
}

.name {
  margin: 0;
  font-size: var(--name-size);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.paper-background,
.orbit-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.paper-background {
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 12% 15%, #d8d3c94d, transparent 48%),
    radial-gradient(ellipse at 94% 84%, #a3342c0c, transparent 44%),
    #f6f3ed;
}

.paper-background::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.19;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.25' filter='url(%23grain)'/%3E%3C/svg%3E");
}

.ink-halo {
  position: absolute;
  inset: 8% -10% -25% 18%;
  background: radial-gradient(ellipse, #b9b1a71c, transparent 66%);
  opacity: calc(0.3 + var(--page-progress, 0) * 0.7);
}

.orbit-rail {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--orbit-radius, 160px) * 2);
  height: calc(var(--orbit-radius, 160px) * 2);
  border: 1px solid #9d918127;
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: var(--navigation-progress, 0);
}

.orbit-rail-outer {
  margin: 0 0 0 -22px;
  width: calc(var(--orbit-radius, 160px) * 2 + 44px);
  height: calc(var(--orbit-radius, 160px) * 2 + 44px);
  border-color: #9d918113;
}

.orbit-nav {
  z-index: 3;
}

.section-button {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  width: clamp(202px, 23vw, 264px);
  min-height: 76px;
  padding: 15px 20px;
  color: #37312b;
  font: inherit;
  text-align: left;
  border: 1px solid #b9ac983e;
  border-radius: 24px;
  background: #fcfaf5ed;
  box-shadow: 0 6px 24px #55433206;
  cursor: pointer;
  opacity: var(--button-opacity, 0);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.orbit-nav.is-interactive .section-button {
  pointer-events: auto;
}

.section-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  color: #8d7462;
  border-radius: 50%;
  background: #e9e1d754;
}

.section-icon svg {
  width: 23px;
  height: 23px;
}

.section-title {
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: var(--title-opacity, 1);
}

.section-number {
  margin-left: auto;
  color: #aaa096;
  font: 10px Arial, sans-serif;
  letter-spacing: 0.06em;
  opacity: var(--title-opacity, 1);
}

.section-button[aria-pressed="true"] {
  color: #9b3028;
  border-color: #a3342c45;
  box-shadow: 0 10px 36px #a3342c0b;
}

.section-button[aria-pressed="true"] .section-icon {
  color: #a3342c;
  background: #a3342c0c;
}

.section-button:focus-visible {
  outline: 2px solid #a3342c;
  outline-offset: 5px;
  opacity: 1;
}

.section-button:focus-visible .section-title,
.section-button:focus-visible .section-number {
  opacity: 1;
}

@media (hover: hover) {
  .section-button:hover {
    border-color: #a3342c60;
    opacity: 1;
  }

  .section-button:hover .section-title,
  .section-button:hover .section-number {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .section-button {
    gap: 10px;
    min-height: 70px;
    padding: 14px 16px;
    border-radius: 22px;
  }
}

.username {
  margin: calc(var(--name-size) * -0.02) 0 0;
  color: #8a817c;
  font-family: Arial, sans-serif;
  font-size: max(12px, calc(var(--name-size) * 0.39));
  font-weight: 500;
  line-height: 1;
}

.username-letters {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.tagline {
  opacity: 0;
  margin: 0;
  color: #a3342c;
  font-size: calc(var(--avatar-size) * 0.125);
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.profile.is-ready .avatar {
  animation: avatar-enter 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.profile.is-ready .nameplate {
  animation: intro-enter 500ms cubic-bezier(0.22, 1, 0.36, 1) 900ms both;
}

.profile.is-ready .tagline {
  animation: intro-enter 300ms cubic-bezier(0.22, 1, 0.36, 1) 1400ms both;
}

@keyframes avatar-enter {
  from {
    opacity: 0;
    transform: translateY(36px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes intro-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar,
  .nameplate,
  .tagline {
    opacity: 1;
  }

  .profile.is-ready .avatar,
  .profile.is-ready .nameplate,
  .profile.is-ready .tagline {
    animation: none;
  }
}
