@font-face { font-family: "Portfolio Navigation"; font-weight: 400; src: url("../assets/portfolio-navigation.woff") format("woff"); }

/* The native viewport still scrolls. Only its visual control is replaced. */
html.has-page-scrollbar { scrollbar-width: none; }
html.has-page-scrollbar::-webkit-scrollbar { display: none; }
.page-scrollbar {
  position: fixed;
  inset: 4px 0 4px auto;
  z-index: 10000;
  width: 16px;
  touch-action: none;
  user-select: none;
}
.page-scrollbar > span {
  position: absolute;
  top: 0;
  right: 3px;
  width: 4px;
  border-radius: 8px;
  background: rgb(224 224 224 / 65%);
  box-shadow: 0 0 2px rgb(0 0 0 / 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, width .16s ease;
}
.page-scrollbar:is(.scrolling, :focus-visible, .dragging) > span { opacity: 1; }
.page-scrollbar:is(:focus-visible, .dragging) > span { width: 7px; }
@media (hover: hover) {
  .page-scrollbar:hover > span { width: 7px; opacity: 1; }
}
.page-scrollbar:focus-visible { outline: none; }
.page-scrollbar:focus-visible > span { outline: 1px solid currentColor; }
.page-scrollbar[hidden], html.intro-hold .page-scrollbar,
html:has(dialog[open], :fullscreen) .page-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) {
  .page-scrollbar > span { transition: none; }
}
@media (forced-colors: active) {
  .page-scrollbar > span { background: CanvasText; forced-color-adjust: none; }
}
.home-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(80.25%, 1348px);
  box-sizing: border-box;
  padding: min(1.25vw, 21px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  text-shadow: 0 1px 7px #000b;
  color: #f4f1e9;
  font: 400 16px/1.4 "Portfolio Navigation", sans-serif;
}
.home-header > * { pointer-events: auto; }
.home-header a { color: inherit; text-decoration: none; }
.signature { flex: none; }
.home-header button { background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; }
.home-links, .home-links ul { margin: 0; padding: 0; list-style: none; }
.home-links { margin-right: min(4vw, 68px); display: flex; align-items: center; gap: clamp(13px, 1.55vw, 26px); font-size: clamp(14px, 1.05vw, 18px); }
.home-links li { position: relative; }
.home-links a { display: inline-block; padding: .4em 0; }
.home-links a[aria-current], .home-links a:hover { text-decoration: underline; text-underline-offset: .65em; }
.home-links ul { display: none; position: absolute; min-width: 188px; padding: 10px 17px; background: #121212f5; }
.home-links li:has(> button[aria-expanded=true]) > ul { display: block; }
.menu-button { display: none; }
@media(max-width: 660px) {
  .home-header { padding: 6px 0; width: 82%; }
  .home-header .menu-button { display: block; padding: 6px; font-size: 14px; }
  #home-nav { display: none; position: absolute; right: 0; top: 100%; background: #101010f7; padding: 8px 16px; }
  .menu-button[aria-expanded=true] + #home-nav { display: block; }
  .home-links { flex-direction: column; align-items: start; margin: 0; gap: 3px; }
  .home-links ul { position: static; padding: 3px 10px; }
}
.wordmark-link img {
  display: block;
  width: 90%;
  height: auto;
  transition: opacity 180ms ease;
}
.home-header .wordmark-link {
  display: flex;
  align-items: center;
  width: clamp(146px, 14.5vw, 244px);
  min-height: 44px;
}
.site-node .wordmark-link {
  display: flex;
  align-items: center;
}
.wordmark-link:hover img { opacity: .8; }
.wordmark-link:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .wordmark-link img { transition: none; }
}

/* Reserve the signature's space while the introduction carries the name. */
.home-header .wordmark-link { transition: opacity 420ms ease; }
body.home-view .wordmark-link {
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms ease, visibility 0s linear 420ms;
  pointer-events: none;
}
body:has(> .portfolio-home.past-intro-title:not(.is-open)) .wordmark-link {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .home-header .wordmark-link, body.home-view .wordmark-link { transition: none; }
}

:is(.site-nav, .home-links) a {
  position: relative;
}
:is(.site-nav, .home-links) a[aria-current],
:is(.site-nav, .home-links) a:hover {
  border-bottom-color: transparent;
  text-decoration: none;
}
.home-links a:hover { opacity: .76; }
:is(.site-nav, .home-links) a[aria-current]::after,
:is(.site-nav, .home-links) > li:has(ul a[aria-current]) > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
  pointer-events: none;
}

.home-intro #intro-title img {
  display: block;
  width: clamp(265px, 25.5cqw, 416px);
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

@media (width > 660px) {
  .home-header #home-nav {
    position: absolute;
    inset-inline: 0;
    top: 50%;
    transform: translateY(-50%);
    container-type: inline-size;
    pointer-events: none;
    --wide-gap: min(13.6vw, 228px);
    --tight-gap: clamp(13px, 1.55vw, 26px);
    --travel: 1050ms cubic-bezier(.42, 0, .22, 1);
  }
  /* Keep both the anchor and all four layout boxes stable throughout the slide. */
  .home-header .home-links {
    width: max-content;
    margin-inline: auto;
    gap: var(--wide-gap);
  }
  .home-header .home-links,
  .home-header .home-links > li {
    transform: translateX(0);
    transition: transform var(--travel);
    will-change: transform;
  }
  .home-header .home-links > li {
    --gaps-after: 0;
    pointer-events: auto;
  }
  .home-header .home-links > li:nth-child(1) { --gaps-after: 3; }
  .home-header .home-links > li:nth-child(2) { --gaps-after: 2; }
  .home-header .home-links > li:nth-child(3) { --gaps-after: 1; }

  /* Align the last link with its compact endpoint, then close the preceding gaps. */
  .home-header .home-links {
    --compact: translateX(calc(50cqw - 50% - min(4vw, 68px)));
    --start: var(--nav-from-0, var(--compact));
    transform: var(--compact);
  }
  .home-header .home-links > li {
    --compact: translateX(calc(var(--gaps-after) * (var(--wide-gap) - var(--tight-gap))));
    transform: var(--compact);
  }
  body.home-view:not(:has(> .portfolio-home.past-intro-title:not(.is-open))) .home-links,
  body.home-view:not(:has(> .portfolio-home.past-intro-title:not(.is-open))) .home-links > li {
    transform: translateX(0);
  }
  .home-header .home-links > li:nth-child(1) { --start: var(--nav-from-1, var(--compact)); }
  .home-header .home-links > li:nth-child(2) { --start: var(--nav-from-2, var(--compact)); }
  .home-header .home-links > li:nth-child(3) { --start: var(--nav-from-3, var(--compact)); }
  .home-header .home-links > li:nth-child(4) { --start: var(--nav-from-4, var(--compact)); }
  .header-carry .home-header .home-links, .header-carry .home-header .home-links > li {
    transform: var(--start) !important;
    transition: none !important;
  }
  .header-carry .home-header .wordmark-link {
    opacity: var(--signature-from, 1) !important;
    visibility: visible !important;
    transition: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-header .home-links, .home-header .home-links > li { transition: none; }
}
