.profile-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.profile-main {
  width: min(1500px, calc(100% - 64px));
  margin-inline: auto;
  padding: clamp(32px, 4vw, 58px) 0 64px;
}

.profile-card {
  background: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.timeline-copy p,
.timeline-date time,
.profile-card-foot {
  font-family: var(--mono);
  text-transform: uppercase;
}

.timeline {
  position: relative;
  height: 520px;
}

.timeline-axis {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 4%;
  left: 0;
  height: 1px;
  background: var(--ink);
}

.timeline-future {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 0;
  left: 96%;
  border-top: 1px dashed var(--ink);
  opacity: 0.58;
}

.timeline-mobile-end {
  display: none;
}

.timeline-axis i {
  position: absolute;
  top: 50%;
  left: 8%;
  padding: 0 8px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  letter-spacing: -0.18em;
  transform: translate(-50%, -50%);
}

.timeline-entry {
  --copy-x: -50%;
  position: absolute;
  z-index: auto;
  top: 0;
  height: 100%;
  pointer-events: none;
}

.timeline-point {
  left: var(--at);
  width: 0;
}

.timeline-period {
  left: var(--start);
  width: calc(var(--end) - var(--start));
}

.entry-birth {
  --at: 2%;
}

.entry-tongji {
  --start: 13%;
  --end: 40%;
}

.entry-niq {
  --start: 46%;
  --end: 87%;
}

.entry-yubeng {
  --at: 57%;
}

.entry-kula {
  --at: 64%;
}

.entry-gongga {
  --at: 73%;
}

.entry-wusun {
  --at: 80%;
}

.entry-prudential {
  --start: 91%;
  --end: 96%;
}

.entry-kailash {
  --at: 95%;
}

.timeline-date {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0.72;
  transition: opacity 180ms ease;
}

.timeline-date::before,
.timeline-date::after {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--ink);
  content: "";
  transform: translate(-50%, -50%);
}

.timeline-date::before {
  z-index: 2;
  width: 7px;
  height: 7px;
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.timeline-date::after {
  z-index: 1;
  width: 1px;
  height: 13px;
}

.timeline-date time {
  position: absolute;
  left: 0;
  width: max-content;
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.055em;
  line-height: 1;
  transform: translateX(-50%);
}

.date-up time {
  bottom: 15px;
}

.date-down time {
  top: 15px;
}

.date-label-left time {
  transform: translateX(-100%);
}

.date-label-right time {
  transform: none;
}

.timeline-date-start {
  left: 0;
}

.timeline-date-end {
  left: 100%;
}

.timeline-mark {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: block;
  opacity: 0.72;
  transition: background-color 180ms ease, height 180ms ease, opacity 180ms ease;
}

.timeline-point .timeline-mark {
  display: none;
}

.timeline-period .timeline-mark {
  right: 0;
  left: 0;
  height: 3px;
  background: var(--ink);
  transform: translateY(-50%);
}

.timeline-copy {
  position: absolute;
  z-index: 3;
  left: 50%;
  width: clamp(140px, 13vw, 198px);
  opacity: 0.72;
  pointer-events: auto;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.timeline-period {
  --copy-x: -50%;
}

.timeline-period .timeline-copy {
  left: 0;
}

.align-start {
  --copy-x: 0%;
}

.align-start .timeline-copy {
  left: 0;
}

.align-end {
  --copy-x: -100%;
}

.align-end .timeline-copy {
  left: 100%;
}

.above .timeline-copy {
  top: 50%;
  transform: translate(var(--copy-x), calc(-100% - 48px));
}

.below .timeline-copy {
  top: 50%;
  transform: translate(var(--copy-x), 48px);
}

.above.far .timeline-copy {
  transform: translate(var(--copy-x), calc(-100% - 132px));
}

.below.far .timeline-copy {
  transform: translate(var(--copy-x), 132px);
}

.timeline-copy p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.45;
}

.timeline-copy p a {
  text-decoration: none;
}

.timeline-copy h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(19px, 1.55vw, 25px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.timeline-copy h2 a {
  text-decoration: none;
}

.timeline-copy > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.location::before {
  margin-right: 5px;
  color: var(--ink);
  content: "⌖";
  font-family: var(--mono);
  font-size: 0.95em;
}

.timeline-entry:has(.timeline-copy:hover) .timeline-copy,
.timeline-entry:focus-within .timeline-copy,
.timeline-entry:has(.timeline-copy:hover) .timeline-date,
.timeline-entry:focus-within .timeline-date,
.timeline-entry:has(.timeline-copy:hover) .timeline-mark,
.timeline-entry:focus-within .timeline-mark {
  opacity: 1;
}

.timeline:has(.timeline-copy:hover) .timeline-entry:not(:has(.timeline-copy:hover)) > .timeline-copy,
.timeline:has(.timeline-copy:hover) .timeline-entry:not(:has(.timeline-copy:hover)) > .timeline-date,
.timeline:has(.timeline-copy:hover) .timeline-entry:not(:has(.timeline-copy:hover)) > .timeline-mark,
.timeline:has(.timeline-entry:focus-within) .timeline-entry:not(:focus-within) > .timeline-copy,
.timeline:has(.timeline-entry:focus-within) .timeline-entry:not(:focus-within) > .timeline-date,
.timeline:has(.timeline-entry:focus-within) .timeline-entry:not(:focus-within) > .timeline-mark {
  opacity: 0.24;
}

.timeline-entry:has(.timeline-copy:hover) .timeline-copy,
.timeline-entry:focus-within .timeline-copy {
  z-index: 8;
  color: var(--accent);
}

.timeline-entry:has(.timeline-copy:hover) .timeline-date,
.timeline-entry:focus-within .timeline-date {
  z-index: 7;
}

.timeline-entry:has(.timeline-copy:hover) .timeline-date::before,
.timeline-entry:has(.timeline-copy:hover) .timeline-date::after,
.timeline-entry:focus-within .timeline-date::before,
.timeline-entry:focus-within .timeline-date::after,
.timeline-entry:has(.timeline-copy:hover) .timeline-mark,
.timeline-entry:focus-within .timeline-mark,
.timeline-period:has(.timeline-copy:hover) .timeline-mark::before,
.timeline-period:has(.timeline-copy:hover) .timeline-mark::after,
.timeline-period:focus-within .timeline-mark::before,
.timeline-period:focus-within .timeline-mark::after {
  background: var(--accent);
}

.timeline-entry:has(.timeline-copy:hover) .timeline-mark,
.timeline-entry:focus-within .timeline-mark {
  z-index: 3;
}

.timeline-entry:has(.timeline-copy:hover) .timeline-date time,
.timeline-entry:focus-within .timeline-date time {
  color: var(--accent);
}

.timeline-period:has(.timeline-copy:hover) .timeline-mark,
.timeline-period:focus-within .timeline-mark {
  height: 5px;
}

.timeline-entry.above:has(.timeline-copy:hover) .timeline-copy,
.timeline-entry.above:focus-within .timeline-copy {
  transform: translate(var(--copy-x), calc(-100% - 54px));
}

.timeline-entry.below:has(.timeline-copy:hover) .timeline-copy,
.timeline-entry.below:focus-within .timeline-copy {
  transform: translate(var(--copy-x), 54px);
}

.timeline-entry.above.far:has(.timeline-copy:hover) .timeline-copy,
.timeline-entry.above.far:focus-within .timeline-copy {
  transform: translate(var(--copy-x), calc(-100% - 138px));
}

.timeline-entry.below.far:has(.timeline-copy:hover) .timeline-copy,
.timeline-entry.below.far:focus-within .timeline-copy {
  transform: translate(var(--copy-x), 138px);
}

.timeline-copy a:hover,
.timeline-copy a:focus-visible {
  color: var(--accent);
}

.profile-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.profile-card-foot span:not(:last-child)::after {
  margin-left: 8px;
  color: var(--accent);
  content: "/";
}

.profile-page .home-footer {
  border-top: 1px solid var(--line);
}

@media (max-width: 1050px) and (min-width: 761px) {
  .profile-main {
    width: min(100% - 44px, 1180px);
  }

  .timeline-copy {
    width: 132px;
  }

  .timeline-copy h2 {
    font-size: 20px;
  }

  .timeline-copy p {
    font-size: 8px;
  }
}

@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait), (hover: none) and (max-device-width: 700px) {
  .profile-page .home-header {
    position: relative;
  }

  .profile-main {
    width: min(100% - 64px, 760px);
    padding: 38px 0 64px;
  }

  .timeline {
    --future-length: clamp(42px, 6svh, 68px);
    display: grid;
    height: auto;
    gap: 34px;
    margin-bottom: clamp(100px, 16svh, 180px);
    padding-top: clamp(68px, 10svh, 116px);
  }

  .timeline-axis {
    top: 0;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: auto;
    background: color-mix(in srgb, var(--ink) 48%, transparent);
  }

  .timeline-axis::after {
    position: absolute;
    z-index: 1;
    top: var(--highlight-top, 0%);
    left: 0;
    width: 2px;
    height: var(--highlight-height, 0%);
    background: var(--accent);
    content: "";
    transform: translateX(-0.5px);
    transition:
      top 260ms cubic-bezier(0.22, 1, 0.36, 1),
      height 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .timeline-axis::before {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 50%;
    width: 9px;
    height: 9px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
    content: "";
    transform: translate(-50%, -50%);
  }

  .timeline-axis i {
    top: 32px;
    left: 50%;
    padding: 6px 0;
    letter-spacing: -0.2em;
    transform: translate(-50%, 0) rotate(90deg);
  }

  .timeline-future {
    top: auto;
    right: auto;
    bottom: calc(var(--future-length) * -1);
    left: 50%;
    width: 0;
    height: var(--future-length);
    border-top: 0;
    border-left: 1px dashed var(--ink);
  }

  .timeline-future::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 9px;
    height: 9px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
    content: "";
    transform: translate(-50%, 50%);
  }

  .timeline-entry,
  .timeline-point,
  .timeline-period {
    position: relative;
    top: auto;
    left: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: 0;
    width: auto;
    min-height: 132px;
    height: auto;
  }

  .entry-birth {
    order: 1;
  }

  .entry-tongji {
    order: 2;
  }

  .endpoint-tongji {
    order: 3;
  }

  .entry-niq {
    order: 4;
  }

  .entry-yubeng {
    order: 5;
  }

  .entry-kula {
    order: 6;
  }

  .entry-gongga {
    order: 7;
  }

  .entry-wusun {
    order: 8;
  }

  .endpoint-niq {
    order: 9;
  }

  .entry-prudential {
    order: 10;
  }

  .entry-kailash {
    order: 11;
  }

  .endpoint-now {
    order: 12;
  }

  .timeline-date,
  .timeline-date-start,
  .timeline-date-end {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
  }

  .timeline-date-end {
    display: none;
  }

  .timeline-date::before,
  .timeline-date::after {
    display: none;
  }

  .timeline-date time,
  .date-up time,
  .date-down time,
  .date-label-left time,
  .date-label-right time {
    position: absolute;
    top: -2px;
    bottom: auto;
    font-size: 9px;
    line-height: 1.15;
    white-space: nowrap;
    transform: none;
  }

  .timeline-period .timeline-date time {
    right: 22px;
    left: auto;
    text-align: right;
  }

  .timeline-point .timeline-date time {
    right: auto;
    left: 22px;
    text-align: left;
  }

  .timeline-mark,
  .timeline-point .timeline-mark,
  .timeline-period .timeline-mark {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    justify-self: center;
    transform: none;
  }

  .timeline-point .timeline-mark {
    display: block;
    align-self: start;
    width: 9px;
    height: 9px;
    margin-top: 4px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
  }

  .timeline-period .timeline-mark {
    grid-row: 1;
    align-self: start;
    width: 9px;
    min-height: 0;
    height: 9px;
    margin-top: 4px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
  }

  .timeline-period .timeline-mark::before,
  .timeline-period .timeline-mark::after {
    position: absolute;
    top: 0;
    left: 50%;
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    content: "";
    transform: translate(-50%, 0);
  }

  .timeline-period .timeline-mark::after {
    display: none;
  }

  .timeline-period .timeline-mark::before {
    display: none;
  }

  .timeline-copy,
  .align-start .timeline-copy,
  .align-end .timeline-copy,
  .above .timeline-copy,
  .below .timeline-copy,
  .above.far .timeline-copy,
  .below.far .timeline-copy {
    position: static;
    grid-row: 1;
    width: fit-content;
    max-width: calc(100% - 18px);
    padding-top: 30px;
    transform: none;
  }

  .timeline-period .timeline-copy {
    grid-column: 1;
    justify-self: end;
    padding-right: 22px;
    padding-left: 0;
    text-align: right;
  }

  .timeline-point .timeline-copy {
    grid-column: 3;
    justify-self: start;
    padding-right: 0;
    padding-left: 22px;
    text-align: left;
  }

  .timeline-copy p {
    margin-bottom: 5px;
    font-size: 8px;
  }

  .timeline-copy h2 {
    margin-bottom: 5px;
    font-size: clamp(16px, 2.35vw, 21px);
    transition: font-size 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .timeline-copy > span {
    font-size: 10px;
  }

  .timeline-entry > .timeline-copy,
  .timeline-entry > .timeline-date,
  .timeline-entry > .timeline-mark {
    opacity: 0.34;
  }

  .timeline-entry.is-current > .timeline-copy,
  .timeline-entry.is-current > .timeline-date,
  .timeline-entry.is-current > .timeline-mark {
    opacity: 1;
  }

  .timeline-entry.is-current > .timeline-copy {
    color: var(--ink);
  }

  .timeline-entry.is-current .timeline-copy h2 {
    font-size: clamp(27px, 4vw, 38px);
  }

  .timeline-point.is-current > .timeline-copy {
    transform: translateX(5px);
  }

  .timeline-period.is-current > .timeline-copy {
    transform: translateX(-5px);
  }

  .timeline-entry.is-current > .timeline-date time {
    color: var(--accent);
  }

  .timeline-entry.is-current > .timeline-mark {
    z-index: 3;
    background: var(--accent);
  }

  .timeline-mobile-end {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    column-gap: 0;
    min-height: 42px;
    color: var(--muted);
  }

  .timeline-mobile-end.endpoint-now {
    min-height: 0;
    height: 0;
  }

  .timeline-mobile-end time {
    grid-column: 1;
    align-self: start;
    justify-self: end;
    padding-right: 22px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.055em;
    line-height: 1.15;
  }

  .timeline-mobile-end > span {
    z-index: 2;
    grid-column: 2;
    align-self: start;
    justify-self: center;
    width: 9px;
    height: 9px;
    margin-top: 1px;
    border: 2px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
  }

  .timeline-mobile-end.is-current-end > span {
    z-index: 3;
    background: var(--accent);
  }

  .timeline-mobile-end.is-current-end time {
    color: var(--accent);
  }

  .timeline-entry:has(.timeline-copy:hover) .timeline-copy,
  .timeline-entry:focus-within .timeline-copy,
  .timeline-entry.above:has(.timeline-copy:hover) .timeline-copy,
  .timeline-entry.above:focus-within .timeline-copy,
  .timeline-entry.below:has(.timeline-copy:hover) .timeline-copy,
  .timeline-entry.below:focus-within .timeline-copy,
  .timeline-entry.above.far:has(.timeline-copy:hover) .timeline-copy,
  .timeline-entry.above.far:focus-within .timeline-copy,
  .timeline-entry.below.far:has(.timeline-copy:hover) .timeline-copy,
  .timeline-entry.below.far:focus-within .timeline-copy {
    transform: translateX(5px);
  }

  .timeline-period:has(.timeline-copy:hover) .timeline-copy,
  .timeline-period:focus-within .timeline-copy {
    transform: translateX(-5px);
  }

  .profile-card-foot {
    justify-content: center;
    margin: 56px 0 0;
    line-height: 1.8;
  }
}

@media (max-width: 760px) {
  .profile-main {
    width: min(100% - 36px, 620px);
  }

  .timeline-axis,
  .timeline-future {
    left: 50%;
  }

  .timeline-entry,
  .timeline-point,
  .timeline-period,
  .timeline-mobile-end {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  }

  .timeline-copy h2 {
    font-size: clamp(15px, 4.2vw, 19px);
  }

  .timeline-entry.is-current .timeline-copy h2 {
    font-size: clamp(25px, 7vw, 31px);
  }

  .profile-card-foot {
    margin-left: 0;
  }
}

@media (max-width: 410px) {
  .profile-main {
    width: min(100% - 24px, 390px);
  }

  .timeline-axis {
    left: 50%;
  }

  .timeline-future {
    left: 50%;
  }

  .timeline-entry,
  .timeline-point,
  .timeline-period,
  .timeline-mobile-end {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
    column-gap: 0;
  }

  .profile-card-foot {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-entry,
  .timeline-copy,
  .timeline-copy h2,
  .timeline-axis::after {
    transition: none;
  }
}
